//declare external variables
context.declareVariable(bindingPrefix + "type", EVENT_TYPE_PREPARE);
context.declareVariable(bindingPrefix + "event", new StringValue(eventToString(event)));
if (isCollection)
{context.declareVariable(bindingPrefix + "collection", new AnyURIValue(src));}
else
{context.declareVariable(bindingPrefix + "collection", new AnyURIValue(src.removeLastSegment()));}
context.declareVariable(bindingPrefix + "uri", new AnyURIValue(src));
if (dst == null)
{context.declareVariable(bindingPrefix + "new-uri", Sequence.EMPTY_SEQUENCE);}
else
{context.declareVariable(bindingPrefix + "new-uri", new AnyURIValue(dst));}
// For backward compatibility
context.declareVariable(bindingPrefix + "eventType", EVENT_TYPE_PREPARE);
context.declareVariable(bindingPrefix + "triggerEvent", new StringValue(eventToString(event)));
if (isCollection)
{context.declareVariable(bindingPrefix + "collectionName", new AnyURIValue(src));}
else {
context.declareVariable(bindingPrefix + "collectionName", new AnyURIValue(src.removeLastSegment()));
context.declareVariable(bindingPrefix + "documentName", new AnyURIValue(src));
}
//declare user defined parameters as external variables
for(final Iterator itUserVarName = userDefinedVariables.keySet().iterator(); itUserVarName.hasNext();)
{