exo-jcr SVN: r3721 - jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2010-12-23 10:19:02 -0500 (Thu, 23 Dec 2010)
New Revision: 3721
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionChangesLog.java
Log:
JCR-1550: optimized changes log traversing
Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionChangesLog.java
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionChangesLog.java 2010-12-23 15:06:33 UTC (rev 3720)
+++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/SessionChangesLog.java 2010-12-23 15:19:02 UTC (rev 3721)
@@ -204,16 +204,24 @@
private void traverseChangesByIdentifier(String identifier, List<ItemState> changesList)
{
- for (int i = 0, length = items.size(); i < length; i++)
+ ItemState item = getItemState(identifier);
+ if (item != null)
{
- ItemState item = items.get(i);
- if (item.getData().getIdentifier().equals(identifier))
+ changesList.add(item);
+ Map<String, ItemState> children = lastChildPropertyStates.get(identifier);
+ if (children != null)
{
- changesList.add(item);
+ // Add all the properties
+ changesList.addAll(children.values());
}
- else if (item.getData().getParentIdentifier().equals(identifier))
+ children = lastChildNodeStates.get(identifier);
+ if (children != null)
{
- traverseChangesByIdentifier(item.getData().getIdentifier(), changesList);
+ // Recursively call the method traverseChangesByIdentifier(String identifier, List<ItemState> changesList) for each sub node
+ for (ItemState child : children.values())
+ {
+ traverseChangesByIdentifier(child.getData().getIdentifier(), changesList);
+ }
}
}
}
@@ -226,17 +234,27 @@
*/
public void eraseEventFire(String identifier)
{
- for (int i = 0, length = items.size(); i < length; i++)
+ ItemState item = getItemState(identifier);
+ if (item != null)
{
- ItemState item = items.get(i);
- if (item.getData().getIdentifier().equals(identifier))
+ item.eraseEventFire();
+ Map<String, ItemState> children = lastChildPropertyStates.get(identifier);
+ if (children != null)
{
- // erase flag
- item.eraseEventFire();
+ // Call the method ItemState.eraseEventFire() on each properties
+ for (ItemState child : children.values())
+ {
+ child.eraseEventFire();
+ }
}
- else if (item.getData().getParentIdentifier().equals(identifier))
+ children = lastChildNodeStates.get(identifier);
+ if (children != null)
{
- eraseEventFire(item.getData().getIdentifier());
+ // Recursively call the method eraseEventFire(String identifier) for each sub node
+ for (ItemState child : children.values())
+ {
+ eraseEventFire(child.getData().getIdentifier());
+ }
}
}
}
13 years, 5 months
exo-jcr SVN: r3720 - in jcr/trunk/exo.jcr.component.ext/src: test/java/org/exoplatform/services/jcr/ext/script/groovy and 1 other directory.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2010-12-23 10:06:33 -0500 (Thu, 23 Dec 2010)
New Revision: 3720
Added:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/BaseGroovyScriptManager.java
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestUpdateListener.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrClassPathEntry.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyClassLoaderProvider.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyCompiler.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyResourceLoader.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/NodeScriptKey.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/SimpleScriptKey.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/URLScriptKey.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/XMLGroovyScript2Rest.java
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/script/groovy/BaseGroovyTest.java
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyCompilerTest.java
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoaderTest.java
Log:
EXOJCR-1105
Added: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/BaseGroovyScriptManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/BaseGroovyScriptManager.java (rev 0)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/BaseGroovyScriptManager.java 2010-12-23 15:06:33 UTC (rev 3720)
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.jcr.ext.script.groovy;
+
+import org.exoplatform.services.rest.ext.groovy.GroovyJaxrsPublisher;
+import org.exoplatform.services.rest.ext.groovy.ResourceId;
+import org.exoplatform.services.rest.impl.ResourcePublicationException;
+
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.List;
+
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+
+/**
+ * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
+ * @version $Id$
+ * @deprecated
+ */
+// Contains all method what we do not need any more in GroovyScript2RestLoader
+// but need to keep for back compatibility.
+public abstract class BaseGroovyScriptManager
+{
+ protected GroovyJaxrsPublisher groovyPublisher;
+
+ public BaseGroovyScriptManager(GroovyJaxrsPublisher groovyPublisher)
+ {
+ this.groovyPublisher = groovyPublisher;
+ }
+
+ public boolean isLoaded(ScriptKey key)
+ {
+ return groovyPublisher.isPublished(key);
+ }
+
+ public boolean isLoaded(String key)
+ {
+ return isLoaded(new SimpleScriptKey(key));
+ }
+
+ public boolean isLoaded(URL url)
+ {
+ return isLoaded(new URLScriptKey(url));
+ }
+
+ public Response load(String repository, String workspace, String path, boolean state)
+ {
+ return load(repository, workspace, path, state, null);
+ }
+
+ public abstract Response load(String repository, String workspace, String path, boolean state, List<String> sources,
+ List<String> files, List<String> extensions, MultivaluedMap<String, String> properties);
+
+ public Response load(String repository, String workspace, String path, boolean state,
+ MultivaluedMap<String, String> properties)
+ {
+ return load(repository, workspace, path, state, null, null, null, properties);
+ }
+
+ public boolean loadScript(ScriptKey key, String name, InputStream stream) throws IOException
+ {
+ try
+ {
+ groovyPublisher.publishPerRequest(stream, key, null);
+ return true;
+ }
+ catch (ResourcePublicationException e)
+ {
+ return false;
+ }
+ }
+
+ public boolean loadScript(String key, InputStream stream) throws IOException
+ {
+ return loadScript(key, null, stream);
+ }
+
+ public boolean loadScript(String key, String name, InputStream stream) throws IOException
+ {
+ return loadScript(new SimpleScriptKey(key), name, stream);
+ }
+
+ public boolean loadScript(URL url) throws IOException
+ {
+ ResourceId key = new URLScriptKey(url);
+ try
+ {
+ groovyPublisher.publishPerRequest(new BufferedInputStream(url.openStream()), key, null);
+ return true;
+ }
+ catch (ResourcePublicationException e)
+ {
+ return true;
+ }
+ }
+
+ public boolean unloadScript(ScriptKey key)
+ {
+ return null != groovyPublisher.unpublishResource(key);
+ }
+
+ public boolean unloadScript(String key)
+ {
+ return unloadScript(new SimpleScriptKey(key));
+ }
+
+ public void unloadScript(URL url)
+ {
+ unloadScript(new URLScriptKey(url));
+ }
+
+ public Response validateScript(String name, final InputStream script)
+ {
+ return validateScript(name, script, null, null, null);
+ }
+
+ public abstract Response validateScript(String name, InputStream script, List<String> sources, List<String> files,
+ List<String> extensions);
+}
Property changes on: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/BaseGroovyScriptManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java 2010-12-23 15:04:43 UTC (rev 3719)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java 2010-12-23 15:06:33 UTC (rev 3720)
@@ -18,9 +18,8 @@
*/
package org.exoplatform.services.jcr.ext.script.groovy;
-import groovy.lang.GroovyClassLoader;
-
import org.apache.commons.fileupload.FileItem;
+import org.codehaus.groovy.control.CompilationFailedException;
import org.exoplatform.commons.utils.SecurityHelper;
import org.exoplatform.container.component.ComponentPlugin;
import org.exoplatform.container.configuration.ConfigurationManager;
@@ -33,21 +32,24 @@
import org.exoplatform.services.jcr.ext.common.SessionProvider;
import org.exoplatform.services.jcr.ext.registry.RegistryEntry;
import org.exoplatform.services.jcr.ext.registry.RegistryService;
+import org.exoplatform.services.jcr.ext.resource.UnifiedNodeReference;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import org.exoplatform.services.rest.ext.groovy.ClassPath;
+import org.exoplatform.services.rest.ext.groovy.ClassPathEntry;
+import org.exoplatform.services.rest.ext.groovy.ClassPathEntry.EntryType;
import org.exoplatform.services.rest.ext.groovy.GroovyClassLoaderProvider;
import org.exoplatform.services.rest.ext.groovy.GroovyJaxrsPublisher;
+import org.exoplatform.services.rest.ext.groovy.MalformedScriptException;
import org.exoplatform.services.rest.ext.groovy.ResourceId;
import org.exoplatform.services.rest.impl.ResourceBinder;
import org.exoplatform.services.rest.impl.ResourcePublicationException;
-import org.exoplatform.services.rest.resource.ResourceContainer;
import org.exoplatform.services.script.groovy.GroovyScriptInstantiator;
import org.picocontainer.Startable;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
-import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
@@ -93,8 +95,9 @@
* @version $Id: GroovyScript2RestLoader.java 34445 2009-07-24 07:51:18Z
* dkatayev $
*/
+@SuppressWarnings("deprecation")
@Path("script/groovy")
-public class GroovyScript2RestLoader implements Startable
+public class GroovyScript2RestLoader extends BaseGroovyScriptManager implements Startable
{
protected static class InnerGroovyJaxrsPublisher extends GroovyJaxrsPublisher
{
@@ -132,7 +135,7 @@
/** Keeps configuration for observation listener. */
private ObservationListenerConfiguration observationListenerConfiguration;
- protected GroovyJaxrsPublisher groovyPublisher;
+ //protected GroovyJaxrsPublisher groovyPublisher;
protected List<GroovyScript2RestLoaderPlugin> loadPlugins;
@@ -186,6 +189,7 @@
ConfigurationManager configurationManager, RegistryService registryService, GroovyJaxrsPublisher groovyPublisher,
org.exoplatform.services.jcr.ext.resource.jcr.Handler jcrUrlHandler, InitParams params)
{
+ super(groovyPublisher);
this.binder = binder;
this.repositoryService = repositoryService;
this.configurationManager = configurationManager;
@@ -196,72 +200,6 @@
}
/**
- * Remove script with specified URL from ResourceBinder.
- *
- * @param url the URL. The <code>url.toString()</code> must be corresponded
- * to script class.
- * @see GroovyScriptRestLoader#loadScript(URL).
- * @deprecated
- */
- public void unloadScript(URL url)
- {
- unloadScript(new URLScriptKey(url));
- }
-
- /**
- * Remove script by specified key from ResourceBinder.
- *
- * @param key the key with which script was created.
- * @see GroovyScript2RestLoader#loadScript(String, InputStream)
- * @see GroovyScript2RestLoader#loadScript(String, String, InputStream)
- * @deprecated
- */
- public boolean unloadScript(String key)
- {
- return unloadScript(new SimpleScriptKey(key));
- }
-
- /**
- * @param key
- * @return
- * @deprecated
- */
- public boolean unloadScript(ScriptKey key)
- {
- return null != groovyPublisher.unpublishResource(key);
- }
-
- /**
- * @param key script's key
- * @return true if script loaded false otherwise
- * @deprecated
- */
- public boolean isLoaded(String key)
- {
- return isLoaded(new SimpleScriptKey(key));
- }
-
- /**
- * @param url script's URL
- * @return true if script loaded false otherwise
- * @deprecated
- */
- public boolean isLoaded(URL url)
- {
- return isLoaded(new URLScriptKey(url));
- }
-
- /**
- * @param key script's key. With this key script was created.
- * @return true if script loaded false otherwise
- * @deprecated
- */
- public boolean isLoaded(ScriptKey key)
- {
- return groovyPublisher.isPublished(key);
- }
-
- /**
* Get node type for store scripts, may throw {@link IllegalStateException}
* if <tt>nodeType</tt> not initialized yet.
*
@@ -277,80 +215,8 @@
}
/**
- * @param url the URL for loading script.
- * @throws IOException it script can't be loaded.
- * @deprecated
+ * @see org.picocontainer.Startable#start()
*/
- public boolean loadScript(URL url) throws IOException
- {
- ResourceId key = new URLScriptKey(url);
- try
- {
- groovyPublisher.publishPerRequest(new BufferedInputStream(url.openStream()), key, null);
- return true;
- }
- catch (ResourcePublicationException e)
- {
- return true;
- }
- }
-
- /**
- * Load script from given stream.
- *
- * @param key the key which must be corresponded to object class name.
- * @param stream the stream which represents groovy script.
- * @return if script loaded false otherwise
- * @throws IOException if script can't be loaded or parsed.
- * @see ResourceBinder#bind(ResourceContainer)
- * @deprecated
- */
- public boolean loadScript(String key, InputStream stream) throws IOException
- {
- return loadScript(key, null, stream);
- }
-
- /**
- * Load script from given stream.
- *
- * @param key the key which must be corresponded to object class name.
- * @param name this name will be passed to compiler to get understandable if
- * compilation failed
- * @param stream the stream which represents groovy script.
- * @return if script loaded false otherwise
- * @throws IOException if script can't be loaded or parsed.
- * @see ResourceBinder#bind(ResourceContainer)
- * @deprecated
- */
- public boolean loadScript(String key, String name, InputStream stream) throws IOException
- {
- return loadScript(new SimpleScriptKey(key), name, stream);
- }
-
- /**
- * @param key the key which must be corresponded to object class name
- * @param name script name
- * @param stream the stream which represents groovy script.
- * @return if script loaded false otherwise
- * @throws IOException if script can't be loaded or parsed
- * @deprecated
- */
- public boolean loadScript(ScriptKey key, String name, InputStream stream) throws IOException
- {
- try
- {
- groovyPublisher.publishPerRequest(stream, key, null);
- return true;
- }
- catch (ResourcePublicationException e)
- {
- return false;
- }
- }
-
- /**
- * {@inheritDoc}
- */
public void start()
{
if (registryService != null && initParams != null && !registryService.getForceXMLConfigurationValue(initParams))
@@ -431,8 +297,19 @@
continue;
}
- this.groovyPublisher.publishPerRequest(node.getProperty("jcr:data").getStream(), new NodeScriptKey(
- repositoryName, workspaceName, node), null);
+ try
+ {
+ groovyPublisher.publishPerRequest(node.getProperty("jcr:data").getStream(), new NodeScriptKey(
+ repositoryName, workspaceName, node), null);
+ }
+ catch (CompilationFailedException e)
+ {
+ LOG.error(e.getMessage(), e);
+ }
+ catch (ResourcePublicationException e)
+ {
+ LOG.error(e.getMessage(), e);
+ }
}
session
@@ -458,16 +335,13 @@
}
/**
- * {@inheritDoc}
+ * @see org.picocontainer.Startable#stop()
*/
public void stop()
{
// nothing to do!
}
- /**
- * @param cp See {@link ComponentPlugin}
- */
public void addPlugin(ComponentPlugin cp)
{
if (cp instanceof GroovyScript2RestLoaderPlugin)
@@ -593,7 +467,6 @@
protected void readParamsFromRegistryService(SessionProvider sessionProvider) throws PathNotFoundException,
RepositoryException
{
-
if (LOG.isDebugEnabled())
{
LOG.debug("<<< Read init parametrs from registry service.");
@@ -743,6 +616,8 @@
}
}
+ ////////////////////////////////////////////////////////////////////////////////////
+
/**
* This method is useful for clients that can send script in request body
* without form-data. At required to set specific Content-type header
@@ -795,52 +670,14 @@
}
/**
- * @param name script name
- * @param stream script for validation
- */
- @POST
- @Consumes({"script/groovy"})
- @Path("validate{name:.*}")
- public Response validateScript(@PathParam("name") String name, final InputStream script)
- {
-
- final GroovyClassLoader groovyClassLoader = groovyPublisher.getGroovyClassLoader();
- if (name == null || name.length() == 0)
- {
- name = groovyClassLoader.generateScriptName();
- }
- else if (name.startsWith("/"))
- {
- name = name.substring(1);
- }
-
- try
- {
- final String fName = name;
- SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>() {
- public Void run() throws Exception
- {
- groovyClassLoader.parseClass(script, fName);
- return null;
- }
- });
-
- return Response.status(Response.Status.OK).build();
- }
- catch (Exception e)
- {
- LOG.error(e.getMessage(), e);
- return Response.status(Response.Status.BAD_REQUEST).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build();
- }
-
- }
-
- /**
- * This method is useful for clients that can send script in request body
- * without form-data. At required to set specific Content-type header
- * 'script/groovy'.
+ * This method is useful for clients that send scripts as file in
+ * 'multipart/*' request body. <br/>
+ * NOTE even we use iterator item should be only one, rule one address - one
+ * script. This method is created just for comfort loading script from HTML
+ * form. NOT use this script for uploading few files in body of
+ * 'multipart/form-data' or other type of multipart.
*
- * @param stream the stream that contains groovy source code
+ * @param items iterator {@link FileItem}
* @param uriInfo see {@link UriInfo}
* @param repository repository name
* @param workspace workspace name
@@ -848,9 +685,9 @@
* @return Response with status 'created'
*/
@POST
- @Consumes({"script/groovy"})
- @Path("update/{repository}/{workspace}/{path:.*}")
- public Response updateScript(InputStream stream, @Context UriInfo uriInfo,
+ @Consumes({"multipart/*"})
+ @Path("add/{repository}/{workspace}/{path:.*}")
+ public Response addScript(Iterator<FileItem> items, @Context UriInfo uriInfo,
@PathParam("repository") String repository, @PathParam("workspace") String workspace,
@PathParam("path") String path)
{
@@ -860,8 +697,24 @@
ses =
sessionProviderService.getSessionProvider(null).getSession(workspace,
repositoryService.getRepository(repository));
- Node node = (Node)ses.getItem("/" + path);
- node.getNode("jcr:content").setProperty("jcr:data", stream);
+ Node node = (Node)ses.getItem(getPath(path));
+ InputStream stream = null;
+ boolean autoload = false;
+ while (items.hasNext())
+ {
+ FileItem fitem = items.next();
+ if (fitem.isFormField() && fitem.getFieldName() != null
+ && fitem.getFieldName().equalsIgnoreCase("autoload"))
+ {
+ autoload = Boolean.valueOf(fitem.getString());
+ }
+ else if (!fitem.isFormField())
+ {
+ stream = fitem.getInputStream();
+ }
+ }
+
+ createScript(node, getName(path), autoload, stream);
ses.save();
URI location = uriInfo.getBaseUriBuilder().path(getClass(), "getScript").build(repository, workspace, path);
return Response.created(location).build();
@@ -888,14 +741,76 @@
}
/**
- * This method is useful for clients that send scripts as file in
- * 'multipart/*' request body. <br/>
- * NOTE even we use iterator item should be only one, rule one address - one
- * script. This method is created just for comfort loading script from HTML
- * form. NOT use this script for uploading few files in body of
- * 'multipart/form-data' or other type of multipart.
+ * Check is specified source <code>script</code> contains valid Groovy source
+ * code.
*
- * @param items iterator {@link FileItem}
+ * @param name script name. This name will be used by GroovyClassLoader to
+ * identify script, e.g. specified name will be used in error
+ * message in compilation of Groovy fails. If this parameter is
+ * <code>null</code> then GroovyClassLoader will use automatically
+ * generated name
+ * @param script Groovy source stream
+ * @param sources locations (URL) of source folders that should be add in
+ * class path when compile Groovy script
+ * @param files locations (URL) of source files that should be add in class
+ * path when compile Groovy script
+ * @param extensions extensions of files from source folders that should be
+ * added in class path. By default only files with .groovy
+ * extension are processed. Extensions must be set in form
+ * '.{extensions}'
+ * @return Response with corresponded status. 200 if source code is valid
+ */
+ @POST
+ @Consumes({"script/groovy"})
+ @Path("validate{name:.*}")
+ public Response validateScript(@PathParam("name") String name, final InputStream script,
+ @QueryParam("sources") List<String> sources, @QueryParam("file") List<String> files,
+ @QueryParam("extension") List<String> extensions)
+ {
+ try
+ {
+ validateScript(name, script, createClassPath(sources, files, extensions));
+ return Response.ok().build();
+ }
+ catch (MalformedScriptException e)
+ {
+ LOG.error(e.getMessage(), e);
+ return Response.status(Response.Status.BAD_REQUEST).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build();
+ }
+ catch (MalformedURLException e)
+ {
+ LOG.error(e.getMessage(), e);
+ return Response.status(Response.Status.BAD_REQUEST).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build();
+ }
+ }
+
+ /**
+ * Check is specified source <code>script</code> contains valid Groovy source
+ * code.
+ *
+ * @param name script name. This name will be used by GroovyClassLoader to
+ * identify script, e.g. specified name will be used in error
+ * message in compilation of Groovy fails. If this parameter is
+ * <code>null</code> then GroovyClassLoader will use automatically
+ * generated name
+ * @param script Groovy source stream
+ * @param classPath class path
+ * @throws MalformedScriptException if <code>script</code> contains not valid
+ * source code
+ */
+ public void validateScript(String name, InputStream script, ClassPath classPath) throws MalformedScriptException
+ {
+ if (name != null && name.length() > 0 && name.startsWith("/"))
+ name = name.substring(1);
+ groovyPublisher.validateResource(script, name, classPath);
+ }
+
+ /**
+ * This method is useful for clients that can send script in request body
+ * without form-data. At required to set specific Content-type header
+ * 'script/groovy'.
+ *
+ * @param stream the stream that contains groovy source code
* @param uriInfo see {@link UriInfo}
* @param repository repository name
* @param workspace workspace name
@@ -903,9 +818,9 @@
* @return Response with status 'created'
*/
@POST
- @Consumes({"multipart/*"})
- @Path("add/{repository}/{workspace}/{path:.*}")
- public Response addScript(Iterator<FileItem> items, @Context UriInfo uriInfo,
+ @Consumes({"script/groovy"})
+ @Path("update/{repository}/{workspace}/{path:.*}")
+ public Response updateScript(InputStream stream, @Context UriInfo uriInfo,
@PathParam("repository") String repository, @PathParam("workspace") String workspace,
@PathParam("path") String path)
{
@@ -915,24 +830,8 @@
ses =
sessionProviderService.getSessionProvider(null).getSession(workspace,
repositoryService.getRepository(repository));
- Node node = (Node)ses.getItem(getPath(path));
- InputStream stream = null;
- boolean autoload = false;
- while (items.hasNext())
- {
- FileItem fitem = items.next();
- if (fitem.isFormField() && fitem.getFieldName() != null
- && fitem.getFieldName().equalsIgnoreCase("autoload"))
- {
- autoload = Boolean.valueOf(fitem.getString());
- }
- else if (!fitem.isFormField())
- {
- stream = fitem.getInputStream();
- }
- }
-
- createScript(node, getName(path), autoload, stream);
+ Node node = (Node)ses.getItem("/" + path);
+ node.getNode("jcr:content").setProperty("jcr:data", stream);
ses.save();
URI location = uriInfo.getBaseUriBuilder().path(getClass(), "getScript").build(repository, workspace, path);
return Response.created(location).build();
@@ -1020,35 +919,105 @@
}
/**
- * Get source code of groovy script.
+ * Deploy groovy script as REST service. If this property set to 'true' then
+ * script will be deployed as REST service if 'false' the script will be
+ * undeployed. NOTE is script already deployed and <tt>state</tt> is
+ * <tt>true</tt> script will be re-deployed.
*
* @param repository repository name
* @param workspace workspace name
- * @param path JCR path to node that contains script
- * @return groovy script as stream
+ * @param path the path to JCR node that contains groovy script to be
+ * deployed
+ * @param state <code>true</code> if resource should be loaded and
+ * <code>false</code> otherwise. If this attribute is not present
+ * in HTTP request then it will be considered as <code>true</code>
+ * @param sources locations (URL) of source folders that should be add in
+ * class path when compile Groovy script
+ * @param files locations (URL) of source files that should be add in class
+ * path when compile Groovy script
+ * @param extensions extensions of files from source folders that should be
+ * added in class path. By default only files with .groovy
+ * extension are processed. Extensions must be set in form
+ * '.{extensions}'
+ * @param properties optional properties to be applied to loaded resource.
+ * Ignored if <code>state</code> parameter is false
*/
@POST
- @Produces({"script/groovy"})
- @Path("src/{repository}/{workspace}/{path:.*}")
- public Response getScript(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
- @PathParam("path") String path)
+ @Path("load/{repository}/{workspace}/{path:.*}")
+ @RolesAllowed({"administrators"})
+ public Response load(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
+ @PathParam("path") String path, @DefaultValue("true") @QueryParam("state") boolean state,
+ @QueryParam("sources") List<String> sources, @QueryParam("file") List<String> files,
+ @QueryParam("extension") List<String> extensions, MultivaluedMap<String, String> properties)
{
+ try
+ {
+ return load(repository, workspace, path, state, properties, createClassPath(sources, files, extensions));
+ }
+ catch (MalformedURLException e)
+ {
+ LOG.error(e.getMessage(), e);
+ return Response.status(Response.Status.BAD_REQUEST).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build();
+ }
+ }
+
+ /**
+ * Deploy groovy script as REST service. If this property set to 'true' then
+ * script will be deployed as REST service if 'false' the script will be
+ * undeployed. NOTE is script already deployed and <tt>state</tt> is
+ * <tt>true</tt> script will be re-deployed.
+ *
+ * @param repository repository name
+ * @param workspace workspace name
+ * @param path the path to JCR node that contains groovy script to be
+ * deployed
+ * @param state <code>true</code> if resource should be loaded and
+ * <code>false</code> otherwise. If this attribute is not present
+ * in HTTP request then it will be considered as <code>true</code>
+ * @param properties optional properties to be applied to loaded resource.
+ * Ignored if <code>state</code> parameter is false
+ * @param classPath class path
+ */
+ public Response load(String repository, String workspace, String path, boolean state,
+ MultivaluedMap<String, String> properties, ClassPath classPath)
+ {
Session ses = null;
try
{
ses =
sessionProviderService.getSessionProvider(null).getSession(workspace,
repositoryService.getRepository(repository));
- Node scriptFile = (Node)ses.getItem("/" + path);
- return Response.status(Response.Status.OK)
- .entity(scriptFile.getNode("jcr:content").getProperty("jcr:data").getStream()).type("script/groovy")
- .build();
+ Node script = ((Node)ses.getItem("/" + path)).getNode("jcr:content");
+ ResourceId key = new NodeScriptKey(repository, workspace, script);
+ if (state)
+ {
+ groovyPublisher.unpublishResource(key);
+ groovyPublisher.publishPerRequest(script.getProperty("jcr:data").getStream(), key, properties, classPath);
+ }
+ else
+ {
+ if (null == groovyPublisher.unpublishResource(key))
+ {
+ return Response.status(Response.Status.BAD_REQUEST)
+ .entity("Can't unbind script " + path + ", not bound or has wrong mapping to the resource class ")
+ .type(MediaType.TEXT_PLAIN).build();
+ }
+ }
+ return Response.status(Response.Status.NO_CONTENT).build();
}
+ catch (CompilationFailedException e)
+ {
+ return Response.status(Response.Status.BAD_REQUEST).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build();
+ }
+ catch (ResourcePublicationException e)
+ {
+ return Response.status(Response.Status.BAD_REQUEST).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build();
+ }
catch (PathNotFoundException e)
{
String msg = "Path " + path + " does not exists";
LOG.error(msg);
- return Response.status(Response.Status.NOT_FOUND).entity(msg).entity(MediaType.TEXT_PLAIN).build();
+ return Response.status(Response.Status.NOT_FOUND).entity(msg).type(MediaType.TEXT_PLAIN).build();
}
catch (Exception e)
{
@@ -1066,18 +1035,16 @@
}
/**
- * Get groovy script's meta-information.
+ * Remove node that contains groovy script.
*
* @param repository repository name
* @param workspace workspace name
* @param path JCR path to node that contains script
- * @return groovy script's meta-information
*/
@POST
- @Produces({MediaType.APPLICATION_JSON})
- @Path("meta/{repository}/{workspace}/{path:.*}")
- public Response getScriptMetadata(@PathParam("repository") String repository,
- @PathParam("workspace") String workspace, @PathParam("path") String path)
+ @Path("delete/{repository}/{workspace}/{path:.*}")
+ public Response deleteScript(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
+ @PathParam("path") String path)
{
Session ses = null;
try
@@ -1085,14 +1052,9 @@
ses =
sessionProviderService.getSessionProvider(null).getSession(workspace,
repositoryService.getRepository(repository));
- Node script = ((Node)ses.getItem("/" + path)).getNode("jcr:content");
- ResourceId key = new NodeScriptKey(repository, workspace, script);
-
- ScriptMetadata meta = new ScriptMetadata(script.getProperty("exo:autoload").getBoolean(), //
- groovyPublisher.isPublished(key), //
- script.getProperty("jcr:mimeType").getString(), //
- script.getProperty("jcr:lastModified").getDate().getTimeInMillis());
- return Response.status(Response.Status.OK).entity(meta).type(MediaType.APPLICATION_JSON).build();
+ ses.getItem("/" + path).remove();
+ ses.save();
+ return Response.status(Response.Status.NO_CONTENT).build();
}
catch (PathNotFoundException e)
{
@@ -1116,16 +1078,22 @@
}
/**
- * Remove node that contains groovy script.
+ * Change exo:autoload property. If this property is 'true' script will be
+ * deployed automatically when JCR repository startup and automatically
+ * re-deployed when script source code changed.
*
* @param repository repository name
* @param workspace workspace name
* @param path JCR path to node that contains script
+ * @param state value for property exo:autoload, if it is not specified then
+ * 'true' will be used as default. <br />
+ * Example: .../scripts/groovy/test1.groovy/load is the same to
+ * .../scripts/groovy/test1.groovy/load?state=true
*/
@POST
- @Path("delete/{repository}/{workspace}/{path:.*}")
- public Response deleteScript(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
- @PathParam("path") String path)
+ @Path("autoload/{repository}/{workspace}/{path:.*}")
+ public Response autoload(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
+ @PathParam("path") String path, @DefaultValue("true") @QueryParam("state") boolean state)
{
Session ses = null;
try
@@ -1133,7 +1101,8 @@
ses =
sessionProviderService.getSessionProvider(null).getSession(workspace,
repositoryService.getRepository(repository));
- ses.getItem("/" + path).remove();
+ Node script = ((Node)ses.getItem("/" + path)).getNode("jcr:content");
+ script.setProperty("exo:autoload", state);
ses.save();
return Response.status(Response.Status.NO_CONTENT).build();
}
@@ -1159,22 +1128,18 @@
}
/**
- * Change exo:autoload property. If this property is 'true' script will be
- * deployed automatically when JCR repository startup and automatically
- * re-deployed when script source code changed.
+ * Get source code of groovy script.
*
* @param repository repository name
* @param workspace workspace name
* @param path JCR path to node that contains script
- * @param state value for property exo:autoload, if it is not specified then
- * 'true' will be used as default. <br />
- * Example: .../scripts/groovy/test1.groovy/load is the same to
- * .../scripts/groovy/test1.groovy/load?state=true
+ * @return groovy script as stream
*/
@POST
- @Path("autoload/{repository}/{workspace}/{path:.*}")
- public Response autoload(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
- @PathParam("path") String path, @DefaultValue("true") @QueryParam("state") boolean state)
+ @Produces({"script/groovy"})
+ @Path("src/{repository}/{workspace}/{path:.*}")
+ public Response getScript(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
+ @PathParam("path") String path)
{
Session ses = null;
try
@@ -1182,10 +1147,10 @@
ses =
sessionProviderService.getSessionProvider(null).getSession(workspace,
repositoryService.getRepository(repository));
- Node script = ((Node)ses.getItem("/" + path)).getNode("jcr:content");
- script.setProperty("exo:autoload", state);
- ses.save();
- return Response.status(Response.Status.NO_CONTENT).build();
+ Node scriptFile = (Node)ses.getItem("/" + path);
+ return Response.status(Response.Status.OK)
+ .entity(scriptFile.getNode("jcr:content").getProperty("jcr:data").getStream()).type("script/groovy")
+ .build();
}
catch (PathNotFoundException e)
{
@@ -1209,27 +1174,18 @@
}
/**
- * Deploy groovy script as REST service. If this property set to 'true' then
- * script will be deployed as REST service if 'false' the script will be
- * undeployed. NOTE is script already deployed and <tt>state</tt> is
- * <tt>true</tt> script will be re-deployed.
+ * Get groovy script's meta-information.
*
* @param repository repository name
* @param workspace workspace name
- * @param path the path to JCR node that contains groovy script to be
- * deployed
- * @param state <code>true</code> if resource should be loaded and
- * <code>false</code> otherwise. If this attribute is not present
- * in HTTP request then it will be considered as <code>true</code>
- * @param properties optional properties to be applied to loaded resource.
- * Ignored if <code>state</code> parameter is false
+ * @param path JCR path to node that contains script
+ * @return groovy script's meta-information
*/
@POST
- @Path("load/{repository}/{workspace}/{path:.*}")
- @RolesAllowed({"administrators"})
- public Response load(@PathParam("repository") String repository, @PathParam("workspace") String workspace,
- @PathParam("path") String path, @DefaultValue("true") @QueryParam("state") boolean state,
- MultivaluedMap<String, String> properties)
+ @Produces({MediaType.APPLICATION_JSON})
+ @Path("meta/{repository}/{workspace}/{path:.*}")
+ public Response getScriptMetadata(@PathParam("repository") String repository,
+ @PathParam("workspace") String workspace, @PathParam("path") String path)
{
Session ses = null;
try
@@ -1239,32 +1195,19 @@
repositoryService.getRepository(repository));
Node script = ((Node)ses.getItem("/" + path)).getNode("jcr:content");
ResourceId key = new NodeScriptKey(repository, workspace, script);
- if (state)
- {
- groovyPublisher.unpublishResource(key);
- groovyPublisher.publishPerRequest(script.getProperty("jcr:data").getStream(), key, properties);
- }
- else
- {
- if (null == groovyPublisher.unpublishResource(key))
- {
- return Response.status(Response.Status.BAD_REQUEST)
- .entity("Can't unbind script " + path + ", not bound or has wrong mapping to the resource class ")
- .type(MediaType.TEXT_PLAIN).build();
- }
- }
- return Response.status(Response.Status.NO_CONTENT).build();
+
+ ScriptMetadata meta = new ScriptMetadata(script.getProperty("exo:autoload").getBoolean(), //
+ groovyPublisher.isPublished(key), //
+ script.getProperty("jcr:mimeType").getString(), //
+ script.getProperty("jcr:lastModified").getDate().getTimeInMillis());
+ return Response.status(Response.Status.OK).entity(meta).type(MediaType.APPLICATION_JSON).build();
}
catch (PathNotFoundException e)
{
String msg = "Path " + path + " does not exists";
LOG.error(msg);
- return Response.status(Response.Status.NOT_FOUND).entity(msg).type(MediaType.TEXT_PLAIN).build();
+ return Response.status(Response.Status.NOT_FOUND).entity(msg).entity(MediaType.TEXT_PLAIN).build();
}
- catch (ResourcePublicationException e)
- {
- return Response.status(Response.Status.BAD_REQUEST).entity(e.getMessage()).type(MediaType.TEXT_PLAIN).build();
- }
catch (Exception e)
{
LOG.error(e.getMessage(), e);
@@ -1280,21 +1223,15 @@
}
}
- @Deprecated
- public Response load(String repository, String workspace, String path, boolean state)
- {
- return load(repository, workspace, path, state, null);
- }
-
/**
* Returns the list of all groovy-scripts found in workspace.
*
- * @param repository Repository name.
- * @param workspace Workspace name.
- * @param name Additional search parameter. If not emtpy method returns the
+ * @param repository repository name
+ * @param workspace workspace name
+ * @param name additional search parameter. If not empty method returns the
* list of script names matching wildcard else returns all the
* scripts found in workspace.
- * @return
+ * @return list of groovy services
*/
@POST
@Produces(MediaType.APPLICATION_JSON)
@@ -1377,6 +1314,48 @@
}
}
+ ///////////////////////////////////////////////////////////////////////////////////////
+
+ private ClassPath createClassPath(List<String> sources, List<String> files, List<String> extensions)
+ throws MalformedURLException
+ {
+ if ((sources == null || sources.size() == 0) && (files == null || files.size() == 0)
+ && (extensions == null || extensions.size() == 0))
+ return null;
+
+ List<ClassPathEntry> classPathEntries = new ArrayList<ClassPathEntry>();
+
+ if (sources != null && sources.size() > 0)
+ {
+ for (String src : sources)
+ {
+ if (src.startsWith("jcr://"))
+ classPathEntries.add(new JcrClassPathEntry(EntryType.SRC_DIR, new URL(null, src, UnifiedNodeReference
+ .getURLStreamHandler())));
+ else
+ classPathEntries.add(new JcrClassPathEntry(EntryType.SRC_DIR, new URL(src)));
+ }
+ }
+
+ if (files != null && files.size() > 0)
+ {
+ for (String file : files)
+ {
+ if (file.startsWith("jcr://"))
+ classPathEntries.add(new JcrClassPathEntry(EntryType.FILE, new URL(null, file, UnifiedNodeReference
+ .getURLStreamHandler())));
+ else
+ classPathEntries.add(new JcrClassPathEntry(EntryType.FILE, new URL(file)));
+ }
+ }
+
+ ClassPath classPath =
+ new ClassPath(classPathEntries.toArray(new ClassPathEntry[classPathEntries.size()]),
+ (extensions != null && extensions.size() > 0) ? extensions.toArray(new String[extensions.size()]) : null);
+
+ return classPath;
+ }
+
/**
* Extract path to node's parent from full path.
*
@@ -1406,7 +1385,6 @@
*/
public static class ScriptMetadata
{
-
/** Is script autoload. */
private final boolean autoload;
@@ -1465,13 +1443,10 @@
*/
public static class ScriptList
{
-
/** The list of scripts. */
private List<String> list;
/**
- * Returns the list of scripts.
- *
* @return the list of scripts.
*/
public List<String> getList()
@@ -1480,14 +1455,11 @@
}
/**
- * ScriptList constructor.
- *
* @param the list of scripts
*/
public ScriptList(List<String> scriptList)
{
this.list = scriptList;
}
-
}
}
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestUpdateListener.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestUpdateListener.java 2010-12-23 15:04:43 UTC (rev 3719)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestUpdateListener.java 2010-12-23 15:06:33 UTC (rev 3720)
@@ -35,9 +35,9 @@
* @version $Id: GroovyScript2RestUpdateListener.java 34445 2009-07-24 07:51:18Z
* dkatayev $
*/
+@SuppressWarnings("deprecation")
public class GroovyScript2RestUpdateListener implements EventListener
{
-
/** Logger. */
private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.ext.GroovyScript2RestUpdateListener");
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrClassPathEntry.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrClassPathEntry.java 2010-12-23 15:04:43 UTC (rev 3719)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrClassPathEntry.java 2010-12-23 15:06:33 UTC (rev 3720)
@@ -22,6 +22,7 @@
import org.exoplatform.services.rest.ext.groovy.ClassPathEntry;
import java.net.MalformedURLException;
+import java.net.URL;
/**
* @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
@@ -29,8 +30,13 @@
*/
public class JcrClassPathEntry extends ClassPathEntry
{
+ public JcrClassPathEntry(EntryType type, URL path)
+ {
+ super(type, path);
+ }
+
public JcrClassPathEntry(EntryType type, UnifiedNodeReference path) throws MalformedURLException
{
- super(type, path.getURL());
+ this(type, path.getURL());
}
}
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyClassLoaderProvider.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyClassLoaderProvider.java 2010-12-23 15:04:43 UTC (rev 3719)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyClassLoaderProvider.java 2010-12-23 15:06:33 UTC (rev 3720)
@@ -20,9 +20,10 @@
import groovy.lang.GroovyClassLoader;
+import org.exoplatform.services.rest.ext.groovy.ClassPath;
import org.exoplatform.services.rest.ext.groovy.ClassPathEntry;
+import org.exoplatform.services.rest.ext.groovy.ClassPathEntry.EntryType;
import org.exoplatform.services.rest.ext.groovy.GroovyClassLoaderProvider;
-import org.exoplatform.services.rest.ext.groovy.ClassPathEntry.EntryType;
import java.net.MalformedURLException;
import java.net.URL;
@@ -33,29 +34,34 @@
/**
* @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
- * @version $Id$
+ * @version $Id: JcrGroovyClassLoaderProvider.java 3702 2010-12-22 10:24:13Z
+ * aparfonov $
*/
public class JcrGroovyClassLoaderProvider extends GroovyClassLoaderProvider
{
/**
- * @see org.exoplatform.services.rest.ext.groovy.GroovyClassLoaderProvider#getGroovyClassLoader(org.exoplatform.services.rest.ext.groovy.ClassPathEntry[])
+ * @see org.exoplatform.services.rest.ext.groovy.GroovyClassLoaderProvider#getGroovyClassLoader(org.exoplatform.services.rest.ext.groovy.ClassPath)
*/
@Override
- public GroovyClassLoader getGroovyClassLoader(ClassPathEntry[] classPath) throws MalformedURLException
+ public GroovyClassLoader getGroovyClassLoader(ClassPath classPath) throws MalformedURLException
{
List<URL> files = new ArrayList<URL>();
List<URL> roots = new ArrayList<URL>();
- for (int i = 0; i < classPath.length; i++)
+ ClassPathEntry[] classPathEntries = classPath.getEntries();
+ if (classPathEntries != null && classPathEntries.length > 0)
{
- ClassPathEntry classPathEntry = classPath[i];
- if (EntryType.SRC_DIR == classPathEntry.getType())
+ for (int i = 0; i < classPathEntries.length; i++)
{
- roots.add(classPathEntry.getPath());
+ ClassPathEntry classPathEntry = classPathEntries[i];
+ if (EntryType.SRC_DIR == classPathEntry.getType())
+ {
+ roots.add(classPathEntry.getPath());
+ }
+ else
+ {
+ files.add(classPathEntry.getPath());
+ }
}
- else
- {
- files.add(classPathEntry.getPath());
- }
}
final GroovyClassLoader parent = getGroovyClassLoader();
GroovyClassLoader classLoader = AccessController.doPrivileged(new PrivilegedAction<GroovyClassLoader>() {
@@ -65,7 +71,7 @@
}
});
classLoader.setResourceLoader(new JcrGroovyResourceLoader(roots.toArray(new URL[roots.size()]), files
- .toArray(new URL[files.size()])));
+ .toArray(new URL[files.size()]), classPath.getExtensions()));
return classLoader;
}
}
\ No newline at end of file
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyCompiler.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyCompiler.java 2010-12-23 15:04:43 UTC (rev 3719)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyCompiler.java 2010-12-23 15:06:33 UTC (rev 3720)
@@ -27,6 +27,7 @@
import org.exoplatform.services.jcr.ext.resource.UnifiedNodeReference;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
+import org.exoplatform.services.rest.ext.groovy.ClassPath;
import org.exoplatform.services.rest.ext.groovy.ClassPathEntry;
import org.exoplatform.services.rest.ext.groovy.ClassPathEntry.EntryType;
import org.exoplatform.services.rest.ext.groovy.GroovyClassLoaderProvider;
@@ -76,18 +77,23 @@
ClassPathEntry[] classPath = new ClassPathEntry[sourceReferences.length];
for (int i = 0; i < classPath.length; i++)
classPath[i] = new JcrClassPathEntry(EntryType.FILE, sourceReferences[i]);
- return doCompile(classLoaderProvider.getGroovyClassLoader(classPath), sourceReferences);
+ return doCompile(classLoaderProvider.getGroovyClassLoader(new ClassPath(classPath, null)), sourceReferences);
}
- public Class<?>[] compile(ClassPathEntry[] classPath, UnifiedNodeReference... sourceReferences) throws IOException
+ public Class<?>[] compile(ClassPath classPath, UnifiedNodeReference... sourceReferences) throws IOException
{
ClassPathEntry[] compiled = new ClassPathEntry[sourceReferences.length];
for (int i = 0; i < compiled.length; i++)
compiled[i] = new JcrClassPathEntry(EntryType.FILE, sourceReferences[i]);
- ClassPathEntry[] fullClassPath = new ClassPathEntry[compiled.length + classPath.length];
+ ClassPathEntry[] classPathEntries = classPath.getEntries();
+ if (classPathEntries == null)
+ classPathEntries = new ClassPathEntry[0];
+ ClassPathEntry[] fullClassPath = new ClassPathEntry[compiled.length + classPathEntries.length];
System.arraycopy(compiled, 0, fullClassPath, 0, compiled.length);
- System.arraycopy(classPath, 0, fullClassPath, compiled.length, classPath.length);
- return doCompile(classLoaderProvider.getGroovyClassLoader(fullClassPath), sourceReferences);
+ System.arraycopy(classPathEntries, 0, fullClassPath, compiled.length, classPathEntries.length);
+ return doCompile(
+ classLoaderProvider.getGroovyClassLoader(new ClassPath(fullClassPath, classPath.getExtensions())),
+ sourceReferences);
}
private Class<?>[] doCompile(final GroovyClassLoader cl, final UnifiedNodeReference... sourceReferences)
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyResourceLoader.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyResourceLoader.java 2010-12-23 15:04:43 UTC (rev 3719)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/JcrGroovyResourceLoader.java 2010-12-23 15:06:33 UTC (rev 3720)
@@ -61,9 +61,14 @@
return res;
}
+ public JcrGroovyResourceLoader(URL[] roots, URL[] files, String[] extensions) throws MalformedURLException
+ {
+ super(normalizeJcrURL(roots), files, extensions);
+ }
+
public JcrGroovyResourceLoader(URL[] roots, URL[] files) throws MalformedURLException
{
- super(normalizeJcrURL(roots), files);
+ this(roots, files, null);
}
public JcrGroovyResourceLoader(URL[] roots) throws MalformedURLException
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/NodeScriptKey.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/NodeScriptKey.java 2010-12-23 15:04:43 UTC (rev 3719)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/NodeScriptKey.java 2010-12-23 15:06:33 UTC (rev 3720)
@@ -29,7 +29,6 @@
*/
public class NodeScriptKey extends BaseResourceId implements ScriptKey
{
-
private final String repositoryName;
private final String workspaceName;
@@ -63,5 +62,4 @@
{
return path;
}
-
}
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/SimpleScriptKey.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/SimpleScriptKey.java 2010-12-23 15:04:43 UTC (rev 3719)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/SimpleScriptKey.java 2010-12-23 15:06:33 UTC (rev 3720)
@@ -27,10 +27,8 @@
*/
public class SimpleScriptKey extends BaseResourceId implements ScriptKey
{
-
public SimpleScriptKey(String key)
{
super(key);
}
-
}
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/URLScriptKey.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/URLScriptKey.java 2010-12-23 15:04:43 UTC (rev 3719)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/URLScriptKey.java 2010-12-23 15:06:33 UTC (rev 3720)
@@ -28,10 +28,8 @@
*/
public class URLScriptKey extends BaseResourceId implements ScriptKey
{
-
public URLScriptKey(URL url)
{
super(url.toString());
}
-
}
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/XMLGroovyScript2Rest.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/XMLGroovyScript2Rest.java 2010-12-23 15:04:43 UTC (rev 3719)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/XMLGroovyScript2Rest.java 2010-12-23 15:06:33 UTC (rev 3720)
@@ -24,22 +24,13 @@
*/
public class XMLGroovyScript2Rest
{
-
- /**
- * Script name.
- */
+ /** Script name. */
private String name;
- /**
- * From this URL script will be loaded.
- */
+ /** From this URL script will be loaded. */
private String path;
- /**
- * If this parameter true script will be loaded automatically.
- *
- * @see {@link GroovyScript2RestLoader}
- */
+ /** If this parameter true script will be loaded automatically. */
private boolean autoload;
public XMLGroovyScript2Rest(String name, String path, boolean autoload)
@@ -112,5 +103,4 @@
this.autoload).append("}");
return sb.toString();
}
-
}
Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/script/groovy/BaseGroovyTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/script/groovy/BaseGroovyTest.java 2010-12-23 15:04:43 UTC (rev 3719)
+++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/script/groovy/BaseGroovyTest.java 2010-12-23 15:06:33 UTC (rev 3720)
@@ -45,7 +45,17 @@
return createScript(parent, packageName, name, new ByteArrayInputStream(text.getBytes()));
}
- protected String createScript(Node parent, String packageName, String name, InputStream text) throws RepositoryException
+ /**
+ * @param parent parent node
+ * @param packageName package name. Segment of package name must be separated
+ * by '.'. If required folders in hierarchy does not exists they
+ * will be created
+ * @param name name of file with extension
+ * @param text source code
+ * @return path where script was created
+ */
+ protected String createScript(Node parent, String packageName, String name, InputStream text)
+ throws RepositoryException
{
Node current = parent;
if (packageName != null && packageName.length() > 0)
@@ -58,7 +68,7 @@
current = current.getNode(s);
}
}
- Node script = current.addNode(name + ".groovy", "nt:file");
+ Node script = current.addNode(name, "nt:file");
Node scriptContent = script.addNode("jcr:content", "nt:resource");
scriptContent.setProperty("jcr:mimeType", "script/groovy");
scriptContent.setProperty("jcr:lastModified", Calendar.getInstance());
Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyCompilerTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyCompilerTest.java 2010-12-23 15:04:43 UTC (rev 3719)
+++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyCompilerTest.java 2010-12-23 15:06:33 UTC (rev 3720)
@@ -22,6 +22,7 @@
import groovy.lang.GroovyObject;
import org.exoplatform.services.jcr.ext.resource.UnifiedNodeReference;
+import org.exoplatform.services.rest.ext.groovy.ClassPath;
import org.exoplatform.services.rest.ext.groovy.ClassPathEntry;
import org.exoplatform.services.rest.ext.groovy.GroovyClassLoaderProvider;
import org.exoplatform.services.rest.ext.groovy.ClassPathEntry.EntryType;
@@ -50,11 +51,11 @@
otherGroovyRepo = root.addNode("otherGroovyRepo", "nt:folder");
// Add script in shared "dependency repository".
- scriptA = createScript(groovyRepo, "org.exoplatform", "A", //
+ scriptA = createScript(groovyRepo, "org.exoplatform", "A.groovy", //
"package org.exoplatform\n" + //
"class A { String message = 'groovy compiler test' }");
- scriptB = createScript(groovyRepo, "org.exoplatform.test", "B", //
+ scriptB = createScript(groovyRepo, "org.exoplatform.test", "B.groovy", //
"package org.exoplatform.test\n" + //
"import org.exoplatform.A\n" + //
"class B extends A {}");
@@ -91,8 +92,10 @@
{
GroovyClassLoaderProvider classLoaderProvider = new GroovyClassLoaderProvider();
JcrGroovyCompiler compiler = new JcrGroovyCompiler(classLoaderProvider);
+ ClassPathEntry[] classPathEntries =
+ new ClassPathEntry[]{new JcrClassPathEntry(EntryType.FILE, new UnifiedNodeReference("db1", "ws", scriptA))};
Class<?>[] classes = compiler.compile( //
- new ClassPathEntry[]{new JcrClassPathEntry(EntryType.FILE, new UnifiedNodeReference("db1", "ws", scriptA))}, //
+ new ClassPath(classPathEntries, null), //
new UnifiedNodeReference("db1", "ws", scriptB));
assertEquals(1, classes.length);
GroovyObject go = (GroovyObject)classes[0].newInstance();
@@ -101,20 +104,20 @@
public void testCombinedDependencies() throws Exception
{
- String scriptC = createScript(otherGroovyRepo, "org.exoplatform.test", "C", //
+ String scriptC = createScript(otherGroovyRepo, "org.exoplatform.test", "C.groovy", //
"package org.exoplatform.test\n" + //
"import org.exoplatform.*\n" + //
"class C extends B {}");
- String scriptD = createScript(otherGroovyRepo, "org.exoplatform.test.other", "D", //
+ String scriptD = createScript(otherGroovyRepo, "org.exoplatform.test.other", "D.groovy", //
"package org.exoplatform.test.other\n" + //
"import org.exoplatform.test.C\n" + //
"class D extends C {}");
-
+
GroovyClassLoaderProvider classLoaderProvider = new GroovyClassLoaderProvider();
classLoaderProvider.getGroovyClassLoader().setResourceLoader(
new JcrGroovyResourceLoader(new java.net.URL[]{new java.net.URL("jcr://db1/ws#/groovyRepo")}));
-
+
JcrGroovyCompiler compiler = new JcrGroovyCompiler(classLoaderProvider);
Class<?>[] classes =
compiler.compile(new UnifiedNodeReference("db1", "ws", scriptD),
Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoaderTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoaderTest.java 2010-12-23 15:04:43 UTC (rev 3719)
+++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoaderTest.java 2010-12-23 15:06:33 UTC (rev 3720)
@@ -21,6 +21,7 @@
import org.exoplatform.services.jcr.ext.app.ThreadLocalSessionProviderService;
import org.exoplatform.services.jcr.ext.common.SessionProvider;
import org.exoplatform.services.jcr.ext.registry.RESTRegistryTest.DummyContainerResponseWriter;
+import org.exoplatform.services.jcr.ext.resource.UnifiedNodeReference;
import org.exoplatform.services.jcr.ext.script.groovy.GroovyScript2RestLoader.ScriptMetadata;
import org.exoplatform.services.rest.RequestHandler;
import org.exoplatform.services.rest.ext.method.filter.MethodAccessFilter;
@@ -39,6 +40,7 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.net.URLEncoder;
import java.security.Principal;
import java.util.Calendar;
import java.util.HashSet;
@@ -143,7 +145,7 @@
assertEquals(resourceNumber, binder.getSize());
}
- public void testRemoteAccessGetMetatData() throws Exception
+ public void testGetMetatData() throws Exception
{
MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
headers.putSingle("Accept", MediaType.APPLICATION_JSON);
@@ -155,7 +157,7 @@
assertTrue(Boolean.valueOf(data.getLoad()));
}
- public void testRemoteAccessAutoload() throws Exception
+ public void testAutoload() throws Exception
{
ContainerResponse cres =
@@ -170,7 +172,7 @@
assertTrue(script.getProperty("exo:autoload").getBoolean());
}
- public void testRemoteAccessLoad() throws Exception
+ public void testLoad() throws Exception
{
EnvironmentContext ctx = new EnvironmentContext();
ctx.put(SecurityContext.class, adminSecurityContext);
@@ -186,8 +188,105 @@
assertEquals(resourceNumber + 1, binder.getSize());
}
- public void testRemoteAccessDelete() throws Exception
+ public void testLoadNoExtClassPath() throws Exception
{
+ String path = createScript(testRoot, "test.load", "Test000.groovy", //
+ "import test.load.User000\n" + //
+ "@javax.ws.rs.Path('test/load') class Test000 {\n" + //
+ "def user = new User(name:'test')\n" + //
+ "@javax.ws.rs.GET def m() {user}" + //
+ "}\n");
+ EnvironmentContext ctx = new EnvironmentContext();
+ ctx.put(SecurityContext.class, adminSecurityContext);
+
+ int before = binder.getSize();
+ ContainerResponse cres = launcher.service("POST", "/script/groovy/load/db1/ws" + path, "", null, null, ctx);
+ assertEquals(400, cres.getStatus());
+ int after = binder.getSize();
+ assertEquals(before, after);
+ }
+
+ public void testLoadNoExtClassPath_File() throws Exception
+ {
+ String scriptPath = createScript(testRoot, "test.load", "Test001.groovy", //
+ "import test.load.User001\n" + //
+ "@javax.ws.rs.Path('test/load_001') class Test001 {\n" + //
+ "def user = new User001(name:'test')\n" + //
+ "@javax.ws.rs.GET def m() {user}" + //
+ "}\n");
+ String user = createScript(testRoot, "test.load", "User001.groovy",//
+ "package test.load\n" + //
+ "class User001 {def name}");
+
+ EnvironmentContext ctx = new EnvironmentContext();
+ ctx.put(SecurityContext.class, adminSecurityContext);
+ String path =
+ "/script/groovy/load/db1/ws" + scriptPath //
+ + "?file=" //
+ + URLEncoder.encode(new UnifiedNodeReference(repository.getName(), workspace.getName(), user).getURL()
+ .toString(), "UTF-8");
+ int before = binder.getSize();
+ ContainerResponse cres = launcher.service("POST", path, "", null, null, ctx);
+ assertEquals(204, cres.getStatus());
+ int after = binder.getSize();
+ assertEquals(before + 1, after);
+ }
+
+ public void testLoadNoExtClassPath_SourceFolder() throws Exception
+ {
+ String scriptPath = createScript(testRoot, "test.load", "Test002.groovy", //
+ "import test.load.User002\n" + //
+ "@javax.ws.rs.Path('test/load_002') class Test002 {\n" + //
+ "def user = new User002(name:'test')\n" + //
+ "@javax.ws.rs.GET def m() {user}" + //
+ "}\n");
+ createScript(testRoot, "test.load", "User002.groovy",//
+ "package test.load\n" + //
+ "class User002 {def name}");
+
+ EnvironmentContext ctx = new EnvironmentContext();
+ ctx.put(SecurityContext.class, adminSecurityContext);
+ String path =
+ "/script/groovy/load/db1/ws" + scriptPath //
+ + "?sources=" //
+ + URLEncoder.encode(new UnifiedNodeReference(repository.getName(), workspace.getName(), testRoot.getPath())
+ .getURL().toString(), "UTF-8");
+ int before = binder.getSize();
+ ContainerResponse cres = launcher.service("POST", path, "", null, null, ctx);
+ assertEquals(204, cres.getStatus());
+ int after = binder.getSize();
+ assertEquals(before + 1, after);
+ }
+
+ public void testLoadNoExtClassPath_CustomExtension() throws Exception
+ {
+ String scriptPath = createScript(testRoot, "test.load", "Test003.groovy", //
+ "import test.load.User003\n" + //
+ "@javax.ws.rs.Path('test/load_003') class Test003 {\n" + //
+ "def user = new User003(name:'test')\n" + //
+ "@javax.ws.rs.GET def m() {user}" + //
+ "}\n");
+ createScript(testRoot, "test.load", "User003.otherGroovy",//
+ "package test.load\n" + //
+ "class User003 {def name}");
+
+ EnvironmentContext ctx = new EnvironmentContext();
+ ctx.put(SecurityContext.class, adminSecurityContext);
+ String path =
+ "/script/groovy/load/db1/ws" + scriptPath //
+ + "?sources=" //
+ + URLEncoder.encode(new UnifiedNodeReference(repository.getName(), workspace.getName(), testRoot.getPath())
+ .getURL().toString(), "UTF-8") + //
+ "&extension=.otherGroovy";
+ int before = binder.getSize();
+ ContainerResponse cres = launcher.service("POST", path, "", null, null, ctx);
+ assertEquals(204, cres.getStatus());
+ int after = binder.getSize();
+ assertEquals(before + 1, after);
+ }
+
+ public void testDelete() throws Exception
+ {
ContainerResponse cres =
launcher.service("POST", "/script/groovy/delete/db1/ws/testRoot/script", "", null, null, null);
@@ -195,7 +294,7 @@
assertEquals(resourceNumber, binder.getSize());
}
- public void testRemoteAccessGetScript() throws Exception
+ public void testGetScript() throws Exception
{
MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
headers.putSingle("Accept", "script/groovy");
@@ -206,7 +305,7 @@
compareStream(script.getProperty("jcr:data").getStream(), new ByteArrayInputStream(wr.getBody()));
}
- public void testRemoteAccessAddScript() throws Exception
+ public void testAddScript() throws Exception
{
script.getParent().remove();
session.save();
@@ -271,13 +370,91 @@
script = "public class Test { def a = 0\ndef b = 1\n }\n";
cres = launcher.service("POST", "/script/groovy/validate/", "", headers, script.getBytes(), null);
assertEquals(200, cres.getStatus());
+ }
+ public void testValidateNoExtClassPath() throws Exception
+ {
+ MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
+ headers.putSingle("Content-Type", "script/groovy");
+ String script = "import test.validate.User000\n" + //
+ "@javax.ws.rs.Path('test/validate') class Test {\n" + //
+ "def user = new User000(name:'test')\n" + //
+ "@javax.ws.rs.GET def m() {user}" + //
+ " }\n";
+ ContainerResponse cres =
+ launcher.service("POST", "/script/groovy/validate/Test", "", headers, script.getBytes(), null);
+ assertEquals(400, cres.getStatus());
+ System.out.println(cres.getEntity());
}
+ public void testValidateExtClassPath_File() throws Exception
+ {
+ MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
+ headers.putSingle("Content-Type", "script/groovy");
+ String script = "import test.validate.User001\n" + //
+ "@javax.ws.rs.Path('test/validate') class Test {\n" + //
+ "def user = new User001(name:'test')\n" + //
+ "@javax.ws.rs.GET def m() {user}" + //
+ " }\n";
+ String user = createScript(testRoot, "test.validate", "User001.groovy",//
+ "package test.validate\n" + //
+ "class User001 {def name}");
+ // Specify source file location.
+ String path =
+ "/script/groovy/validate/Test?file=" //
+ + URLEncoder.encode(new UnifiedNodeReference(repository.getName(), workspace.getName(), user).getURL()
+ .toString(), "UTF-8");
+ ContainerResponse cres = launcher.service("POST", path, "", headers, script.getBytes(), null);
+ assertEquals(200, cres.getStatus());
+ }
+
+ public void testValidateExtClassPath_SourceFolder() throws Exception
+ {
+ MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
+ headers.putSingle("Content-Type", "script/groovy");
+ String script = "import test.validate.User002\n" + //
+ "@javax.ws.rs.Path('test/validate') class Test {\n" + //
+ "def user = new User002(name:'test')\n" + //
+ "@javax.ws.rs.GET def m() {user}" + //
+ " }\n";
+ createScript(testRoot, "test.validate", "User002.groovy",//
+ "package test.validate\n" + //
+ "class User002 {def name}");
+ // Specify source folder location.
+ String path =
+ "/script/groovy/validate/Test?sources=" //
+ + URLEncoder.encode(new UnifiedNodeReference(repository.getName(), workspace.getName(), testRoot.getPath())
+ .getURL().toString(), "UTF-8");
+ ContainerResponse cres = launcher.service("POST", path, "", headers, script.getBytes(), null);
+ assertEquals(200, cres.getStatus());
+ }
+
+ public void testValidateExtClassPath_CustomExtension() throws Exception
+ {
+ MultivaluedMap<String, String> headers = new MultivaluedMapImpl();
+ headers.putSingle("Content-Type", "script/groovy");
+ String script = "import test.validate.User003\n" + //
+ "@javax.ws.rs.Path('test/validate') class Test {\n" + //
+ "def user = new User003(name:'test')\n" + //
+ "@javax.ws.rs.GET def m() {user}" + //
+ " }\n";
+ createScript(testRoot, "test.validate", "User003.otherGroovy",//
+ "package test.validate\n" + //
+ "class User003 {def name}");
+ // Specify source folder location and customized extension '.otherGroovy'.
+ String path =
+ "/script/groovy/validate/Test?sources=" //
+ + URLEncoder.encode(new UnifiedNodeReference(repository.getName(), workspace.getName(), testRoot.getPath())
+ .getURL().toString(), "UTF-8") + //
+ "&extension=.otherGroovy";
+ ContainerResponse cres = launcher.service("POST", path, "", headers, script.getBytes(), null);
+ assertEquals(200, cres.getStatus());
+ }
+
public void testGroovyDependency() throws Exception
{
// Add script in dependency repository
- createScript(groovyRepo, "dependencies", "Dep1", //
+ createScript(groovyRepo, "dependencies", "Dep1.groovy", //
"package dependencies\n" + //
"class Dep1 { String name = getClass().getName() }");
@@ -292,7 +469,6 @@
ContainerResponse cres = launcher.service("GET", "/groovy-test-dependency", "", null, null, null);
assertEquals(200, cres.getStatus());
assertEquals("dependencies.Dep1", cres.getEntity());
-
}
private byte[] getResourceAsBytes(String resource) throws IOException
@@ -305,9 +481,7 @@
byte[] buf = new byte[1024];
int r = -1;
while ((r = stream.read(buf)) != -1)
- {
bout.write(buf, 0, r);
- }
data = bout.toByteArray();
}
return data;
13 years, 5 months
exo-jcr SVN: r3719 - ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2010-12-23 10:04:43 -0500 (Thu, 23 Dec 2010)
New Revision: 3719
Added:
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/ClassPath.java
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/MalformedScriptException.java
Modified:
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/DefaultGroovyResourceLoader.java
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyClassLoaderProvider.java
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java
Log:
EXOJCR-1105
Added: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/ClassPath.java
===================================================================
--- ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/ClassPath.java (rev 0)
+++ ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/ClassPath.java 2010-12-23 15:04:43 UTC (rev 3719)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.rest.ext.groovy;
+
+/**
+ * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public class ClassPath
+{
+ private ClassPathEntry[] entries;
+
+ private String[] extensions;
+
+ public ClassPath(ClassPathEntry[] entries, String[] extensions)
+ {
+ this.entries = entries;
+ this.extensions = extensions;
+ }
+
+ public ClassPathEntry[] getEntries()
+ {
+ return entries;
+ }
+
+ public String[] getExtensions()
+ {
+ return extensions;
+ }
+}
Property changes on: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/ClassPath.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/DefaultGroovyResourceLoader.java
===================================================================
--- ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/DefaultGroovyResourceLoader.java 2010-12-23 15:00:03 UTC (rev 3718)
+++ ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/DefaultGroovyResourceLoader.java 2010-12-23 15:04:43 UTC (rev 3719)
@@ -41,20 +41,25 @@
{
private static final String[] DEFAULT_SCRIPT_EXTENSIONS = new String[]{".groovy"};
- protected URL[] roots;
+ protected final String[] extensions;
- protected URL[] files;
+ protected final URL[] roots;
+ protected final URL[] files;
+
// TODO need configurable ?
private int maxEntries = 512;
protected final Map<String, URL> resources;
@SuppressWarnings("serial")
- public DefaultGroovyResourceLoader(URL[] roots, URL[] files) throws MalformedURLException
+ public DefaultGroovyResourceLoader(URL[] roots, URL[] files, String[] extensions) throws MalformedURLException
{
this.files = files;
this.roots = new URL[roots.length];
+ if (extensions == null || extensions.length == 0)
+ extensions = DEFAULT_SCRIPT_EXTENSIONS;
+ this.extensions = extensions;
for (int i = 0; i < roots.length; i++)
{
String str = roots[i].toString();
@@ -63,8 +68,7 @@
else
this.roots[i] = roots[i];
}
- resources = Collections.synchronizedMap(new LinkedHashMap<String, URL>()
- {
+ resources = Collections.synchronizedMap(new LinkedHashMap<String, URL>() {
protected boolean removeEldestEntry(Entry<String, URL> eldest)
{
return size() > maxEntries;
@@ -72,6 +76,11 @@
});
}
+ public DefaultGroovyResourceLoader(URL[] roots, URL[] files) throws MalformedURLException
+ {
+ this(roots, files, null);
+ }
+
public DefaultGroovyResourceLoader(URL[] roots) throws MalformedURLException
{
this(roots, new URL[0]);
@@ -95,9 +104,8 @@
final String ext = extensions[i];
try
{
- resource = AccessController.doPrivileged(new PrivilegedExceptionAction<URL>()
- {
- public URL run() throws Exception
+ resource = AccessController.doPrivileged(new PrivilegedExceptionAction<URL>() {
+ public URL run() throws MalformedURLException
{
return getResource(baseName + ext);
}
@@ -106,10 +114,7 @@
catch (PrivilegedActionException e)
{
Throwable cause = e.getCause();
- if (cause instanceof Error)
- throw (Error)cause;
- if (cause instanceof RuntimeException)
- throw (RuntimeException)cause;
+ // MalformedURLException
throw (MalformedURLException)cause;
}
}
@@ -162,6 +167,6 @@
protected String[] getScriptExtensions()
{
- return DEFAULT_SCRIPT_EXTENSIONS;
+ return extensions;
}
}
Modified: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyClassLoaderProvider.java
===================================================================
--- ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyClassLoaderProvider.java 2010-12-23 15:00:03 UTC (rev 3718)
+++ ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyClassLoaderProvider.java 2010-12-23 15:04:43 UTC (rev 3719)
@@ -35,7 +35,8 @@
* Groovy source files.
*
* @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
- * @version $Id$
+ * @version $Id: GroovyClassLoaderProvider.java 3701 2010-12-22 10:15:37Z
+ * aparfonov $
*/
public class GroovyClassLoaderProvider
{
@@ -55,8 +56,7 @@
public GroovyClassLoaderProvider()
{
- defaultClassLoader = AccessController.doPrivileged(new PrivilegedAction<GroovyClassLoader>()
- {
+ defaultClassLoader = AccessController.doPrivileged(new PrivilegedAction<GroovyClassLoader>() {
public GroovyClassLoader run()
{
return new GroovyClassLoader(getClass().getClassLoader());
@@ -83,32 +83,35 @@
* @throws MalformedURLException if any of entries in <code>classPath</code>
* has invalid URL.
*/
- public GroovyClassLoader getGroovyClassLoader(ClassPathEntry[] classPath) throws MalformedURLException
+ public GroovyClassLoader getGroovyClassLoader(ClassPath classPath) throws MalformedURLException
{
List<URL> files = new ArrayList<URL>();
List<URL> roots = new ArrayList<URL>();
- for (int i = 0; i < classPath.length; i++)
+ ClassPathEntry[] classPathEntries = classPath.getEntries();
+ if (classPathEntries != null && classPathEntries.length > 0)
{
- ClassPathEntry classPathEntry = classPath[i];
- if (EntryType.SRC_DIR == classPathEntry.getType())
+ for (int i = 0; i < classPathEntries.length; i++)
{
- roots.add(classPathEntry.getPath());
+ ClassPathEntry classPathEntry = classPathEntries[i];
+ if (EntryType.SRC_DIR == classPathEntry.getType())
+ {
+ roots.add(classPathEntry.getPath());
+ }
+ else
+ {
+ files.add(classPathEntry.getPath());
+ }
}
- else
- {
- files.add(classPathEntry.getPath());
- }
}
final GroovyClassLoader parent = getGroovyClassLoader();
- GroovyClassLoader classLoader = AccessController.doPrivileged(new PrivilegedAction<GroovyClassLoader>()
- {
+ GroovyClassLoader classLoader = AccessController.doPrivileged(new PrivilegedAction<GroovyClassLoader>() {
public GroovyClassLoader run()
{
return new GroovyClassLoader(parent);
}
});
classLoader.setResourceLoader(new DefaultGroovyResourceLoader(roots.toArray(new URL[roots.size()]), files
- .toArray(new URL[files.size()])));
+ .toArray(new URL[files.size()]), classPath.getExtensions()));
return classLoader;
}
Modified: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java
===================================================================
--- ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java 2010-12-23 15:00:03 UTC (rev 3718)
+++ ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java 2010-12-23 15:04:43 UTC (rev 3719)
@@ -22,7 +22,7 @@
import groovy.lang.GroovyClassLoader;
import groovy.lang.GroovyCodeSource;
-import org.exoplatform.commons.utils.SecurityHelper;
+import org.codehaus.groovy.control.CompilationFailedException;
import org.exoplatform.services.rest.ObjectFactory;
import org.exoplatform.services.rest.PerRequestObjectFactory;
import org.exoplatform.services.rest.impl.ResourceBinder;
@@ -36,7 +36,10 @@
import java.net.MalformedURLException;
import java.nio.charset.Charset;
import java.nio.charset.UnsupportedCharsetException;
+import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -162,6 +165,7 @@
* @throws NullPointerException if <code>resourceId == null</code>
* @throws ResourcePublicationException see
* {@link ResourceBinder#addResource(Class, MultivaluedMap)}
+ * @throws CompilationFailedException if compilation fails from source errors
*/
public void publishPerRequest(final InputStream in, final ResourceId resourceId,
MultivaluedMap<String, String> properties)
@@ -180,23 +184,24 @@
* @throws NullPointerException if <code>resourceId == null</code>
* @throws ResourcePublicationException see
* {@link ResourceBinder#addResource(Class, MultivaluedMap)}
+ * @throws CompilationFailedException if compilation fails from source errors
*/
public void publishPerRequest(final InputStream in, final ResourceId resourceId,
- final MultivaluedMap<String, String> properties, final ClassPathEntry[] classPath)
+ final MultivaluedMap<String, String> properties, final ClassPath classPath)
{
- Class<?> rc = SecurityHelper.doPrivilegedAction(new PrivilegedAction<Class<?>>() {
+ Class<?> rc = AccessController.doPrivileged(new PrivilegedAction<Class<?>>() {
public Class<?> run()
{
try
{
- GroovyClassLoader cl = (classPath == null || classPath.length == 0) //
- ? classLoaderProvider.getGroovyClassLoader() //
- : classLoaderProvider.getGroovyClassLoader(classPath);
+ GroovyClassLoader cl =
+ (classPath == null) ? classLoaderProvider.getGroovyClassLoader() : classLoaderProvider
+ .getGroovyClassLoader(classPath);
return cl.parseClass(createCodeSource(in, resourceId.getId()));
}
catch (MalformedURLException e)
{
- throw new ResourcePublicationException(e.getMessage());
+ throw new IllegalArgumentException(e.getMessage());
}
}
});
@@ -216,6 +221,7 @@
* @throws NullPointerException if <code>resourceId == null</code>
* @throws ResourcePublicationException see
* {@link ResourceBinder#addResource(Class, MultivaluedMap)}
+ * @throws CompilationFailedException if compilation fails from source errors
*/
public final void publishPerRequest(String source, ResourceId resourceId, MultivaluedMap<String, String> properties)
{
@@ -234,9 +240,10 @@
* @throws NullPointerException if <code>resourceId == null</code>
* @throws ResourcePublicationException see
* {@link ResourceBinder#addResource(Class, MultivaluedMap)}
+ * @throws CompilationFailedException if compilation fails from source errors
*/
public final void publishPerRequest(String source, ResourceId resourceId, MultivaluedMap<String, String> properties,
- ClassPathEntry[] classPath)
+ ClassPath classPath)
{
publishPerRequest(source, DEFAULT_CHARSET, resourceId, properties, classPath);
}
@@ -255,6 +262,7 @@
* @throws NullPointerException if <code>resourceId == null</code>
* @throws ResourcePublicationException see
* {@link ResourceBinder#addResource(Class, MultivaluedMap)}
+ * @throws CompilationFailedException if compilation fails from source errors
*/
public final void publishPerRequest(String source, String charset, ResourceId resourceId,
MultivaluedMap<String, String> properties)
@@ -278,9 +286,10 @@
* @throws NullPointerException if <code>resourceId == null</code>
* @throws ResourcePublicationException see
* {@link ResourceBinder#addResource(Class, MultivaluedMap)}
+ * @throws CompilationFailedException if compilation fails from source errors
*/
public final void publishPerRequest(String source, String charset, ResourceId resourceId,
- MultivaluedMap<String, String> properties, ClassPathEntry[] classPath)
+ MultivaluedMap<String, String> properties, ClassPath classPath)
{
publishPerRequest(source, charset == null ? DEFAULT_CHARSET : Charset.forName(charset), resourceId, properties,
classPath);
@@ -296,6 +305,7 @@
* @throws NullPointerException if <code>resourceId == null</code>
* @throws ResourcePublicationException see
* {@link ResourceBinder#addResource(Object, MultivaluedMap)}
+ * @throws CompilationFailedException if compilation fails from source errors
*/
public void publishSingleton(InputStream in, ResourceId resourceId, MultivaluedMap<String, String> properties)
{
@@ -313,22 +323,21 @@
* @throws NullPointerException if <code>resourceId == null</code>
* @throws ResourcePublicationException see
* {@link ResourceBinder#addResource(Object, MultivaluedMap)}
+ * @throws CompilationFailedException if compilation fails from source errors
*/
public void publishSingleton(InputStream in, ResourceId resourceId, MultivaluedMap<String, String> properties,
- ClassPathEntry[] classPath)
+ ClassPath classPath)
{
Object resource;
try
{
resource =
- instantiator.instantiateScript(createCodeSource(in, resourceId.getId()),
- (classPath == null || classPath.length == 0) //
- ? classLoaderProvider.getGroovyClassLoader() //
- : classLoaderProvider.getGroovyClassLoader(classPath));
+ instantiator.instantiateScript(createCodeSource(in, resourceId.getId()), (classPath == null)
+ ? classLoaderProvider.getGroovyClassLoader() : classLoaderProvider.getGroovyClassLoader(classPath));
}
catch (MalformedURLException e)
{
- throw new ResourcePublicationException(e.getMessage());
+ throw new IllegalArgumentException(e.getMessage());
}
binder.addResource(resource, properties);
resources.put(resourceId, resource.getClass().getAnnotation(Path.class).value());
@@ -345,6 +354,7 @@
* @throws NullPointerException if <code>resourceId == null</code>
* @throws ResourcePublicationException see
* {@link ResourceBinder#addResource(Object, MultivaluedMap)}
+ * @throws CompilationFailedException if compilation fails from source errors
*/
public final void publishSingleton(String source, ResourceId resourceId, MultivaluedMap<String, String> properties)
{
@@ -363,9 +373,10 @@
* @throws NullPointerException if <code>resourceId == null</code>
* @throws ResourcePublicationException see
* {@link ResourceBinder#addResource(Object, MultivaluedMap)}
+ * @throws CompilationFailedException if compilation fails from source errors
*/
public final void publishSingleton(String source, ResourceId resourceId, MultivaluedMap<String, String> properties,
- ClassPathEntry[] classPath)
+ ClassPath classPath)
{
publishSingleton(source, DEFAULT_CHARSET, resourceId, properties, classPath);
}
@@ -384,6 +395,7 @@
* @throws NullPointerException if <code>resourceId == null</code>
* @throws ResourcePublicationException see
* {@link ResourceBinder#addResource(Object, MultivaluedMap)}
+ * @throws CompilationFailedException if compilation fails from source errors
*/
public final void publishSingleton(String source, String charset, ResourceId resourceId,
MultivaluedMap<String, String> properties)
@@ -407,9 +419,10 @@
* @throws NullPointerException if <code>resourceId == null</code>
* @throws ResourcePublicationException see
* {@link ResourceBinder#addResource(Object, MultivaluedMap)}
+ * @throws CompilationFailedException if compilation fails from source errors
*/
public final void publishSingleton(String source, String charset, ResourceId resourceId,
- MultivaluedMap<String, String> properties, ClassPathEntry[] classPath)
+ MultivaluedMap<String, String> properties, ClassPath classPath)
{
publishSingleton(source, charset == null ? DEFAULT_CHARSET : Charset.forName(charset), resourceId, properties,
classPath);
@@ -438,20 +451,159 @@
return resource;
}
+ /**
+ * Validate does stream contain Groovy source code which is conforms with
+ * requirement to JAX-RS resource.
+ *
+ * @param in Groovy source stream
+ * @param name script name. This name will be used by GroovyClassLoader to
+ * identify script, e.g. specified name will be used in error
+ * message in compilation of Groovy fails. If this parameter is
+ * <code>null</code> then GroovyClassLoader will use automatically
+ * generated name
+ * @param classPath additional path to Groovy sources
+ * @throws MalformedScriptException if source has errors or there is no
+ * required JAX-RS annotation
+ */
+ public void validateResource(final InputStream in, final String name, final ClassPath classPath)
+ throws MalformedScriptException
+ {
+ Class<?> rc;
+ try
+ {
+ rc = AccessController.doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
+ public Class<?> run() throws MalformedURLException
+ {
+ GroovyClassLoader cl =
+ (classPath == null) ? classLoaderProvider.getGroovyClassLoader() : classLoaderProvider
+ .getGroovyClassLoader(classPath);
+ if (name == null || name.length() == 0)
+ return cl.parseClass(createCodeSource(in, cl.generateScriptName()));
+ return cl.parseClass(createCodeSource(in, name));
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ Throwable cause = e.getCause();
+ // MalformedURLException
+ throw new IllegalArgumentException(cause.getMessage());
+ }
+ catch (CompilationFailedException e)
+ {
+ throw new MalformedScriptException(e.getMessage());
+ }
+ /// XXX : Temporary disable resource class validation. Just try to compile
+ // class and assume resource class is OK if compilation is successful.
+ /*try
+ {
+ new AbstractResourceDescriptorImpl(rc).accept(ResourceDescriptorValidator.getInstance());
+ }
+ catch (RuntimeException e)
+ {
+ // FIXME : Need have proper exception for invalid resources in 'exo.ws.rest.core'.
+ throw new MalformedScriptException(e.getMessage());
+ }*/
+ }
+
+ /**
+ * Validate does stream contain Groovy source code which is conforms with
+ * requirement to JAX-RS resource.
+ *
+ * @param in Groovy source stream
+ * @param name script name. This name will be used by GroovyClassLoader to
+ * identify script, e.g. specified name will be used in error
+ * message in compilation of Groovy fails. If this parameter is
+ * <code>null</code> then GroovyClassLoader will use automatically
+ * generated name
+ * @throws MalformedScriptException if source has errors or there is no
+ * required JAX-RS annotation
+ */
+ public void validateResource(InputStream in, String name) throws MalformedScriptException
+ {
+ validateResource(in, name, null);
+ }
+
+ /**
+ * Validate does <code>source</code> contain Groovy source code which is
+ * conforms with requirement to JAX-RS resource.
+ *
+ * @param source Groovy source code as String
+ * @param charset source string charset. May be <code>null</code> than
+ * default charset will be in use
+ * @param name script name. This name will be used by GroovyClassLoader to
+ * identify script, e.g. specified name will be used in error
+ * message in compilation of Groovy fails. If this parameter is
+ * <code>null</code> then GroovyClassLoader will use automatically
+ * generated name
+ * @param classPath additional path to Groovy sources
+ * @throws MalformedScriptException if source has errors or there is no
+ * required JAX-RS annotation
+ */
+ public final void validateResource(String source, String charset, String name, ClassPath classPath)
+ throws MalformedScriptException
+ {
+ validateResource(source, charset == null ? DEFAULT_CHARSET : Charset.forName(charset), name, classPath);
+ }
+
+ /**
+ * Validate does <code>source</code> contain Groovy source code which is
+ * conforms with requirement to JAX-RS resource.
+ *
+ * @param source Groovy source code as String
+ * @param name script name. This name will be used by GroovyClassLoader to
+ * identify script, e.g. specified name will be used in error
+ * message in compilation of Groovy fails. If this parameter is
+ * <code>null</code> then GroovyClassLoader will use automatically
+ * generated name
+ * @param classPath additional path to Groovy sources
+ * @throws MalformedScriptException if source has errors or there is no
+ * required JAX-RS annotation
+ */
+ public final void validateResource(String source, String name, ClassPath classPath) throws MalformedScriptException
+ {
+ validateResource(source, DEFAULT_CHARSET, name, classPath);
+ }
+
+ /**
+ * Validate does <code>source</code> contain Groovy source code which is
+ * conforms with requirement to JAX-RS resource.
+ *
+ * @param source Groovy source code as String
+ * @param name script name. This name will be used by GroovyClassLoader to
+ * identify script, e.g. specified name will be used in error
+ * message in compilation of Groovy fails. If this parameter is
+ * <code>null</code> then GroovyClassLoader will use automatically
+ * generated name
+ * @throws MalformedScriptException if source has errors or there is no
+ * required JAX-RS annotation
+ */
+ public final void validateResource(String source, String name) throws MalformedScriptException
+ {
+ validateResource(source, DEFAULT_CHARSET, name, null);
+ }
+
private void publishPerRequest(String source, Charset charset, ResourceId resourceId,
- MultivaluedMap<String, String> properties, ClassPathEntry[] classPath)
+ MultivaluedMap<String, String> properties, ClassPath classPath)
{
byte[] bytes = source.getBytes(charset);
- publishPerRequest(new ByteArrayInputStream(bytes), resourceId, properties);
+ publishPerRequest(new ByteArrayInputStream(bytes), resourceId, properties, classPath);
}
private void publishSingleton(String source, Charset charset, ResourceId resourceId,
- MultivaluedMap<String, String> properties, ClassPathEntry[] classPath)
+ MultivaluedMap<String, String> properties, ClassPath classPath)
{
byte[] bytes = source.getBytes(charset);
publishSingleton(new ByteArrayInputStream(bytes), resourceId, properties, classPath);
}
+ private void validateResource(String source, Charset charset, String name, ClassPath classPath)
+ throws MalformedScriptException
+ {
+ byte[] bytes = source.getBytes(charset);
+ validateResource(new ByteArrayInputStream(bytes), name, classPath);
+ }
+
/**
* Create {@link GroovyCodeSource} from given stream and name. Code base
* 'file:/groovy/script/jaxrs' will be used.
@@ -462,7 +614,7 @@
*/
protected GroovyCodeSource createCodeSource(final InputStream in, final String name)
{
- GroovyCodeSource gcs = SecurityHelper.doPrivilegedAction(new PrivilegedAction<GroovyCodeSource>() {
+ GroovyCodeSource gcs = AccessController.doPrivileged(new PrivilegedAction<GroovyCodeSource>() {
public GroovyCodeSource run()
{
return new GroovyCodeSource(in, name, "/groovy/script/jaxrs");
Added: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/MalformedScriptException.java
===================================================================
--- ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/MalformedScriptException.java (rev 0)
+++ ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/MalformedScriptException.java 2010-12-23 15:04:43 UTC (rev 3719)
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.rest.ext.groovy;
+
+/**
+ * Thrown if Groovy script is not comply with requirement to JAX-RS resources.
+ *
+ * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+@SuppressWarnings("serial")
+public class MalformedScriptException extends Exception
+{
+ /**
+ * @param message detail message about wrong with Groovy script.
+ */
+ public MalformedScriptException(String message)
+ {
+ super(message);
+ }
+}
Property changes on: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/MalformedScriptException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
13 years, 5 months
exo-jcr SVN: r3718 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2010-12-23 10:00:03 -0500 (Thu, 23 Dec 2010)
New Revision: 3718
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java
Log:
EXOJCR-1119: added check if parent node is new to avoid extra db querying
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java 2010-12-23 14:58:14 UTC (rev 3717)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java 2010-12-23 15:00:03 UTC (rev 3718)
@@ -260,6 +260,12 @@
ItemState state = changesLog.getItemState(parent, name, itemType);
if (state == null)
{
+ // 2. Check if the parent node is a new node
+ if (isNew(parent.getIdentifier()))
+ {
+ // The parent node is a new node so we know that the data doesn't exist in the database
+ return null;
+ }
// 2. Try from txdatamanager
if (!(skipCheckInPersistence))
{
13 years, 5 months
exo-jcr SVN: r3717 - jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2010-12-23 09:58:14 -0500 (Thu, 23 Dec 2010)
New Revision: 3717
Modified:
jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java
Log:
JCR-1547: added check if a parent node is new, to avoid extra db querying
Modified: jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java
===================================================================
--- jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java 2010-12-23 14:52:06 UTC (rev 3716)
+++ jcr/branches/1.12.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java 2010-12-23 14:58:14 UTC (rev 3717)
@@ -242,6 +242,12 @@
ItemState state = changesLog.getItemState(parent, name, itemType);
if (state == null)
{
+ // 2. Check if the parent node is a new node
+ if (isNew(parent.getIdentifier()))
+ {
+ // The parent node is a new node so we know that the data doesn't exist in the database
+ return null;
+ }
// 2. Try from txdatamanager
data = transactionableManager.getItemData(parent, name, itemType);
}
13 years, 5 months
exo-jcr SVN: r3716 - in jcr/trunk/exo.jcr.component.ext/src: test/java/org/exoplatform/services/jcr/ext/backup/load and 1 other directory.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-12-23 09:52:06 -0500 (Thu, 23 Dec 2010)
New Revision: 3716
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/FullBackupJob.java
jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/load/TestLoadBackup.java
Log:
EXOJCR-1078: lock tables before backup doing
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/FullBackupJob.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/FullBackupJob.java 2010-12-23 10:25:41 UTC (rev 3715)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/FullBackupJob.java 2010-12-23 14:52:06 UTC (rev 3716)
@@ -49,6 +49,7 @@
import java.net.URL;
import java.security.PrivilegedExceptionAction;
import java.sql.Connection;
+import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
@@ -178,8 +179,6 @@
notifyListeners();
Connection jdbcConn = null;
- Statement st = null;
-
try
{
WorkspaceEntry workspaceEntry = null;
@@ -227,8 +226,6 @@
}
});
- int dialect = DialectDetecter.detect(jdbcConn.getMetaData()).hashCode();
-
RDBMSBackupInfoWriter backupInfoWriter = new RDBMSBackupInfoWriter(getStorageURL().getFile());
backupInfoWriter.setRepositoryName(repository.getConfiguration().getName());
@@ -263,13 +260,43 @@
backupInfoWriter.setValueTableName(scripts[1][0]);
backupInfoWriter.setRefTableName(scripts[2][0]);
- // Lock db
- if (dialect != DB_DIALECT_HSQLDB)
+ // Lock tables
+ ResultSet rs = null;
+ Statement st = null;
+ try
{
+ DatabaseMetaData metaData = jdbcConn.getMetaData();
+
+ rs = metaData.getTables(null, null, "%", new String[]{"TABLE"});
st = jdbcConn.createStatement();
- st.execute("LOCK TABLES " + scripts[0][0] + " WRITE");
+ int dialect = DialectDetecter.detect(metaData).hashCode();
+
+ while (rs.next())
+ {
+ String tableName = rs.getString("TABLE_NAME");
+ if (dialect == DB_DIALECT_HSQLDB)
+ {
+ st.execute("SET TABLE " + tableName + " READONLY TRUE");
+ }
+ else
+ {
+ st.execute("LOCK TABLES " + tableName + " WRITE");
+ }
+ }
}
+ finally
+ {
+ if (rs != null)
+ {
+ rs.close();
+ }
+ if (st != null)
+ {
+ st.close();
+ }
+ }
+
for (String script[] : scripts)
{
dumpTable(jdbcConn, script[0], script[1]);
@@ -326,33 +353,46 @@
}
finally
{
- if (st != null)
+ if (jdbcConn != null)
{
+ // unlock tables
try
{
- st.execute("UNLOCK TABLES");
- }
- catch (SQLException e)
- {
- log.error("Full backup failed " + getStorageURL().getPath(), e);
- notifyError("Full backup failed", e);
- }
+ ResultSet rs = null;
+ Statement st = null;
+ try
+ {
+ DatabaseMetaData metaData = jdbcConn.getMetaData();
+ st = jdbcConn.createStatement();
+ int dialect = DialectDetecter.detect(metaData).hashCode();
- try
- {
- st.close();
- }
- catch (SQLException e)
- {
- log.error("Full backup failed " + getStorageURL().getPath(), e);
- notifyError("Full backup failed", e);
- }
- }
+ if (dialect == DB_DIALECT_HSQLDB)
+ {
+ rs = metaData.getTables(null, null, "%", new String[]{"TABLE"});
+ while (rs.next())
+ {
+ String tableName = rs.getString("TABLE_NAME");
+ st.execute("SET TABLE " + tableName + " READONLY FALSE");
+ }
+ }
+ else
+ {
+ st.execute("UNLOCK TABLES");
+ }
+ }
+ finally
+ {
+ if (rs != null)
+ {
+ rs.close();
+ }
- if (jdbcConn != null)
- {
- try
- {
+ if (st != null)
+ {
+ st.close();
+ }
+ }
+
jdbcConn.close();
}
catch (SQLException e)
Modified: jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/load/TestLoadBackup.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/load/TestLoadBackup.java 2010-12-23 10:25:41 UTC (rev 3715)
+++ jcr/trunk/exo.jcr.component.ext/src/test/java/org/exoplatform/services/jcr/ext/backup/load/TestLoadBackup.java 2010-12-23 14:52:06 UTC (rev 3716)
@@ -34,6 +34,8 @@
import java.io.File;
import java.io.FileInputStream;
+import java.sql.Connection;
+import java.sql.Statement;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -44,6 +46,8 @@
import javax.jcr.Value;
import javax.jcr.version.VersionException;
import javax.jcr.version.VersionHistory;
+import javax.naming.InitialContext;
+import javax.sql.DataSource;
/**
* Created by The eXo Platform SAS.
@@ -65,8 +69,6 @@
protected final int BACKUP_TYPE = BackupManager.FULL_BACKUP_ONLY;
- protected final boolean RESTORE_INTO_EXISTED = false;
-
protected ManageableRepository repository;
/**
@@ -99,7 +101,6 @@
}
catch (Exception e)
{
- e.printStackTrace();
}
}
}
@@ -126,7 +127,7 @@
sessions.add(writerSession);
}
- Thread.sleep(5 * 1000);
+ Thread.sleep(10 * 1000);
System.out.println(" ============ BACKUP START ============");
@@ -159,9 +160,19 @@
if (BACKUP_TYPE == BackupManager.FULL_AND_INCREMENTAL)
{
- Thread.sleep(30 * 1000);
+ Thread.sleep(5 * 1000);
}
+ for (Thread thread : threads)
+ {
+ thread.interrupt();
+ }
+
+ if (BACKUP_TYPE == BackupManager.FULL_AND_INCREMENTAL)
+ {
+ Thread.sleep(5 * 1000);
+ }
+
// stop backup
if (bch != null)
{
@@ -175,11 +186,6 @@
System.out.println(" ============ BACKUP FINISHED ============");
- // for (Thread thread : threads)
- // {
- // thread.interrupt();
- // }
-
// restore
WorkspaceEntry ws1back = makeWorkspaceEntry("ws1back", "jdbcjcr3");
@@ -217,7 +223,6 @@
{
Node n = root.addNode("testNode" + i);
n.addMixin("mix:referenceable");
- n.addMixin("mix:versionable");
n.setProperty("long", i);
n.setProperty("ref", n);
n.setProperty("string", new String[]{"test" + System.currentTimeMillis()});
@@ -225,8 +230,7 @@
session.save();
- n.checkin();
- n.checkout();
+ // System.out.println("Child has been added");
Thread.sleep(50);
@@ -301,7 +305,35 @@
}
}
}
+
+ public void _testTableLock() throws Exception
+ {
+ Session writerSession = repository.login(credentials, WORKSPACE_NAME);
+ // TreeWriterThread writer = new TreeWriterThread(writerSession, "subnode");
+ // writer.start();
+ DataSource ds = (DataSource)new InitialContext().lookup("jdbcjcr_to_repository_restore_singel_db");
+ Connection conn = ds.getConnection();
+
+ Thread.sleep(2 * 1000);
+
+ Statement st = conn.createStatement();
+ st.executeQuery("SET PROPERTY \"readonly\" TRUE");
+ System.out.println("LOCK TABLES JCR_SITEM WRITE");
+ Thread.sleep(5 * 1000);
+
+ // st.executeQuery("SET READONLY FALSE");
+ // System.out.println("UNLOCK TABLES");
+ // Thread.sleep(5 * 1000);
+
+ st.close();
+ conn.close();
+ System.out.println("Con closed");
+ Thread.sleep(5 * 1000);
+
+ addChilds(writerSession, writerSession.getRootNode(), 0);
+ }
+
/**
* {@inheritDoc}
*/
13 years, 5 months
exo-jcr SVN: r3715 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-12-23 05:25:41 -0500 (Thu, 23 Dec 2010)
New Revision: 3715
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/FullBackupJob.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java
Log:
EXOJCR-1078: small fixes
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/FullBackupJob.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/FullBackupJob.java 2010-12-22 15:39:29 UTC (rev 3714)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/FullBackupJob.java 2010-12-23 10:25:41 UTC (rev 3715)
@@ -53,6 +53,7 @@
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
+import java.sql.Statement;
import java.sql.Types;
import java.util.Calendar;
import java.util.List;
@@ -111,6 +112,26 @@
public static final int DB_DIALECT_HSQLDB = DBConstants.DB_DIALECT_HSQLDB.hashCode();
/**
+ * MySQL dialect.
+ */
+ public static final int DB_DIALECT_MYSQL = DBConstants.DB_DIALECT_MYSQL.hashCode();
+
+ /**
+ * MySQL-UTF8 dialect.
+ */
+ public static final int DB_DIALECT_MYSQL_UTF8 = DBConstants.DB_DIALECT_MYSQL_UTF8.hashCode();
+
+ /**
+ * DB2 dialect.
+ */
+ public static final int DB_DIALECT_DB2 = DBConstants.DB_DIALECT_DB2.hashCode();
+
+ /**
+ * DB2V8 dialect.
+ */
+ public static final int DB_DIALECT_DB2V8 = DBConstants.DB_DIALECT_DB2V8.hashCode();
+
+ /**
* {@inheritDoc}
*/
@Override
@@ -157,7 +178,8 @@
notifyListeners();
Connection jdbcConn = null;
- Integer transactionIsolation = null;
+ Statement st = null;
+
try
{
WorkspaceEntry workspaceEntry = null;
@@ -204,10 +226,9 @@
}
});
+
+ int dialect = DialectDetecter.detect(jdbcConn.getMetaData()).hashCode();
- transactionIsolation = jdbcConn.getTransactionIsolation();
- jdbcConn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
-
RDBMSBackupInfoWriter backupInfoWriter = new RDBMSBackupInfoWriter(getStorageURL().getFile());
backupInfoWriter.setRepositoryName(repository.getConfiguration().getName());
@@ -242,6 +263,13 @@
backupInfoWriter.setValueTableName(scripts[1][0]);
backupInfoWriter.setRefTableName(scripts[2][0]);
+ // Lock db
+ if (dialect != DB_DIALECT_HSQLDB)
+ {
+ st = jdbcConn.createStatement();
+ st.execute("LOCK TABLES " + scripts[0][0] + " WRITE");
+ }
+
for (String script[] : scripts)
{
dumpTable(jdbcConn, script[0], script[1]);
@@ -298,15 +326,33 @@
}
finally
{
+ if (st != null)
+ {
+ try
+ {
+ st.execute("UNLOCK TABLES");
+ }
+ catch (SQLException e)
+ {
+ log.error("Full backup failed " + getStorageURL().getPath(), e);
+ notifyError("Full backup failed", e);
+ }
+
+ try
+ {
+ st.close();
+ }
+ catch (SQLException e)
+ {
+ log.error("Full backup failed " + getStorageURL().getPath(), e);
+ notifyError("Full backup failed", e);
+ }
+ }
+
if (jdbcConn != null)
{
try
{
- if (transactionIsolation != null)
- {
- jdbcConn.setTransactionIsolation(transactionIsolation);
- }
-
jdbcConn.close();
}
catch (SQLException e)
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java 2010-12-22 15:39:29 UTC (rev 3714)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java 2010-12-23 10:25:41 UTC (rev 3715)
@@ -45,7 +45,6 @@
import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl;
import org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager;
import org.exoplatform.services.jcr.impl.dataflow.serialization.ObjectZipReaderImpl;
-import org.exoplatform.services.jcr.impl.storage.jdbc.DBConstants;
import org.exoplatform.services.jcr.impl.storage.jdbc.DialectDetecter;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
import org.exoplatform.services.jcr.impl.storage.value.fs.FileValueStorage;
@@ -168,8 +167,8 @@
protected void fullRdbmsRestore() throws RepositoryException
{
Connection jdbcConn = null;
- Integer transactionIsolation = null;
Statement st = null;
+
try
{
String dsName = workspaceEntry.getContainer().getParameterValue(JDBCWorkspaceDataContainer.SOURCE_NAME);
@@ -202,103 +201,23 @@
}
});
- transactionIsolation = jdbcConn.getTransactionIsolation();
- jdbcConn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
-
+ int dialect = DialectDetecter.detect(jdbcConn.getMetaData()).hashCode();
jdbcConn.setAutoCommit(false);
RDBMSBackupInfoReader backupInfo = new RDBMSBackupInfoReader(restorePath);
- // restore JCR data
- Integer[] tableTypes =
- new Integer[]{RestoreTableHelper.ITEM_TABLE, RestoreTableHelper.VALUE_TABLE, RestoreTableHelper.REF_TABLE};
-
- for (Integer tableType : tableTypes)
+ // Lock db
+ if (dialect != FullBackupJob.DB_DIALECT_HSQLDB)
{
- RestoreTableHelper helper = new RestoreTableHelper(tableType, isMultiDb, backupInfo);
+ RestoreTableHelper helper = new RestoreTableHelper(RestoreTableHelper.ITEM_TABLE, isMultiDb, backupInfo);
- if (tableType == RestoreTableHelper.ITEM_TABLE)
- {
- // resolve constraint name depends on database
- String constraintName;
- String dbDialect = DialectDetecter.detect(jdbcConn.getMetaData());
-
- if (dbDialect.equals(DBConstants.DB_DIALECT_DB2) || dbDialect.equals(DBConstants.DB_DIALECT_DB2V8))
- {
- constraintName = "JCR_FK_" + (Boolean.parseBoolean(multiDb) ? "M" : "S") + "ITEM_PAREN";
- }
- else
- {
- constraintName = "JCR_FK_" + (Boolean.parseBoolean(multiDb) ? "M" : "S") + "ITEM_PARENT";
- }
- String constraint =
- "CONSTRAINT " + constraintName + " FOREIGN KEY(PARENT_ID) REFERENCES " + helper.getTableName()
- + "(ID)";
-
- // drop constraint
- st = jdbcConn.createStatement();
- st.execute("ALTER TABLE " + helper.getTableName() + " DROP CONSTRAINT " + constraintName);
- jdbcConn.commit();
-
- restoreTable(jdbcConn, helper);
-
- // add constraint
- st = jdbcConn.createStatement();
- st.execute("ALTER TABLE " + helper.getTableName() + " ADD " + constraint);
- jdbcConn.commit();
- }
- else
- {
- if (PrivilegedFileHelper.exists(helper.getContentFile()))
- {
- restoreTable(jdbcConn, helper);
- }
- else
- {
- throw new IOException("File " + PrivilegedFileHelper.getCanonicalPath(helper.getContentFile())
- + " not found");
- }
- }
+ st = jdbcConn.createStatement();
+ st.execute("LOCK TABLES " + helper.getTableName() + " WRITE");
}
- // restore Lock data
- LockManagerEntry lockEntry = workspaceEntry.getLockManager();
- if (lockEntry != null)
- {
- List<String> existedLockTablesNames = AbstractCacheableLockManager.getLockTableNames(lockEntry);
- if (existedLockTablesNames.size() != backupInfo.getLockTableNames().size())
- {
- throw new RepositoryException("The amount of existed lock tables differs from backup");
- }
+ restoreJCRTables(jdbcConn, dialect, isMultiDb, backupInfo);
+ restoreLockTables(jdbcConn, isMultiDb, backupInfo);
- for (int i = 0; i < backupInfo.getLockTableNames().size(); i++)
- {
- RestoreTableHelper helper = new RestoreTableHelper(RestoreTableHelper.LOCK_TABLE, isMultiDb, backupInfo);
-
- helper.setContentFile(new File(restorePath, backupInfo.getLockTableNames().get(i)
- + FullBackupJob.CONTENT_FILE_SUFFIX));
- helper.setContentLenFile(new File(restorePath, backupInfo.getLockTableNames().get(i)
- + FullBackupJob.CONTENT_LEN_FILE_SUFFIX));
- helper.setTableName(existedLockTablesNames.get(i));
-
- if (PrivilegedFileHelper.exists(helper.contentFile))
- {
- restoreTable(jdbcConn, helper);
- }
- else
- {
- throw new IOException("File " + PrivilegedFileHelper.getCanonicalPath(helper.contentFile)
- + " not found");
- }
- }
- }
- else if (backupInfo.getLockTableNames().size() != 0)
- {
- throw new RepositoryException("There are no lock tables for new workspace configuration [" + workspaceName
- + "] but backup lock data exist");
- }
-
- // restore value storage and index
restoreValueStorage();
restoreIndex();
}
@@ -335,6 +254,15 @@
{
try
{
+ st.execute("UNLOCK TABLES");
+ }
+ catch (SQLException e)
+ {
+ throw new RepositoryException(e);
+ }
+
+ try
+ {
st.close();
}
catch (SQLException e)
@@ -347,11 +275,6 @@
{
try
{
- if (transactionIsolation != null)
- {
- jdbcConn.setTransactionIsolation(transactionIsolation);
- }
-
jdbcConn.close();
}
catch (SQLException e)
@@ -363,6 +286,114 @@
}
/**
+ * Restore JCR tables.
+ */
+ protected void restoreJCRTables(Connection jdbcConn, int dialect, boolean isMultiDb, RDBMSBackupInfoReader backupInfo)
+ throws IOException, SQLException
+ {
+ Statement st = null;
+ try
+ {
+ Integer[] tableTypes =
+ new Integer[]{RestoreTableHelper.ITEM_TABLE, RestoreTableHelper.VALUE_TABLE, RestoreTableHelper.REF_TABLE};
+
+ for (Integer tableType : tableTypes)
+ {
+ RestoreTableHelper helper = new RestoreTableHelper(tableType, isMultiDb, backupInfo);
+
+ if (!PrivilegedFileHelper.exists(helper.getContentFile()))
+ {
+ throw new IOException("File " + PrivilegedFileHelper.getCanonicalPath(helper.getContentFile())
+ + " not found");
+ }
+
+ if (tableType == RestoreTableHelper.ITEM_TABLE && dialect != FullBackupJob.DB_DIALECT_MYSQL
+ && dialect != FullBackupJob.DB_DIALECT_MYSQL_UTF8)
+ {
+ // resolve constraint name depends on database
+ String constraintName;
+ if (dialect == FullBackupJob.DB_DIALECT_DB2 || dialect == FullBackupJob.DB_DIALECT_DB2V8)
+ {
+ constraintName = "JCR_FK_" + (isMultiDb ? "M" : "S") + "ITEM_PAREN";
+ }
+ else
+ {
+ constraintName = "JCR_FK_" + (isMultiDb ? "M" : "S") + "ITEM_PARENT";
+ }
+ String constraint =
+ "CONSTRAINT " + constraintName + " FOREIGN KEY(PARENT_ID) REFERENCES " + helper.getTableName()
+ + "(ID)";
+
+ // drop constraint
+ st = jdbcConn.createStatement();
+ st.execute("ALTER TABLE " + helper.getTableName() + " DROP CONSTRAINT " + constraintName);
+ jdbcConn.commit();
+
+ restoreTable(jdbcConn, helper);
+
+ // add constraint
+ st = jdbcConn.createStatement();
+ st.execute("ALTER TABLE " + helper.getTableName() + " ADD " + constraint);
+ jdbcConn.commit();
+ }
+ else
+ {
+ restoreTable(jdbcConn, helper);
+ }
+ }
+ }
+ finally
+ {
+ if (st != null)
+ {
+ st.close();
+ }
+ }
+ }
+
+ /**
+ * Restore JCR Lock tables.
+ */
+ protected void restoreLockTables(Connection jdbcConn, boolean isMultiDb, RDBMSBackupInfoReader backupInfo)
+ throws IOException, SQLException, RepositoryException
+ {
+ LockManagerEntry lockEntry = workspaceEntry.getLockManager();
+ if (lockEntry != null)
+ {
+ List<String> existedLockTablesNames = AbstractCacheableLockManager.getLockTableNames(lockEntry);
+ if (existedLockTablesNames.size() != backupInfo.getLockTableNames().size())
+ {
+ throw new RepositoryException("The amount of existed lock tables differs from backup");
+ }
+
+ for (int i = 0; i < backupInfo.getLockTableNames().size(); i++)
+ {
+ RestoreTableHelper helper = new RestoreTableHelper(RestoreTableHelper.LOCK_TABLE, isMultiDb, backupInfo);
+
+ helper.setContentFile(new File(restorePath, backupInfo.getLockTableNames().get(i)
+ + FullBackupJob.CONTENT_FILE_SUFFIX));
+ helper.setContentLenFile(new File(restorePath, backupInfo.getLockTableNames().get(i)
+ + FullBackupJob.CONTENT_LEN_FILE_SUFFIX));
+ helper.setTableName(existedLockTablesNames.get(i));
+
+ if (PrivilegedFileHelper.exists(helper.contentFile))
+ {
+ restoreTable(jdbcConn, helper);
+ }
+ else
+ {
+ throw new IOException("File " + PrivilegedFileHelper.getCanonicalPath(helper.contentFile) + " not found");
+ }
+ }
+ }
+ else if (backupInfo.getLockTableNames().size() != 0)
+ {
+ throw new RepositoryException("There are no lock tables for new workspace configuration [" + workspaceName
+ + "] but backup lock data exist");
+ }
+ }
+
+ /**
* Restore index from backup.
*/
protected void restoreIndex() throws RepositoryConfigurationException, IOException
@@ -579,8 +610,6 @@
protected void restoreTable(Connection jdbcConn, RestoreTableHelper helper)
throws IOException, SQLException
{
- String insertNodeQuery = null;
-
ObjectZipReaderImpl contentReader = null;
ObjectZipReaderImpl contentLenReader = null;
@@ -597,7 +626,7 @@
contentLenReader = new ObjectZipReaderImpl(PrivilegedFileHelper.zipInputStream(helper.getContentLenFile()));
contentLenReader.getNextEntry();
- // get information about backup table
+ // get information about source table
int sourceColumnCount = contentReader.readInt();
List<Integer> columnType = new ArrayList<Integer>();
@@ -620,7 +649,6 @@
newColumnType.add(tableMetaData.getInt("DATA_TYPE"));
}
- // construct query
int targetColumnCount = sourceColumnCount;
if (helper.getDeleteColumnIndex() != null)
{
@@ -632,23 +660,21 @@
columnType.add(helper.getNewColumnIndex(), newColumnType.get((helper.getNewColumnIndex())));
}
+ // construct statement
+ String names = "";
+ String parameters = "";
for (int i = 0; i < targetColumnCount; i++)
{
- if (i == 0)
+ if (helper.getSkipColumnIndex() != null && helper.getSkipColumnIndex() == i)
{
- insertNodeQuery = "INSERT INTO " + helper.getTableName() + " VALUES(?";
+ continue;
}
- else
- {
- insertNodeQuery += ",?";
- }
-
- if (i == targetColumnCount - 1)
- {
- insertNodeQuery += ")";
- }
+ names += newColumnName.get(i) + (i == targetColumnCount - 1 ? "" : ",");
+ parameters += "?" + (i == targetColumnCount - 1 ? "" : ",");
}
- insertNode = jdbcConn.prepareStatement(insertNodeQuery);
+ insertNode =
+ jdbcConn.prepareStatement("INSERT INTO " + helper.getTableName() + " (" + names + ") VALUES(" + parameters
+ + ")");
// set data
outer : while (true)
@@ -691,6 +717,7 @@
if (helper.getSkipColumnIndex() != null && helper.getSkipColumnIndex() == i)
{
+ targetIndex--;
continue;
}
else if (helper.getDeleteColumnIndex() != null && helper.getDeleteColumnIndex() == i)
@@ -966,6 +993,7 @@
if (isMultiDb)
{
tableName = "JCR_MITEM";
+
if (!backupInfo.isMultiDb())
{
// CONTAINER_NAME column index
@@ -979,6 +1007,7 @@
else
{
tableName = "JCR_SITEM";
+
if (backupInfo.isMultiDb())
{
// CONTAINER_NAME column index
13 years, 5 months
exo-jcr SVN: r3713 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config and 23 other directories.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2010-12-22 08:06:08 -0500 (Wed, 22 Dec 2010)
New Revision: 3713
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/RepositoryServiceConfiguration.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ErrorLog.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractIndex.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ConsistencyCheck.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/FileBasedNamespaceMappings.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexInfos.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingQueue.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingQueueStore.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrIndexSearcher.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrStandartAnalyzer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PersistentIndex.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/RedoLog.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/Util.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/directory/FSDirectoryManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBMultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/DBCleanHelper.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/DBCleanerService.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/WorkspaceDBCleaner.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/jbosscache/ExoJBossCacheFactory.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/GenericTransactionService.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/BackupChainLog.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupScheduler.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/FullBackupJob.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryService.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryEntry.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScriptAddRepoPlugin.java
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/FtpServerImpl.java
jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/data/FtpDataTransiverImpl.java
Log:
EXOJCR-1117: code refactoring - misspelling corrected
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/RepositoryServiceConfiguration.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/RepositoryServiceConfiguration.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/RepositoryServiceConfiguration.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -93,7 +93,7 @@
IBindingFactory factory;
try
{
- factory = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<IBindingFactory>()
+ factory = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<IBindingFactory>()
{
public IBindingFactory run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/JDBCConfigurationPersister.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -204,7 +204,7 @@
protected Connection openConnection() throws NamingException, SQLException
{
final DataSource ds = (DataSource)new InitialContext().lookup(sourceName);
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
{
public Connection run() throws Exception
{
@@ -222,7 +222,7 @@
{
try
{
- ResultSet trs = SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ ResultSet trs = SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/config/RepositoryServiceConfigurationImpl.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -184,7 +184,7 @@
IBindingFactory bfact;
try
{
- bfact = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<IBindingFactory>()
+ bfact = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<IBindingFactory>()
{
public IBindingFactory run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/FileSystemLockPersister.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -130,7 +130,7 @@
try
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Void>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Void>()
{
public Void run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/ControllerCacheLoader.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -234,7 +234,7 @@
*/
public void put(final List<Modification> modifications) throws Exception
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Void>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Void>()
{
public Void run() throws Exception
{
@@ -249,7 +249,7 @@
*/
public void put(final Fqn name, final Map<Object, Object> attributes) throws Exception
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Void>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Void>()
{
public Void run() throws Exception
{
@@ -264,7 +264,7 @@
*/
public Object put(final Fqn name, final Object key, final Object value) throws Exception
{
- return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -278,7 +278,7 @@
*/
public void remove(final Fqn fqn) throws Exception
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Void>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Void>()
{
public Void run() throws Exception
{
@@ -293,7 +293,7 @@
*/
public Object remove(final Fqn fqn, final Object key) throws Exception
{
- return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -307,7 +307,7 @@
*/
public void removeData(final Fqn fqn) throws Exception
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Void>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Void>()
{
public Void run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -747,7 +747,7 @@
// check if default node type saved
if (!nodeTypeRepository.isStorageFilled())
{
- final InputStream xml = SecurityHelper.doPriviledgedAction(new PrivilegedAction<InputStream>()
+ final InputStream xml = SecurityHelper.doPrivilegedAction(new PrivilegedAction<InputStream>()
{
public InputStream run()
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ErrorLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ErrorLog.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/ErrorLog.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -101,7 +101,7 @@
*/
private void openFile(final File log) throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -137,7 +137,7 @@
public void append(final String action, final String uuid) throws IOException
{
initOut();
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -155,7 +155,7 @@
*/
public void flush() throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -176,7 +176,7 @@
*/
public void clear() throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -203,7 +203,7 @@
*/
private void initOut() throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -225,7 +225,7 @@
*/
public List<String> readList() throws IOException
{
- return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<List<String>>()
+ return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<List<String>>()
{
public List<String> run() throws Exception
{
@@ -317,7 +317,7 @@
*/
public void close()
{
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<Object>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Object>()
{
public Object run()
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractIndex.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/AbstractIndex.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -134,7 +134,7 @@
this.cache = cache;
this.indexingQueue = indexingQueue;
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -184,7 +184,7 @@
*/
void addDocuments(final Document[] docs) throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -256,7 +256,7 @@
*/
int removeDocument(final Term idTerm) throws IOException
{
- return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -274,7 +274,7 @@
*/
protected synchronized CommittableIndexReader getIndexReader() throws IOException
{
- return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<CommittableIndexReader>()
+ return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<CommittableIndexReader>()
{
public CommittableIndexReader run() throws Exception
{
@@ -309,7 +309,7 @@
*/
synchronized ReadOnlyIndexReader getReadOnlyIndexReader(final boolean initCache) throws IOException
{
- return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<ReadOnlyIndexReader>()
+ return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<ReadOnlyIndexReader>()
{
public ReadOnlyIndexReader run() throws Exception
{
@@ -390,7 +390,7 @@
*/
protected synchronized IndexWriter getIndexWriter() throws IOException
{
- return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<IndexWriter>()
+ return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<IndexWriter>()
{
public IndexWriter run() throws Exception
{
@@ -430,7 +430,7 @@
*/
protected synchronized void commit(final boolean optimize) throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -462,7 +462,7 @@
*/
synchronized void close()
{
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<Object>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Object>()
{
public Object run()
{
@@ -488,7 +488,7 @@
*/
protected void releaseWriterAndReaders()
{
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<Object>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Object>()
{
public Object run()
{
@@ -567,7 +567,7 @@
*/
protected synchronized void invalidateSharedReader() throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ConsistencyCheck.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ConsistencyCheck.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/ConsistencyCheck.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -121,7 +121,7 @@
{
if (error.repairable())
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -195,7 +195,7 @@
continue;
}
final int currentIndex = i;
- Document d = SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Document>()
+ Document d = SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Document>()
{
public Document run() throws Exception
{
@@ -219,7 +219,7 @@
}
finally
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -251,7 +251,7 @@
continue;
}
final int currentIndex = i;
- Document d = SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Document>()
+ Document d = SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Document>()
{
public Document run() throws Exception
{
@@ -281,7 +281,7 @@
}
finally
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/FileBasedNamespaceMappings.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/FileBasedNamespaceMappings.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/FileBasedNamespaceMappings.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -149,7 +149,7 @@
*/
private void load() throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -192,7 +192,7 @@
*/
private void store() throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexInfos.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexInfos.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexInfos.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -114,7 +114,7 @@
*/
public void read() throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -156,7 +156,7 @@
*/
public void write() throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingQueue.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingQueue.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingQueue.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -79,7 +79,7 @@
*/
void initialize(final MultiIndex index) throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingQueueStore.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingQueueStore.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexingQueueStore.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -121,7 +121,7 @@
*/
public void close()
{
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<Object>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Object>()
{
public Object run()
{
@@ -154,7 +154,7 @@
*/
private void readStore() throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrIndexSearcher.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrIndexSearcher.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrIndexSearcher.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -93,7 +93,7 @@
*/
public QueryHits evaluate(final Query query, final Sort sort, final long resultFetchHint) throws IOException
{
- return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<QueryHits>()
+ return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<QueryHits>()
{
public QueryHits run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrStandartAnalyzer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrStandartAnalyzer.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/JcrStandartAnalyzer.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -40,7 +40,7 @@
* The default Jackrabbit analyzer if none is configured in <code><SearchIndex></code>
* configuration.
*/
- private Analyzer defaultAnalyzer = SecurityHelper.doPriviledgedAction(new PrivilegedAction<Analyzer>()
+ private Analyzer defaultAnalyzer = SecurityHelper.doPrivilegedAction(new PrivilegedAction<Analyzer>()
{
public Analyzer run()
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -314,7 +314,7 @@
}
finally
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -353,7 +353,7 @@
}
finally
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -440,7 +440,7 @@
*/
synchronized void update(final Collection remove, final Collection add) throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -636,7 +636,7 @@
final ReadOnlyIndexReader reader = (ReadOnlyIndexReader)entry.getKey();
try
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -768,7 +768,7 @@
{
// force initializing of caches
long time = System.currentTimeMillis();
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -872,7 +872,7 @@
*/
public synchronized CachingMultiIndexReader getIndexReader(final boolean initCache) throws IOException
{
- return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<CachingMultiIndexReader>()
+ return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<CachingMultiIndexReader>()
{
public CachingMultiIndexReader run() throws Exception
{
@@ -1160,7 +1160,7 @@
*/
void releaseMultiReader() throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -1209,7 +1209,7 @@
*/
private void scheduleFlushTask()
{
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<Object>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Object>()
{
public Object run()
{
@@ -1274,7 +1274,7 @@
*/
private Action executeAndLog(final Action a) throws IOException
{
- return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Action>()
+ return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Action>()
{
public Action run() throws Exception
{
@@ -1435,7 +1435,7 @@
*/
private void removeDeletable()
{
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<Object>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Object>()
{
public Object run()
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PersistentIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PersistentIndex.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PersistentIndex.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -64,7 +64,7 @@
this.name = name;
if (isExisting())
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -100,7 +100,7 @@
*/
void addIndexes(final IndexReader[] readers) throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -121,7 +121,7 @@
*/
void copyIndex(final AbstractIndex index) throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/RedoLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/RedoLog.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/RedoLog.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -147,7 +147,7 @@
*/
void append(final MultiIndex.Action action) throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -165,7 +165,7 @@
*/
void flush() throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -184,7 +184,7 @@
*/
void clear() throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -207,7 +207,7 @@
*/
private void initOut() throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -230,7 +230,7 @@
*/
private void read(final ActionCollector collector) throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -565,7 +565,7 @@
{
// read local namespace mappings
final File mapFile = new File(indexDirectory, NS_MAPPING_FILE);
- boolean fileExists = SecurityHelper.doPriviledgedAction(new PrivilegedAction<Boolean>()
+ boolean fileExists = SecurityHelper.doPrivilegedAction(new PrivilegedAction<Boolean>()
{
public Boolean run()
{
@@ -1417,7 +1417,7 @@
{
try
{
- spCheck = SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<SpellChecker>()
+ spCheck = SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<SpellChecker>()
{
public SpellChecker run() throws Exception
{
@@ -1449,7 +1449,7 @@
{
// File config = PrivilegedFileHelper.file(indexingConfigPath);
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<Object>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Object>()
{
public Object run()
{
@@ -1702,7 +1702,7 @@
return;
}
long time = System.currentTimeMillis();
- int found = SecurityHelper.doPriviledgedAction(new PrivilegedAction<Integer>()
+ int found = SecurityHelper.doPrivilegedAction(new PrivilegedAction<Integer>()
{
public Integer run()
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/Util.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/Util.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/Util.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -60,7 +60,7 @@
*/
public static void disposeDocument(final Document old)
{
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<Object>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Object>()
{
public Object run()
{
@@ -159,7 +159,7 @@
*/
public static void closeOrRelease(final IndexReader reader) throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/directory/FSDirectoryManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/directory/FSDirectoryManager.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/directory/FSDirectoryManager.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -46,7 +46,7 @@
*/
public void init(final SearchIndex handler) throws IOException
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -61,7 +61,7 @@
*/
public boolean hasDirectory(final String name) throws IOException
{
- return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Boolean>()
+ return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Boolean>()
{
public Boolean run() throws Exception
{
@@ -76,7 +76,7 @@
*/
public Directory getDirectory(final String name) throws IOException
{
- return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Directory>()
+ return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Directory>()
{
public Directory run() throws Exception
{
@@ -99,7 +99,7 @@
*/
public String[] getDirectoryNames() throws IOException
{
- return SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<String[]>()
+ return SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<String[]>()
{
public String[] run() throws Exception
{
@@ -132,7 +132,7 @@
*/
public boolean delete(final String name)
{
- return SecurityHelper.doPriviledgedAction(new PrivilegedAction<Boolean>()
+ return SecurityHelper.doPrivilegedAction(new PrivilegedAction<Boolean>()
{
public Boolean run()
{
@@ -169,7 +169,7 @@
*/
public boolean rename(final String from, final String to)
{
- return SecurityHelper.doPriviledgedAction(new PrivilegedAction<Boolean>()
+ return SecurityHelper.doPrivilegedAction(new PrivilegedAction<Boolean>()
{
public Boolean run()
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/spell/LuceneSpellChecker.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -254,7 +254,7 @@
this.handler = handler;
final String path = handler.getContext().getIndexDirectory() + File.separatorChar + "spellchecker";
spellIndexDirectory = null;
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -324,7 +324,7 @@
{
try
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -419,7 +419,7 @@
{
final int currentIndex = i;
String[] similar =
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<String[]>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<String[]>()
{
public String[] run() throws Exception
{
@@ -461,7 +461,7 @@
}
finally
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -498,7 +498,7 @@
try
{
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -1010,7 +1010,7 @@
{
try
{
- tx = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Transaction>()
+ tx = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Transaction>()
{
public Transaction run() throws Exception
{
@@ -1032,7 +1032,7 @@
try
{
final Transaction privilegedTx = tx;
- SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DialectDetecter.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -45,7 +45,7 @@
public static String detect(final DatabaseMetaData metaData) throws SQLException
{
final String databaseName =
- SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<String>()
+ SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<String>()
{
public String run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -331,7 +331,7 @@
Connection jdbcConn = null;
try
{
- jdbcConn = SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
+ jdbcConn = SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
{
public Connection run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/GenericConnectionFactory.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -229,7 +229,7 @@
try
{
final Connection conn =
- SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
+ SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
{
public Connection run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBMultiDbJDBCConnection.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -45,7 +45,7 @@
@Override
protected int addNodeRecord(final NodeData data) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -57,7 +57,7 @@
@Override
protected int addPropertyRecord(final PropertyData data) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -69,7 +69,7 @@
@Override
protected int addReference(final PropertyData data) throws SQLException, IOException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -82,7 +82,7 @@
protected int addValueData(final String cid, final int orderNumber, final InputStream stream,
final int streamLength, final String storageDesc) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -95,7 +95,7 @@
@Override
protected int deleteItemByIdentifier(final String identifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -107,7 +107,7 @@
@Override
protected int deleteReference(final String propertyIdentifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -120,7 +120,7 @@
@Override
protected int deleteValueData(final String cid) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -132,7 +132,7 @@
@Override
protected ResultSet findChildNodesByParentIdentifier(final String parentIdentifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -144,7 +144,7 @@
@Override
protected ResultSet findChildNodesCountByParentIdentifier(final String parentIdentifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -156,7 +156,7 @@
@Override
protected ResultSet findChildPropertiesByParentIdentifier(final String parentIdentifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -168,7 +168,7 @@
@Override
protected ResultSet findItemByIdentifier(final String identifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -180,7 +180,7 @@
@Override
protected ResultSet findItemByName(final String parentId, final String name, final int index) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -192,7 +192,7 @@
@Override
protected ResultSet findPropertyByName(final String parentId, final String name) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -204,7 +204,7 @@
@Override
protected ResultSet findReferences(final String nodeIdentifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -216,7 +216,7 @@
@Override
protected ResultSet findValueByPropertyIdOrderNumber(final String cid, final int orderNumb) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -228,7 +228,7 @@
@Override
protected ResultSet findValuesByPropertyId(final String cid) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -240,7 +240,7 @@
@Override
protected ResultSet findValuesStorageDescriptorsByPropertyId(final String cid) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -253,7 +253,7 @@
@Override
protected int renameNode(final NodeData data) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -267,7 +267,7 @@
protected int updateNodeByIdentifier(final int version, final int index, final int orderNumb, final String identifier)
throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -280,7 +280,7 @@
protected int updatePropertyByIdentifier(final int version, final int type, final String identifier)
throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/HSQLDBSingleDbJDBCConnection.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -116,7 +116,7 @@
return findItemByName.executeQuery();
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -141,7 +141,7 @@
return findPropertyByName.executeQuery();
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -165,7 +165,7 @@
return findNodesByParentId.executeQuery();
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -189,7 +189,7 @@
return findNodesCountByParentId.executeQuery();
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -213,7 +213,7 @@
return findPropertiesByParentId.executeQuery();
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -229,7 +229,7 @@
return HSQLDBSingleDbJDBCConnection.super.addNodeRecord(data);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -245,7 +245,7 @@
return HSQLDBSingleDbJDBCConnection.super.addPropertyRecord(prop);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -261,7 +261,7 @@
return HSQLDBSingleDbJDBCConnection.super.findItemByIdentifier(identifier);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -277,7 +277,7 @@
return HSQLDBSingleDbJDBCConnection.super.addReference(data);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -293,7 +293,7 @@
return HSQLDBSingleDbJDBCConnection.super.renameNode(data);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -309,7 +309,7 @@
return HSQLDBSingleDbJDBCConnection.super.deleteReference(propertyIdentifier);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -325,7 +325,7 @@
return HSQLDBSingleDbJDBCConnection.super.findReferences(nodeIdentifier);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -341,7 +341,7 @@
return HSQLDBSingleDbJDBCConnection.super.deleteItemByIdentifier(identifier);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -358,7 +358,7 @@
return HSQLDBSingleDbJDBCConnection.super.updateNodeByIdentifier(version, index, orderNumb, identifier);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -375,7 +375,7 @@
return HSQLDBSingleDbJDBCConnection.super.updatePropertyByIdentifier(version, type, identifier);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
// -------- values processing ------------
@@ -393,7 +393,7 @@
return HSQLDBSingleDbJDBCConnection.super.addValueData(cid, orderNumber, stream, streamLength, storageId);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -409,7 +409,7 @@
return HSQLDBSingleDbJDBCConnection.super.deleteValueData(cid);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -425,7 +425,7 @@
return HSQLDBSingleDbJDBCConnection.super.findValuesByPropertyId(cid);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -441,7 +441,7 @@
return HSQLDBSingleDbJDBCConnection.super.findValuesStorageDescriptorsByPropertyId(cid);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -457,6 +457,6 @@
return HSQLDBSingleDbJDBCConnection.super.findValueByPropertyIdOrderNumber(cid, orderNumb);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBMultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBMultiDbJDBCConnection.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBMultiDbJDBCConnection.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -48,7 +48,7 @@
@Override
protected int addNodeRecord(final NodeData data) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -60,7 +60,7 @@
@Override
protected int addPropertyRecord(final PropertyData data) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -72,7 +72,7 @@
@Override
protected int addReference(final PropertyData data) throws SQLException, IOException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -85,7 +85,7 @@
protected int addValueData(final String cid, final int orderNumber, final InputStream stream,
final int streamLength, final String storageDesc) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -97,7 +97,7 @@
@Override
protected int deleteItemByIdentifier(final String identifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -109,7 +109,7 @@
@Override
protected int deleteReference(final String propertyIdentifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -121,7 +121,7 @@
@Override
protected int deleteValueData(final String cid) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -133,7 +133,7 @@
@Override
protected ResultSet findChildNodesByParentIdentifier(final String parentIdentifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -145,7 +145,7 @@
@Override
protected ResultSet findChildNodesByParentIdentifierCQ(final String parentIdentifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -157,7 +157,7 @@
@Override
protected ResultSet findChildNodesCountByParentIdentifier(final String parentIdentifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -169,7 +169,7 @@
@Override
protected ResultSet findChildPropertiesByParentIdentifier(final String parentIdentifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -181,7 +181,7 @@
@Override
protected ResultSet findChildPropertiesByParentIdentifierCQ(final String parentIdentifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -193,7 +193,7 @@
@Override
protected ResultSet findItemByIdentifier(final String identifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -205,7 +205,7 @@
@Override
protected ResultSet findItemByName(final String parentId, final String name, final int index) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -217,7 +217,7 @@
@Override
protected ResultSet findItemQPathByIdentifierCQ(final String identifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -229,7 +229,7 @@
@Override
protected ResultSet findNodeMainPropertiesByParentIdentifierCQ(final String parentIdentifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -241,7 +241,7 @@
@Override
protected ResultSet findPropertyByName(final String parentId, final String name) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -253,7 +253,7 @@
@Override
protected ResultSet findReferences(final String nodeIdentifier) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -265,7 +265,7 @@
@Override
protected ResultSet findValueByPropertyIdOrderNumber(final String cid, final int orderNumb) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -277,7 +277,7 @@
@Override
protected ResultSet findValuesByPropertyId(final String cid) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -289,7 +289,7 @@
@Override
protected ResultSet findValuesStorageDescriptorsByPropertyId(final String cid) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -301,7 +301,7 @@
@Override
protected int renameNode(final NodeData data) throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -314,7 +314,7 @@
protected int updateNodeByIdentifier(final int version, final int index, final int orderNumb, final String identifier)
throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
@@ -327,7 +327,7 @@
protected int updatePropertyByIdentifier(final int version, final int type, final String identifier)
throws SQLException
{
- return SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
+ return SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Integer>()
{
public Integer run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/HSQLDBSingleDbJDBCConnection.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -139,7 +139,7 @@
return findItemByName.executeQuery();
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -164,7 +164,7 @@
return findPropertyByName.executeQuery();
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -188,7 +188,7 @@
return findNodesByParentId.executeQuery();
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -212,7 +212,7 @@
return findNodesCountByParentId.executeQuery();
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -236,7 +236,7 @@
return findPropertiesByParentId.executeQuery();
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -261,7 +261,7 @@
return findNodesByParentIdCQ.executeQuery();
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -285,7 +285,7 @@
return findPropertiesByParentIdCQ.executeQuery();
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -301,7 +301,7 @@
return HSQLDBSingleDbJDBCConnection.super.addNodeRecord(data);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -317,7 +317,7 @@
return HSQLDBSingleDbJDBCConnection.super.addPropertyRecord(prop);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -333,7 +333,7 @@
return HSQLDBSingleDbJDBCConnection.super.findItemByIdentifier(identifier);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -349,7 +349,7 @@
return HSQLDBSingleDbJDBCConnection.super.addReference(data);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -365,7 +365,7 @@
return HSQLDBSingleDbJDBCConnection.super.renameNode(data);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -381,7 +381,7 @@
return HSQLDBSingleDbJDBCConnection.super.deleteReference(propertyIdentifier);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -397,7 +397,7 @@
return HSQLDBSingleDbJDBCConnection.super.findReferences(nodeIdentifier);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -413,7 +413,7 @@
return HSQLDBSingleDbJDBCConnection.super.deleteItemByIdentifier(identifier);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -430,7 +430,7 @@
return HSQLDBSingleDbJDBCConnection.super.updateNodeByIdentifier(version, index, orderNumb, identifier);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -447,7 +447,7 @@
return HSQLDBSingleDbJDBCConnection.super.updatePropertyByIdentifier(version, type, identifier);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
// -------- values processing ------------
@@ -465,7 +465,7 @@
return HSQLDBSingleDbJDBCConnection.super.addValueData(cid, orderNumber, stream, streamLength, storageId);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -481,7 +481,7 @@
return HSQLDBSingleDbJDBCConnection.super.deleteValueData(cid);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -497,7 +497,7 @@
return HSQLDBSingleDbJDBCConnection.super.findValuesByPropertyId(cid);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -513,7 +513,7 @@
return HSQLDBSingleDbJDBCConnection.super.findValuesStorageDescriptorsByPropertyId(cid);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -529,7 +529,7 @@
return HSQLDBSingleDbJDBCConnection.super.findValueByPropertyIdOrderNumber(cid, orderNumb);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -545,7 +545,7 @@
return HSQLDBSingleDbJDBCConnection.super.findItemQPathByIdentifierCQ(identifier);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
/**
@@ -561,6 +561,6 @@
return HSQLDBSingleDbJDBCConnection.super.findNodeMainPropertiesByParentIdentifierCQ(parentIdentifier);
}
};
- return SecurityHelper.doPriviledgedSQLExceptionAction(action);
+ return SecurityHelper.doPrivilegedSQLExceptionAction(action);
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializer.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -174,7 +174,7 @@
protected boolean isTableExists(final Connection conn, final String tableName) throws SQLException
{
- ResultSet trs = SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
+ ResultSet trs = SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<ResultSet>()
{
public ResultSet run() throws Exception
{
@@ -416,7 +416,7 @@
}
final Statement finalSt = st;
final String finalSql = sql;
- SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/DBCleanHelper.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/DBCleanHelper.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/DBCleanHelper.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -111,7 +111,7 @@
selectItems.setString(2, parentID);
final PreparedStatement selectStatement = selectItems;
- result = (ResultSet)SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Object>()
+ result = (ResultSet)SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
@@ -134,7 +134,7 @@
removeItems.setString(2, parentID);
final PreparedStatement deleteStatement = removeItems;
- SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/DBCleanerService.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/DBCleanerService.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/DBCleanerService.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -146,7 +146,7 @@
try
{
final DataSource fds = ds;
- conn = SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
+ conn = SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
{
public Connection run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/WorkspaceDBCleaner.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/WorkspaceDBCleaner.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/cleaner/WorkspaceDBCleaner.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -206,7 +206,7 @@
*/
protected void executeQuery(final Statement statement, final String sql) throws SQLException
{
- SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Object>()
+ SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/infinispan/ISPNCacheFactory.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -114,7 +114,7 @@
{
// creating new CacheManager using SecurityHelper
- manager = SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<EmbeddedCacheManager>()
+ manager = SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<EmbeddedCacheManager>()
{
public EmbeddedCacheManager run() throws IOException
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/jbosscache/ExoJBossCacheFactory.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/jbosscache/ExoJBossCacheFactory.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/jbosscache/ExoJBossCacheFactory.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -76,7 +76,7 @@
* same multiplexer stack
*/
private static final JChannelFactory CHANNEL_FACTORY =
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<JChannelFactory>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<JChannelFactory>()
{
public JChannelFactory run()
{
@@ -157,7 +157,7 @@
}
// create cache
- final CacheFactory<K, V> factory = SecurityHelper.doPriviledgedAction(new PrivilegedAction<CacheFactory<K, V>>()
+ final CacheFactory<K, V> factory = SecurityHelper.doPrivilegedAction(new PrivilegedAction<CacheFactory<K, V>>()
{
public CacheFactory<K, V> run()
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/GenericTransactionService.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/GenericTransactionService.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/GenericTransactionService.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -239,7 +239,7 @@
TransactionManager tm;
try
{
- tm = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<TransactionManager>()
+ tm = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<TransactionManager>()
{
public TransactionManager run() throws Exception
{
@@ -460,7 +460,7 @@
{
try
{
- return SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Transaction>()
+ return SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Transaction>()
{
public Transaction run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/BackupChainLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/BackupChainLog.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/BackupChainLog.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -830,7 +830,7 @@
try
{
- writer = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<XMLStreamWriter>()
+ writer = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<XMLStreamWriter>()
{
public XMLStreamWriter run() throws Exception
{
@@ -906,7 +906,7 @@
IBindingFactory bfact;
try
{
- bfact = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<IBindingFactory>()
+ bfact = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<IBindingFactory>()
{
public IBindingFactory run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/RepositoryBackupChainLog.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -84,7 +84,7 @@
try
{
- writer = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<XMLStreamWriter>()
+ writer = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<XMLStreamWriter>()
{
public XMLStreamWriter run() throws Exception
{
@@ -240,7 +240,7 @@
IBindingFactory bfact;
try
{
- bfact = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<IBindingFactory>()
+ bfact = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<IBindingFactory>()
{
public IBindingFactory run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupManagerImpl.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -1160,7 +1160,7 @@
private void writeParamsToRegistryService(SessionProvider sessionProvider) throws IOException, SAXException,
ParserConfigurationException, RepositoryException
{
- Document doc = SecurityHelper.doPriviledgedParserConfigurationAction(new PrivilegedExceptionAction<Document>()
+ Document doc = SecurityHelper.doPrivilegedParserConfigurationAction(new PrivilegedExceptionAction<Document>()
{
public Document run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupScheduler.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupScheduler.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/BackupScheduler.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -248,7 +248,7 @@
try
{
- writer = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<XMLStreamWriter>()
+ writer = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<XMLStreamWriter>()
{
public XMLStreamWriter run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/FullBackupJob.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/FullBackupJob.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/FullBackupJob.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -196,7 +196,7 @@
throw new NameNotFoundException("Data source " + dsName + " not found");
}
- jdbcConn = SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
+ jdbcConn = SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
{
public Connection run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -193,7 +193,7 @@
throw new NameNotFoundException("Data source " + dsName + " not found");
}
- jdbcConn = SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
+ jdbcConn = SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
{
public Connection run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryService.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryService.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RESTRegistryService.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -194,7 +194,7 @@
{
Node registryNode = registryEntry.getNode();
NodeIterator registryIterator = registryNode.getNodes();
- Document entry = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Document>()
+ Document entry = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Document>()
{
public Document run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryEntry.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryEntry.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryEntry.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -73,7 +73,7 @@
public RegistryEntry(String rootName) throws IOException, SAXException, ParserConfigurationException
{
DocumentBuilder db =
- SecurityHelper.doPriviledgedParserConfigurationAction(new PrivilegedExceptionAction<DocumentBuilder>()
+ SecurityHelper.doPrivilegedParserConfigurationAction(new PrivilegedExceptionAction<DocumentBuilder>()
{
public DocumentBuilder run() throws Exception
{
@@ -98,7 +98,7 @@
{
try
{
- return SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<RegistryEntry>()
+ return SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<RegistryEntry>()
{
public RegistryEntry run() throws Exception
{
@@ -146,7 +146,7 @@
{
try
{
- return SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<RegistryEntry>()
+ return SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<RegistryEntry>()
{
public RegistryEntry run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/registry/RegistryService.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -344,7 +344,7 @@
wsName = repConfiguration.getDefaultWorkspaceName();
}
addRegistryLocation(repName, wsName);
- InputStream xml = SecurityHelper.doPriviledgedAction(new PrivilegedAction<InputStream>()
+ InputStream xml = SecurityHelper.doPrivilegedAction(new PrivilegedAction<InputStream>()
{
public InputStream run()
{
@@ -425,7 +425,7 @@
final String xml = appConfigurations.get(appName);
try
{
- SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Void>()
+ SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>()
{
public Void run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -650,7 +650,7 @@
LOG.debug(">>> Save init parametrs in registry service.");
}
- Document doc = SecurityHelper.doPriviledgedParserConfigurationAction(new PrivilegedExceptionAction<Document>() {
+ Document doc = SecurityHelper.doPrivilegedParserConfigurationAction(new PrivilegedExceptionAction<Document>() {
public Document run() throws Exception
{
return DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
@@ -817,7 +817,7 @@
try
{
final String fName = name;
- SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Void>() {
+ SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>() {
public Void run() throws Exception
{
groovyClassLoader.parseClass(script, fName);
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScriptAddRepoPlugin.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScriptAddRepoPlugin.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScriptAddRepoPlugin.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -69,7 +69,7 @@
final String path = p.getProperty("path");
try
{
- SecurityHelper.doPriviledgedMalformedURLExceptionAction(new PrivilegedExceptionAction<Void>()
+ SecurityHelper.doPrivilegedMalformedURLExceptionAction(new PrivilegedExceptionAction<Void>()
{
public Void run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/FtpServerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/FtpServerImpl.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/FtpServerImpl.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -76,7 +76,7 @@
this.configuration = configuration;
this.repositoryService = repositoryService;
- InputStream commandStream = SecurityHelper.doPriviledgedAction(new PrivilegedAction<InputStream>()
+ InputStream commandStream = SecurityHelper.doPrivilegedAction(new PrivilegedAction<InputStream>()
{
public InputStream run()
{
@@ -234,7 +234,7 @@
Socket incoming = null;
try
{
- incoming = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Socket>()
+ incoming = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Socket>()
{
public Socket run() throws Exception
{
Modified: jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/data/FtpDataTransiverImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/data/FtpDataTransiverImpl.java 2010-12-22 12:51:43 UTC (rev 3712)
+++ jcr/trunk/exo.jcr.component.ftp/src/main/java/org/exoplatform/services/ftp/data/FtpDataTransiverImpl.java 2010-12-22 13:06:08 UTC (rev 3713)
@@ -216,7 +216,7 @@
{
try
{
- dataSocket = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Socket>()
+ dataSocket = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Socket>()
{
public Socket run() throws Exception
{
13 years, 5 months
exo-jcr SVN: r3712 - in ws/trunk: exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/method and 3 other directories.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2010-12-22 07:51:43 -0500 (Wed, 22 Dec 2010)
New Revision: 3712
Modified:
ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java
ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java
ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/ResourceBinder.java
ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/method/DefaultMethodInvoker.java
ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/method/ParameterHelper.java
ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/DOMSourceEntityProvider.java
ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBContextResolver.java
ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBElementEntityProvider.java
ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBObjectEntityProvider.java
ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/MultipartFormDataEntityProvider.java
ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/SAXSourceEntityProvider.java
ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/resource/AbstractResourceDescriptorImpl.java
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java
Log:
EXOJCR-1117: code refactoring - misspelling corrected
Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java 2010-12-22 12:49:34 UTC (rev 3711)
+++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java 2010-12-22 12:51:43 UTC (rev 3712)
@@ -214,7 +214,7 @@
{
if (!Modifier.isPublic(jfield.getModifiers()))
{
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<Void>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
{
public Void run()
{
Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java 2010-12-22 12:49:34 UTC (rev 3711)
+++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java 2010-12-22 12:51:43 UTC (rev 3712)
@@ -361,7 +361,7 @@
}
// Register Shutdown Hook for cleaning temporary files.
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<Void>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
{
public Void run()
{
Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/ResourceBinder.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/ResourceBinder.java 2010-12-22 12:49:34 UTC (rev 3711)
+++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/ResourceBinder.java 2010-12-22 12:51:43 UTC (rev 3712)
@@ -206,7 +206,7 @@
// Initialize RuntimeDelegate instance
// This is first component in life cycle what needs.
// TODO better solution to initialize RuntimeDelegate
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<Void>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
{
public Void run()
{
Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/method/DefaultMethodInvoker.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/method/DefaultMethodInvoker.java 2010-12-22 12:49:34 UTC (rev 3711)
+++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/method/DefaultMethodInvoker.java 2010-12-22 12:51:43 UTC (rev 3712)
@@ -181,7 +181,7 @@
{
try
{
- return SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Object>()
+ return SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/method/ParameterHelper.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/method/ParameterHelper.java 2010-12-22 12:49:34 UTC (rev 3711)
+++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/method/ParameterHelper.java 2010-12-22 12:51:43 UTC (rev 3712)
@@ -264,7 +264,7 @@
{
try
{
- Method method = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Method>()
+ Method method = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Method>()
{
public Method run() throws Exception
{
Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/DOMSourceEntityProvider.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/DOMSourceEntityProvider.java 2010-12-22 12:49:34 UTC (rev 3711)
+++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/DOMSourceEntityProvider.java 2010-12-22 12:51:43 UTC (rev 3712)
@@ -82,7 +82,7 @@
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
- Document d = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Document>()
+ Document d = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Document>()
{
public Document run() throws Exception
{
Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBContextResolver.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBContextResolver.java 2010-12-22 12:49:34 UTC (rev 3711)
+++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBContextResolver.java 2010-12-22 12:51:43 UTC (rev 3712)
@@ -83,7 +83,7 @@
{
try
{
- jaxbctx = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<JAXBContext>()
+ jaxbctx = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<JAXBContext>()
{
public JAXBContext run() throws Exception
{
@@ -127,7 +127,7 @@
try
{
- jaxbctx = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<JAXBContext>()
+ jaxbctx = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<JAXBContext>()
{
public JAXBContext run() throws Exception
{
Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBElementEntityProvider.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBElementEntityProvider.java 2010-12-22 12:49:34 UTC (rev 3711)
+++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBElementEntityProvider.java 2010-12-22 12:51:43 UTC (rev 3712)
@@ -89,7 +89,7 @@
{
final JAXBContext jaxbctx = getJAXBContext(c, mediaType);
- return SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<JAXBElement<?>>()
+ return SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<JAXBElement<?>>()
{
public JAXBElement<?> run() throws Exception
{
Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBObjectEntityProvider.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBObjectEntityProvider.java 2010-12-22 12:49:34 UTC (rev 3711)
+++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/JAXBObjectEntityProvider.java 2010-12-22 12:51:43 UTC (rev 3712)
@@ -85,7 +85,7 @@
{
final JAXBContext jaxbctx = getJAXBContext(type, mediaType);
- return SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Object>()
+ return SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Object>()
{
public Object run() throws Exception
{
Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/MultipartFormDataEntityProvider.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/MultipartFormDataEntityProvider.java 2010-12-22 12:49:34 UTC (rev 3711)
+++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/MultipartFormDataEntityProvider.java 2010-12-22 12:51:43 UTC (rev 3712)
@@ -108,7 +108,7 @@
DefaultFileItemFactory factory = new DefaultFileItemFactory(bufferSize, repo);
final FileUpload upload = new FileUpload(factory);
- return SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Iterator<FileItem>>()
+ return SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Iterator<FileItem>>()
{
public Iterator<FileItem> run() throws Exception
{
Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/SAXSourceEntityProvider.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/SAXSourceEntityProvider.java 2010-12-22 12:49:34 UTC (rev 3711)
+++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/provider/SAXSourceEntityProvider.java 2010-12-22 12:51:43 UTC (rev 3712)
@@ -95,7 +95,7 @@
final StreamResult out = new StreamResult(entityStream);
try
{
- SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Void>()
+ SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>()
{
public Void run() throws Exception
{
Modified: ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/resource/AbstractResourceDescriptorImpl.java
===================================================================
--- ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/resource/AbstractResourceDescriptorImpl.java 2010-12-22 12:49:34 UTC (rev 3711)
+++ ws/trunk/exo.ws.rest.core/src/main/java/org/exoplatform/services/rest/impl/resource/AbstractResourceDescriptorImpl.java 2010-12-22 12:51:43 UTC (rev 3712)
@@ -224,7 +224,7 @@
// process field
java.lang.reflect.Field[] jfields =
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<java.lang.reflect.Field[]>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<java.lang.reflect.Field[]>()
{
public java.lang.reflect.Field[] run()
{
@@ -377,7 +377,7 @@
{
final Class<?> resourceClass = getObjectClass();
- Method[] methods = SecurityHelper.doPriviledgedAction(new PrivilegedAction<Method[]>()
+ Method[] methods = SecurityHelper.doPrivilegedAction(new PrivilegedAction<Method[]>()
{
public Method[] run()
{
Modified: ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java
===================================================================
--- ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java 2010-12-22 12:49:34 UTC (rev 3711)
+++ ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java 2010-12-22 12:51:43 UTC (rev 3712)
@@ -184,7 +184,7 @@
public void publishPerRequest(final InputStream in, final ResourceId resourceId,
final MultivaluedMap<String, String> properties, final ClassPathEntry[] classPath)
{
- Class<?> rc = SecurityHelper.doPriviledgedAction(new PrivilegedAction<Class<?>>() {
+ Class<?> rc = SecurityHelper.doPrivilegedAction(new PrivilegedAction<Class<?>>() {
public Class<?> run()
{
try
@@ -462,7 +462,7 @@
*/
protected GroovyCodeSource createCodeSource(final InputStream in, final String name)
{
- GroovyCodeSource gcs = SecurityHelper.doPriviledgedAction(new PrivilegedAction<GroovyCodeSource>() {
+ GroovyCodeSource gcs = SecurityHelper.doPrivilegedAction(new PrivilegedAction<GroovyCodeSource>() {
public GroovyCodeSource run()
{
return new GroovyCodeSource(in, name, "/groovy/script/jaxrs");
13 years, 5 months
exo-jcr SVN: r3711 - in core/trunk: exo.core.component.database/src/main/java/org/exoplatform/services/database/impl and 8 other directories.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2010-12-22 07:49:34 -0500 (Wed, 22 Dec 2010)
New Revision: 3711
Modified:
core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java
core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java
core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSExcelDocumentReader.java
core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSWordDocumentReader.java
core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSXExcelDocumentReader.java
core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSXPPTDocumentReader.java
core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSXWordDocumentReader.java
core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/OpenOfficeDocumentReader.java
core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/PDFDocumentReader.java
core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/POIPropertiesReader.java
core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/XMLDocumentReader.java
core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/tika/TikaDocumentReaderServiceImpl.java
core/trunk/exo.core.component.organization.api/src/main/java/org/exoplatform/services/organization/impl/UserProfileData.java
core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/SimpleHibernateUserListAccess.java
core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/UserDAOImpl.java
core/trunk/exo.core.component.script.groovy/src/main/java/org/exoplatform/services/script/groovy/GroovyScriptInstantiator.java
core/trunk/exo.core.component.script.groovy/src/main/java/org/exoplatform/services/script/groovy/jarjar/JarJarClassLoader.java
core/trunk/exo.core.component.xml-processing/src/main/java/org/exoplatform/services/xml/transform/impl/TransformerBase.java
core/trunk/exo.core.component.xml-processing/src/main/java/org/exoplatform/services/xml/transform/impl/trax/TRAXTransformerImpl.java
Log:
EXOJCR-1117: code refactoring - misspelling corrected
Modified: core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java
===================================================================
--- core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/creator/DBCreator.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -199,7 +199,7 @@
{
Class.forName(driver);
- conn = SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
+ conn = SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
{
public Connection run() throws Exception
{
@@ -220,7 +220,7 @@
try
{
final Connection connection = conn;
- dbProductName = SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<String>()
+ dbProductName = SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<String>()
{
public String run() throws Exception
{
@@ -279,7 +279,7 @@
{
Class.forName(driver);
- conn = SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
+ conn = SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<Connection>()
{
public Connection run() throws Exception
{
@@ -300,7 +300,7 @@
try
{
final Connection connection = conn;
- dbProductName = SecurityHelper.doPriviledgedSQLExceptionAction(new PrivilegedExceptionAction<String>()
+ dbProductName = SecurityHelper.doPrivilegedSQLExceptionAction(new PrivilegedExceptionAction<String>()
{
public String run() throws Exception
{
Modified: core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java
===================================================================
--- core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.database/src/main/java/org/exoplatform/services/database/impl/HibernateServiceImpl.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -83,7 +83,7 @@
threadLocal_ = new ThreadLocal<Session>();
PropertiesParam param = initParams.getPropertiesParam("hibernate.properties");
final HibernateSettingsFactory settingsFactory = new HibernateSettingsFactory(new ExoCacheProvider(cacheService));
- conf_ = SecurityHelper.doPriviledgedAction(new PrivilegedAction<HibernateConfigurationImpl>()
+ conf_ = SecurityHelper.doPrivilegedAction(new PrivilegedAction<HibernateConfigurationImpl>()
{
public HibernateConfigurationImpl run()
{
@@ -290,7 +290,7 @@
{
if (sessionFactory_ == null)
{
- sessionFactory_ = SecurityHelper.doPriviledgedAction(new PrivilegedAction<SessionFactory>()
+ sessionFactory_ = SecurityHelper.doPrivilegedAction(new PrivilegedAction<SessionFactory>()
{
public SessionFactory run()
{
Modified: core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSExcelDocumentReader.java
===================================================================
--- core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSExcelDocumentReader.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSExcelDocumentReader.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -123,7 +123,7 @@
break;
}
case HSSFCell.CELL_TYPE_FORMULA :
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<Void>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
{
public Void run()
{
@@ -133,7 +133,7 @@
});
break;
case HSSFCell.CELL_TYPE_BOOLEAN :
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<Void>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
{
public Void run()
{
@@ -143,7 +143,7 @@
});
break;
case HSSFCell.CELL_TYPE_ERROR :
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<Void>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
{
public Void run()
{
@@ -153,7 +153,7 @@
});
break;
case HSSFCell.CELL_TYPE_STRING :
- SecurityHelper.doPriviledgedAction(new PrivilegedAction<Void>()
+ SecurityHelper.doPrivilegedAction(new PrivilegedAction<Void>()
{
public Void run()
{
Modified: core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSWordDocumentReader.java
===================================================================
--- core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSWordDocumentReader.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSWordDocumentReader.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -71,7 +71,7 @@
HWPFDocument doc;
try
{
- doc = SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<HWPFDocument>()
+ doc = SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<HWPFDocument>()
{
public HWPFDocument run() throws Exception
{
Modified: core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSXExcelDocumentReader.java
===================================================================
--- core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSXExcelDocumentReader.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSXExcelDocumentReader.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -91,7 +91,7 @@
XSSFWorkbook wb;
try
{
- wb = SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<XSSFWorkbook>()
+ wb = SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<XSSFWorkbook>()
{
public XSSFWorkbook run() throws Exception
{
@@ -194,7 +194,7 @@
{
POIPropertiesReader reader = new POIPropertiesReader();
reader.readDCProperties(SecurityHelper
- .doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<XSSFWorkbook>()
+ .doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<XSSFWorkbook>()
{
public XSSFWorkbook run() throws Exception
{
Modified: core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSXPPTDocumentReader.java
===================================================================
--- core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSXPPTDocumentReader.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSXPPTDocumentReader.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -90,7 +90,7 @@
final XSLFPowerPointExtractor ppe;
try
{
- ppe = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<XSLFPowerPointExtractor>()
+ ppe = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<XSLFPowerPointExtractor>()
{
public XSLFPowerPointExtractor run() throws Exception
{
@@ -126,7 +126,7 @@
throw new RuntimeException(cause);
}
}
- return SecurityHelper.doPriviledgedAction(new PrivilegedAction<String>()
+ return SecurityHelper.doPrivilegedAction(new PrivilegedAction<String>()
{
public String run()
{
@@ -166,7 +166,7 @@
final POIPropertiesReader reader = new POIPropertiesReader();
try
{
- SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Void>()
+ SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>()
{
public Void run() throws Exception
{
Modified: core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSXWordDocumentReader.java
===================================================================
--- core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSXWordDocumentReader.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/MSXWordDocumentReader.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -81,7 +81,7 @@
XWPFDocument doc;
try
{
- doc = SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<XWPFDocument>()
+ doc = SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<XWPFDocument>()
{
public XWPFDocument run() throws Exception
{
@@ -99,7 +99,7 @@
}
final XWPFWordExtractor extractor = new XWPFWordExtractor(doc);
- text = SecurityHelper.doPriviledgedAction(new PrivilegedAction<String>()
+ text = SecurityHelper.doPrivilegedAction(new PrivilegedAction<String>()
{
public String run()
{
@@ -139,7 +139,7 @@
{
POIPropertiesReader reader = new POIPropertiesReader();
reader.readDCProperties(SecurityHelper
- .doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<XWPFDocument>()
+ .doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<XWPFDocument>()
{
public XWPFDocument run() throws Exception
{
Modified: core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/OpenOfficeDocumentReader.java
===================================================================
--- core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/OpenOfficeDocumentReader.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/OpenOfficeDocumentReader.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -80,7 +80,7 @@
SAXParser saxParser =
SecurityHelper
- .doPriviledgedParserConfigurationOrSAXExceptionAction(new PrivilegedExceptionAction<SAXParser>()
+ .doPrivilegedParserConfigurationOrSAXExceptionAction(new PrivilegedExceptionAction<SAXParser>()
{
public SAXParser run() throws Exception
{
@@ -174,7 +174,7 @@
saxParserFactory.setValidating(false);
SAXParser saxParser =
SecurityHelper
- .doPriviledgedParserConfigurationOrSAXExceptionAction(new PrivilegedExceptionAction<SAXParser>()
+ .doPrivilegedParserConfigurationOrSAXExceptionAction(new PrivilegedExceptionAction<SAXParser>()
{
public SAXParser run() throws Exception
{
Modified: core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/PDFDocumentReader.java
===================================================================
--- core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/PDFDocumentReader.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/PDFDocumentReader.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -218,7 +218,7 @@
try
{
final DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- doc = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Document>()
+ doc = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Document>()
{
public Document run() throws Exception
{
Modified: core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/POIPropertiesReader.java
===================================================================
--- core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/POIPropertiesReader.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/POIPropertiesReader.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -162,7 +162,7 @@
{
final POIFSReader poiFSReader = new POIFSReader();
poiFSReader.registerListener(readerListener, SummaryInformation.DEFAULT_STREAM_NAME);
- SecurityHelper.doPriviledgedIOExceptionAction(new PrivilegedExceptionAction<Void>()
+ SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Void>()
{
public Void run() throws Exception
{
Modified: core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/XMLDocumentReader.java
===================================================================
--- core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/XMLDocumentReader.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/XMLDocumentReader.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -133,7 +133,7 @@
{
saxParser =
SecurityHelper
- .doPriviledgedParserConfigurationOrSAXExceptionAction(new PrivilegedExceptionAction<SAXParser>()
+ .doPrivilegedParserConfigurationOrSAXExceptionAction(new PrivilegedExceptionAction<SAXParser>()
{
public SAXParser run() throws Exception
{
Modified: core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/tika/TikaDocumentReaderServiceImpl.java
===================================================================
--- core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/tika/TikaDocumentReaderServiceImpl.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.document/src/main/java/org/exoplatform/services/document/impl/tika/TikaDocumentReaderServiceImpl.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -55,7 +55,7 @@
if (params != null && params.getValueParam(TIKA_CONFIG_PATH) != null)
{
final InputStream is = configManager.getInputStream(params.getValueParam(TIKA_CONFIG_PATH).getValue());
- conf = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<TikaConfig>()
+ conf = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<TikaConfig>()
{
public TikaConfig run() throws Exception
{
Modified: core/trunk/exo.core.component.organization.api/src/main/java/org/exoplatform/services/organization/impl/UserProfileData.java
===================================================================
--- core/trunk/exo.core.component.organization.api/src/main/java/org/exoplatform/services/organization/impl/UserProfileData.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.organization.api/src/main/java/org/exoplatform/services/organization/impl/UserProfileData.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -82,7 +82,7 @@
public org.exoplatform.services.organization.UserProfile getUserProfile()
{
final XStream xstream = getXStream();
- UserProfileImpl up = SecurityHelper.doPriviledgedAction(new PrivilegedAction<UserProfileImpl>()
+ UserProfileImpl up = SecurityHelper.doPrivilegedAction(new PrivilegedAction<UserProfileImpl>()
{
public UserProfileImpl run()
{
@@ -102,7 +102,7 @@
final UserProfileImpl impl = (UserProfileImpl)up;
userName = up.getUserName();
final XStream xstream = getXStream();
- profile = SecurityHelper.doPriviledgedAction(new PrivilegedAction<String>()
+ profile = SecurityHelper.doPrivilegedAction(new PrivilegedAction<String>()
{
public String run()
{
@@ -115,7 +115,7 @@
{
if (xstream_ == null)
{
- xstream_ = SecurityHelper.doPriviledgedAction(new PrivilegedAction<XStream>()
+ xstream_ = SecurityHelper.doPrivilegedAction(new PrivilegedAction<XStream>()
{
public XStream run()
{
Modified: core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/SimpleHibernateUserListAccess.java
===================================================================
--- core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/SimpleHibernateUserListAccess.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/SimpleHibernateUserListAccess.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -97,7 +97,7 @@
@Override
protected int getSize(final Session session) throws Exception
{
- Query query = SecurityHelper.doPriviledgedAction(new PrivilegedAction<Query>()
+ Query query = SecurityHelper.doPrivilegedAction(new PrivilegedAction<Query>()
{
public Query run()
{
@@ -127,7 +127,7 @@
User[] users = new User[length];
- Query query = SecurityHelper.doPriviledgedAction(new PrivilegedAction<Query>()
+ Query query = SecurityHelper.doPrivilegedAction(new PrivilegedAction<Query>()
{
public Query run()
{
Modified: core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/UserDAOImpl.java
===================================================================
--- core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/UserDAOImpl.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/UserDAOImpl.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -88,7 +88,7 @@
preSave(user, true);
final Session session = service_.openSession();
- Transaction transaction = SecurityHelper.doPriviledgedAction(new PrivilegedAction<Transaction>()
+ Transaction transaction = SecurityHelper.doPrivilegedAction(new PrivilegedAction<Transaction>()
{
public Transaction run()
{
Modified: core/trunk/exo.core.component.script.groovy/src/main/java/org/exoplatform/services/script/groovy/GroovyScriptInstantiator.java
===================================================================
--- core/trunk/exo.core.component.script.groovy/src/main/java/org/exoplatform/services/script/groovy/GroovyScriptInstantiator.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.script.groovy/src/main/java/org/exoplatform/services/script/groovy/GroovyScriptInstantiator.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -132,7 +132,7 @@
GroovyClassLoader loader;
if (mapping.size() > 0)
{
- JarJarClassLoader jarjarLoader = SecurityHelper.doPriviledgedAction(new PrivilegedAction<JarJarClassLoader>()
+ JarJarClassLoader jarjarLoader = SecurityHelper.doPrivilegedAction(new PrivilegedAction<JarJarClassLoader>()
{
public JarJarClassLoader run()
{
@@ -145,7 +145,7 @@
}
else
{
- loader = SecurityHelper.doPriviledgedAction(new PrivilegedAction<GroovyClassLoader>()
+ loader = SecurityHelper.doPrivilegedAction(new PrivilegedAction<GroovyClassLoader>()
{
public GroovyClassLoader run()
{
@@ -180,7 +180,7 @@
try
{
final GroovyClassLoader fLoader = loader;
- clazz = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Class<?>>()
+ clazz = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Class<?>>()
{
public Class<?> run() throws Exception
{
@@ -243,7 +243,7 @@
}
final GroovyClassLoader fLoader = loader;
- Class<?> clazz = SecurityHelper.doPriviledgedAction(new PrivilegedAction<Class<?>>()
+ Class<?> clazz = SecurityHelper.doPrivilegedAction(new PrivilegedAction<Class<?>>()
{
public Class<?> run()
{
Modified: core/trunk/exo.core.component.script.groovy/src/main/java/org/exoplatform/services/script/groovy/jarjar/JarJarClassLoader.java
===================================================================
--- core/trunk/exo.core.component.script.groovy/src/main/java/org/exoplatform/services/script/groovy/jarjar/JarJarClassLoader.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.script.groovy/src/main/java/org/exoplatform/services/script/groovy/jarjar/JarJarClassLoader.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -98,7 +98,7 @@
final CodeSource codeSource)
{
//
- final CompilationUnit unit = SecurityHelper.doPriviledgedAction(new PrivilegedAction<CompilationUnit>()
+ final CompilationUnit unit = SecurityHelper.doPrivilegedAction(new PrivilegedAction<CompilationUnit>()
{
public CompilationUnit run()
{
@@ -148,7 +148,7 @@
static protected JarJarClassLoader createJarJarClassLoaderInPrivilegedMode(final ClassLoader classLoader)
{
- return SecurityHelper.doPriviledgedAction(new PrivilegedAction<JarJarClassLoader>()
+ return SecurityHelper.doPrivilegedAction(new PrivilegedAction<JarJarClassLoader>()
{
public JarJarClassLoader run()
{
Modified: core/trunk/exo.core.component.xml-processing/src/main/java/org/exoplatform/services/xml/transform/impl/TransformerBase.java
===================================================================
--- core/trunk/exo.core.component.xml-processing/src/main/java/org/exoplatform/services/xml/transform/impl/TransformerBase.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.xml-processing/src/main/java/org/exoplatform/services/xml/transform/impl/TransformerBase.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -73,7 +73,7 @@
*/
static public XMLReader getXMLReader() throws SAXException
{
- return SecurityHelper.doPriviledgedSAXExceptionAction(new PrivilegedExceptionAction<XMLReader>()
+ return SecurityHelper.doPrivilegedSAXExceptionAction(new PrivilegedExceptionAction<XMLReader>()
{
public XMLReader run() throws Exception
{
Modified: core/trunk/exo.core.component.xml-processing/src/main/java/org/exoplatform/services/xml/transform/impl/trax/TRAXTransformerImpl.java
===================================================================
--- core/trunk/exo.core.component.xml-processing/src/main/java/org/exoplatform/services/xml/transform/impl/trax/TRAXTransformerImpl.java 2010-12-22 12:47:06 UTC (rev 3710)
+++ core/trunk/exo.core.component.xml-processing/src/main/java/org/exoplatform/services/xml/transform/impl/trax/TRAXTransformerImpl.java 2010-12-22 12:49:34 UTC (rev 3711)
@@ -78,7 +78,7 @@
final SAXTransformerFactory saxTFactory = (SAXTransformerFactory)SAXTransformerFactory.newInstance();
try
{
- tHandler = SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<TransformerHandler>()
+ tHandler = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<TransformerHandler>()
{
public TransformerHandler run() throws Exception
{
@@ -160,7 +160,7 @@
{
final XMLReader fXMLReader = xmlReader;
final InputSource fInputSource = inputSource;
- SecurityHelper.doPriviledgedExceptionAction(new PrivilegedExceptionAction<Void>()
+ SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Void>()
{
public Void run() throws Exception
{
13 years, 5 months