Toby,
I'm trying to create a script that can replicate a node, so I need
access to these classes. I'm using the content.jsp code from the CRX
webapp, but I want the code to reside INSIDE my app, so that I can
package it up and send it to the servers I need, since I wont have
access to the command line or FS.
Here's my code:
String action_arg0 = currentNode.getPath(); try
{ com.day.crx.replication.ReplicationManager mgr =
(com.day.crx.replication.ReplicationManager)
((com.day.crx.core.CRXRepositoryImpl)
repSession
.getRepository
()).getModule
(com.day.crx.replication.ReplicationManager.class.getName()); if (mgr
== null) { %>Replication not configured<% } else
{ mgr.replicate( repSession, "Activate", action_arg0, null, false,
null ); %> <script type="text/javascript"> alert("Replication of Node <
%= org.apache.commons.lang.StringEscapeUtils.escapeJava(action_arg0)
%> added to syndicator queues."); </script> <% } } catch (Exception e)
{ %><%= e.toString() %><% }
-Josh
On Jan 5, 2009, at 11:58 AM, Tobias Bocanegra wrote:
hi josh,
only the packages exported by the bundles or the ones specified as
bootclasspath (via sling.properties config) are visible by other
bundles and jsps. in this case it's a bit difficult, since the
crx-explorer stuff is not available as bundle and i doubt that it will
work. why would you need to CRXContext in a non-crx webapp ?
regards, toby
On 1/5/09, Joshua Oransky <[email protected]> wrote:
Is there a reason I keep getting this error in my JSP sling
templates?
org.apache.sling.scripting.jsp.jasper.JasperException:
Unable to compile class for JSP: An error occurred at line: 1 in
the jsp
file: /apps/cms/admin/global/replicate.jsp
com.day.crx.j2ee.CRXContext cannot be resolved to a type null
I've tried importing specifically, and even fully qualifying the
class name
in my JSP code, to no avail.
-Josh