You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-commits@incubator.apache.org by mt...@apache.org on 2006/07/15 17:22:44 UTC
svn commit: r422273 [5/5] - in /incubator/xap/trunk:
WebContent/examples/dojo/ src/xap/ src/xap/bridges/basic/
src/xap/bridges/dojo/ src/xap/bridges/google/ src/xap/bridges/zimbra/
src/xap/components/zimbra/ src/xap/macro/ src/xap/mco/ src/xap/requests...
Modified: incubator/xap/trunk/src/xap/xml/xmodify/CommandDirective.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/xml/xmodify/CommandDirective.js?rev=422273&r1=422272&r2=422273&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/xml/xmodify/CommandDirective.js (original)
+++ incubator/xap/trunk/src/xap/xml/xmodify/CommandDirective.js Sat Jul 15 10:22:41 2006
@@ -54,11 +54,11 @@
// Constructors.
//----------------------------------------------------------------------
-CommandDirective = function(elemDirectiveElement)
+xap.xml.xmodify.CommandDirective = function(elemDirectiveElement)
{
- /* Call our superclass' UpdateDirective */
- UpdateDirective.call( this, elemDirectiveElement );
+ /* Call our superclass' xap.xml.xmodify.UpdateDirective */
+ xap.xml.xmodify.UpdateDirective.call( this, elemDirectiveElement );
this._selectAttr = elemDirectiveElement.getAttribute("select");
this._commandArguments = elemDirectiveElement.childNodes ;
@@ -69,7 +69,7 @@
if ((this._commandArguments.length == 0) &&
(this._strType == "set-attribute") ) /* We'll replace this with a mustHaveArgs() func */
{
- throw new XmodifyException(XmodifyException.COMMAND_EXPECTS_ONE_ARG,"set-attribute") ;
+ throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.COMMAND_EXPECTS_ONE_ARG,"set-attribute") ;
}
}
@@ -82,59 +82,59 @@
* the callback corresponding to the directive.
* @param uiDocumentNode The UI document, presumably including nodes that
* will be selected to be the object of the directive.
- * @throws XmodifyException
+ * @throws xap.xml.xmodify.XmodifyException
*/
-CommandDirective.prototype.execute = function (uiDocumentNode)
+xap.xml.xmodify.CommandDirective.prototype.execute = function (uiDocumentNode)
{
this._commandTargets
= this._selectMatchingNodes(uiDocumentNode,this._selectAttr ) ;
var directiveType
- = UpdateDirective.getDirectiveTypeAsInt(this._strType) ;
+ = xap.xml.xmodify.UpdateDirective.getDirectiveTypeAsInt(this._strType) ;
- this._bHtmlDocument = !(uiDocumentNode instanceof Document);
+ this._bHtmlDocument = !(uiDocumentNode instanceof xap.xml.dom.Document);
// handle "no targets" case---
- var needsTarget = CommandDirective._mustHaveTarget(directiveType) ;
+ var needsTarget = xap.xml.xmodify.CommandDirective._mustHaveTarget(directiveType) ;
if ( needsTarget && ( this._commandTargets.length == 0 ) ){
throw new
- XmodifyException(
- XmodifyException.ZERO_RESULTS,
+ xap.xml.xmodify.XmodifyException(
+ xap.xml.xmodify.XmodifyException.ZERO_RESULTS,
this._selectAttr
);
}
/* @TODO: Switch on type, use ints, not strs */
switch (directiveType) {
- case UpdateDirective.DIRECTIVE_APPEND:
+ case xap.xml.xmodify.UpdateDirective.DIRECTIVE_APPEND:
this._handleAppend(uiDocumentNode);
break;
- case UpdateDirective.DIRECTIVE_SET_ATTRIBUTE:
+ case xap.xml.xmodify.UpdateDirective.DIRECTIVE_SET_ATTRIBUTE:
this._handleSetAttribute(uiDocumentNode);
break;
- case UpdateDirective.DIRECTIVE_REMOVE_ELEMENT:
+ case xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_ELEMENT:
this._handleRemoveElement(uiDocumentNode);
break;
- case UpdateDirective.DIRECTIVE_REMOVE_ATTRIBUTE:
+ case xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_ATTRIBUTE:
this._handleRemoveAttribute(uiDocumentNode);
break;
- case UpdateDirective.DIRECTIVE_INSERT_BEFORE:
+ case xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_BEFORE:
this._handleInsertBefore(uiDocumentNode);
break;
- case UpdateDirective.DIRECTIVE_INSERT_AFTER:
+ case xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_AFTER:
this._handleInsertAfter(uiDocumentNode);
break;
- case UpdateDirective.DIRECTIVE_REPLACE:
+ case xap.xml.xmodify.UpdateDirective.DIRECTIVE_REPLACE:
this._handleReplace(uiDocumentNode);
break;
- case UpdateDirective.DIRECTIVE_REMOVE_CHILDREN:
+ case xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_CHILDREN:
this._handleRemoveChildren(uiDocumentNode);
break;
- case UpdateDirective.DIRECTIVE_CLONE:
+ case xap.xml.xmodify.UpdateDirective.DIRECTIVE_CLONE:
this._handleClone(uiDocumentNode);
break;
default:
- Xmodify.s_log.debug("Unhandled command : "+this._strType);
+ xap.xml.xmodify.Xmodify.s_log.debug("Unhandled command : "+this._strType);
} /* end switch */
} /* end execute */
@@ -143,13 +143,13 @@
/**
* Does the desired operation require a target node to work?
* @return true if this directive must have a target node.
- * @param nDirectiveType an integer from UpdateDirective's
+ * @param nDirectiveType an integer from xap.xml.xmodify.UpdateDirective's
* constants corresponding to our allowed operations (append, replace,...)
- * @see UpdateDirective#DIRECTIVE_NAMES
+ * @see xap.xml.xmodify.UpdateDirective#DIRECTIVE_NAMES
**/
-CommandDirective._mustHaveTarget = function(nDirectiveType){
+xap.xml.xmodify.CommandDirective._mustHaveTarget = function(nDirectiveType){
//Don't need target for create-document...any others?
- var needs = (nDirectiveType != UpdateDirective.DIRECTIVE_CREATE_DOCUMENT) ;
+ var needs = (nDirectiveType != xap.xml.xmodify.UpdateDirective.DIRECTIVE_CREATE_DOCUMENT) ;
return needs ;
}
@@ -160,7 +160,7 @@
* Select the nodes in the document
* that match the select criteria given.
**/
-CommandDirective.prototype._selectMatchingNodes = function(uiDocumentNode,selectString){
+xap.xml.xmodify.CommandDirective.prototype._selectMatchingNodes = function(uiDocumentNode,selectString){
var targetNodesArray= new Array(0) ;
var localSelectString = selectString ;
@@ -190,14 +190,14 @@
/**
* Appends the nodes held in <code>this._commandArguments</code> to the nodes held in
* <code>this._commandTargets</code>.
- * @throw XmodifyException
+ * @throw xap.xml.xmodify.XmodifyException
**/
-CommandDirective.prototype._handleAppend = function(uiDocumentNode)
+xap.xml.xmodify.CommandDirective.prototype._handleAppend = function(uiDocumentNode)
{
var targetNodes = this._commandTargets ;
var elemsToAppend = this._commandArguments;
- Xmodify.s_log.debug (
+ xap.xml.xmodify.Xmodify.s_log.debug (
"We have "
+ elemsToAppend.length
+ " children to append to "
@@ -217,10 +217,10 @@
if (currentNode.nodeType == google.DOM_DOCUMENT_NODE ){
if (elemsToAppend.length != 1)
{
- throw new XmodifyException(XmodifyException.SET_ROOT_ELEMENT_EXPECTS_ONE_ARG);
+ throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.SET_ROOT_ELEMENT_EXPECTS_ONE_ARG);
}
- Xmodify.s_log.debug (
+ xap.xml.xmodify.Xmodify.s_log.debug (
"We have 1 elem to append as new root : "
+ elemsToAppend[0]
);
@@ -243,17 +243,17 @@
}
else
{
- Xmodify.s_log.debug ("Exception: " + e + " This could be because of a duplicate id issue despite deepClone"); }
+ xap.xml.xmodify.Xmodify.s_log.debug ("Exception: " + e + " This could be because of a duplicate id issue despite deepClone"); }
}
} ;/* end for j.. */
} /* end if Element */
else {
- throw new XmodifyException(XmodifyException.CANT_BLANK_TO_NODE_TYPE, "append", currentNode.nodeType) ;
+ throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.CANT_BLANK_TO_NODE_TYPE, "append", currentNode.nodeType) ;
}
} /* end for i < targetNodes.length...*/
- Xmodify.s_log.debug("Post Append uIDoc: \n "
+ xap.xml.xmodify.Xmodify.s_log.debug("Post Append uIDoc: \n "
+ this.formatDocument(uiDocumentNode)
);
@@ -266,9 +266,9 @@
* Sets attributes of the nodes held in <code>this._commandArguments</code>
* according to the name/value pairs held as attributes in
* <code>this._commandTargets</code>, e.g. <xm:set-attribute name="width" value="30px"/>
- * @throws XmodifyException
+ * @throws xap.xml.xmodify.XmodifyException
**/
-CommandDirective.prototype._handleSetAttribute = function(uiDocumentNode)
+xap.xml.xmodify.CommandDirective.prototype._handleSetAttribute = function(uiDocumentNode)
{
/* @TODO: Validity checks */
@@ -289,14 +289,14 @@
if (attrToSet.getLocalName
// a little roundabout, just a way of seeing if the node local
// name is "attribute"
- && UpdateDirective.getDirectiveTypeAsInt(attrToSet.getLocalName()) == UpdateDirective.DIRECTIVE_ATTRIBUTE
+ && xap.xml.xmodify.UpdateDirective.getDirectiveTypeAsInt(attrToSet.getLocalName()) == xap.xml.xmodify.UpdateDirective.DIRECTIVE_ATTRIBUTE
){
var name = attrToSet.getAttribute('name');
var val = attrToSet.getAttribute('value');
currentNode.setAttribute(name, val);
} else {
- throw new XmodifyException(
- XmodifyException.ATTRIBUTE_ARGUMENT_NOT_ATTRIB_DIRECTIVE,
+ throw new xap.xml.xmodify.XmodifyException(
+ xap.xml.xmodify.XmodifyException.ATTRIBUTE_ARGUMENT_NOT_ATTRIB_DIRECTIVE,
attrToSet.getLocalName()
);
}
@@ -307,11 +307,11 @@
}
else
{
- throw new XmodifyException(XmodifyException.CANT_BLANK_TO_NODE_TYPE, "Set-Attribute", currentNode.nodeType) ;
+ throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.CANT_BLANK_TO_NODE_TYPE, "Set-Attribute", currentNode.nodeType) ;
}
}; /* End for */
- Xmodify.s_log.debug("Post Set-Attr: \n " + this.formatDocument(uiDocumentNode) );
+ xap.xml.xmodify.Xmodify.s_log.debug("Post Set-Attr: \n " + this.formatDocument(uiDocumentNode) );
} /* end handleSetAttribute */
@@ -320,15 +320,15 @@
/**
* Removes the nodes held in <code>this._commandArguments</code> (and
* their subtrees, if any).
- * @throw XmodifyException
+ * @throw xap.xml.xmodify.XmodifyException
**/
-CommandDirective.prototype._handleRemoveElement = function(uiDocumentNode)
+xap.xml.xmodify.CommandDirective.prototype._handleRemoveElement = function(uiDocumentNode)
{
/** Removing an element from the XPATH specified **/
var xpathRemoved = this._selectAttr;
var targetNodes = this._commandTargets ;
- Xmodify.s_log.debug('removing the element at XPath : '
+ xap.xml.xmodify.Xmodify.s_log.debug('removing the element at XPath : '
+ xpathRemoved + " Results: "
+ targetNodes.length
);
@@ -369,7 +369,7 @@
}
else if (elem.nodeType == google.DOM_TEXT_NODE)
{
- Xmodify.s_log.debug ("Removing text node: "+elem.nodeValue());
+ xap.xml.xmodify.Xmodify.s_log.debug ("Removing text node: "+elem.nodeValue());
var parent = elem.parentNode;
if (parent)
{
@@ -383,7 +383,7 @@
}; /* end for */
} catch (e) {alert(e.message);}
- Xmodify.s_log.debug("Post Remove: " + this.formatDocument(uiDocumentNode));
+ xap.xml.xmodify.Xmodify.s_log.debug("Post Remove: " + this.formatDocument(uiDocumentNode));
} /* end handleRemove */
@@ -391,19 +391,19 @@
* Removes all the children for a given node---simpler than remove-element,
* since that one must handle text nodes specially, and contend with the
* possibility that an element to be removed has no parent to remove it.
- * @see CommandDirective#_handleRemoveElement
- * @throws XmodifyException
+ * @see xap.xml.xmodify.CommandDirective#_handleRemoveElement
+ * @throws xap.xml.xmodify.XmodifyException
* @param uidDocument---complete xml for the layout, to date also includes the
* specs for the modification directives handles by this class's instances....
* @author mturyn
**/
-CommandDirective.prototype._handleRemoveChildren = function(uiDocumentNode){
-//Xmodify.DEBUG=true;
+xap.xml.xmodify.CommandDirective.prototype._handleRemoveChildren = function(uiDocumentNode){
+//xap.xml.xmodify.Xmodify.DEBUG=true;
/** Removing an element from the XPATH specified **/
var parentSelector = this._selectAttr;
var targetNodes = this._commandTargets ;
- Xmodify.s_log.debug('Removing the children of nodes for XPath : '
+ xap.xml.xmodify.Xmodify.s_log.debug('Removing the children of nodes for XPath : '
+ parentSelector + " Results: "
+ targetNodes.length
);
@@ -437,8 +437,8 @@
} catch (e) {
alert(e.message);
}
- Xmodify.s_log.debug("Post Remove: " + this.formatDocument(uiDocumentNode));
-//Xmodify.DEBUG=false ;
+ xap.xml.xmodify.Xmodify.s_log.debug("Post Remove: " + this.formatDocument(uiDocumentNode));
+//xap.xml.xmodify.Xmodify.DEBUG=false ;
} /* end _handleRemoveChildren */
@@ -446,18 +446,18 @@
/**
* Removes the attributes specified by <code>this._commandArguments</code> from the
* nodes in <code>this._commandTargets</code>
- * @throws XmodifyException
+ * @throws xap.xml.xmodify.XmodifyException
* @param uidDocument---complete xml for the layout, to date also includes the
* specs for the modification directives handles by this class's instances....
* @author mturyn
**/
-CommandDirective.prototype._handleRemoveAttribute = function(uiDocumentNode){
+xap.xml.xmodify.CommandDirective.prototype._handleRemoveAttribute = function(uiDocumentNode){
/* @TODO: Validity checks */
var attrsToRemove = this._commandArguments ;
var targetNodes = this._commandTargets ;
- Xmodify.s_log.debug("Pre Remove-Attr: "+this._selectAttr+"\n " + this.formatDocument(uiDocumentNode) );
+ xap.xml.xmodify.Xmodify.s_log.debug("Pre Remove-Attr: "+this._selectAttr+"\n " + this.formatDocument(uiDocumentNode) );
for (var i = 0; i < targetNodes.length ; i ++){
var currentNode = targetNodes[i];
@@ -470,14 +470,14 @@
if (attrToRemove.getLocalName
// a little roundabout, just a way of seeing if the node local
// name is "attribute"
- && (UpdateDirective.getDirectiveTypeAsInt(attrToRemove.getLocalName())
- == UpdateDirective.DIRECTIVE_ATTRIBUTE
+ && (xap.xml.xmodify.UpdateDirective.getDirectiveTypeAsInt(attrToRemove.getLocalName())
+ == xap.xml.xmodify.UpdateDirective.DIRECTIVE_ATTRIBUTE
)
){
var name = attrToRemove.getAttribute('name');
currentNode.removeAttribute(name);
} else {
- throw new XmodifyException(XmodifyException.ATTRIBUTE_ARGUMENT_NOT_ATTRIB_DIRECTIVE, attrToSet.getLocalName());
+ throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.ATTRIBUTE_ARGUMENT_NOT_ATTRIB_DIRECTIVE, attrToSet.getLocalName());
}
} catch (e) { alert(j + " " + e.message); }
@@ -485,11 +485,11 @@
} // (End iterating over nodes from which to remove attribute[s].)
} // This was an element
else {
- throw new XmodifyException(XmodifyException.CANT_BLANK_TO_NODE_TYPE, "Set-Attribute", currentNode.nodeType) ;
+ throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.CANT_BLANK_TO_NODE_TYPE, "Set-Attribute", currentNode.nodeType) ;
}
}; // (End iterating over attribute[s] to remove.)
- Xmodify.s_log.debug("Post Remove-Attr: \n " + this.formatDocument(uiDocumentNode) );
+ xap.xml.xmodify.Xmodify.s_log.debug("Post Remove-Attr: \n " + this.formatDocument(uiDocumentNode) );
} /* end handleRemoveAttribute */
@@ -504,9 +504,9 @@
* @param index
* @param parent
* @param contextNode
- * @throws XmodifyException
+ * @throws xap.xml.xmodify.XmodifyException
*/
-CommandDirective.prototype.insertCommandArgumentsAt
+xap.xml.xmodify.CommandDirective.prototype.insertCommandArgumentsAt
= function(index,parent,contextNode, xpathResultIndex)
{
var arrArguments = this._commandArguments ;
@@ -519,13 +519,13 @@
if (arg instanceof google.XNode){
parent.insertChildAt(index, arg);
} else {
- throw new XmodifyException("Can't insert the desired element, can only insert XNode (or descendant) instances so far.") ;
+ throw new xap.xml.xmodify.XmodifyException("Can't insert the desired element, can only insert XNode (or descendant) instances so far.") ;
}
/*
- if (arg instanceof CommandDirective) {
+ if (arg instanceof xap.xml.xmodify.CommandDirective) {
var resolvedArgs = this.evaluateArgumentDirective(
arg, contextNode, environment);
if (resolvedArgs != null) {
@@ -575,9 +575,9 @@
* A helper method to for the <code>insert-before</code> directive:
*
* @param contextNode
- * @throws XmodifyException
+ * @throws xap.xml.xmodify.XmodifyException
*/
-CommandDirective.prototype._handleInsertBefore = function(contextNode){
+xap.xml.xmodify.CommandDirective.prototype._handleInsertBefore = function(contextNode){
/* @TODO: Validity checks */
var targetNodes = this._commandTargets ;
@@ -593,8 +593,8 @@
if (currentNode.nodeType == google.DOM_ELEMENT_NODE ||
currentNode.nodeType == google.DOM_TEXT_NODE) {
if ( parent == null ) {
- throw new XmodifyException(
- XmodifyException.INVALID_INSERT_AFTER_BECAUSE_OF_PARENT,
+ throw new xap.xml.xmodify.XmodifyException(
+ xap.xml.xmodify.XmodifyException.INVALID_INSERT_AFTER_BECAUSE_OF_PARENT,
"'undefined'"
)
}
@@ -602,23 +602,23 @@
//TODO we might want to make it work in the future.
// to make it work for attributes we'll need additional
// API on the Element: setAttributeAt
- throw new XmodifyException(
- XmodifyException.CHILDREN_CANT_BE_ADDED,
+ throw new xap.xml.xmodify.XmodifyException(
+ xap.xml.xmodify.XmodifyException.CHILDREN_CANT_BE_ADDED,
parent.nodeName
) ;
} else {
- throw new XmodifyException(
- XmodifyException.INVALID_INSERT_BEFORE_BECAUSE_OF_PARENT,
+ throw new xap.xml.xmodify.XmodifyException(
+ xap.xml.xmodify.XmodifyException.INVALID_INSERT_BEFORE_BECAUSE_OF_PARENT,
currentNode.nodeName
) ;
}
// Do the simple thing, at this point:
- Xmodify.s_log.debug("Pre insert-before: <" + currentNode.nodeName+"/>:\n" + this.formatDocument(parent));
+ xap.xml.xmodify.Xmodify.s_log.debug("Pre insert-before: <" + currentNode.nodeName+"/>:\n" + this.formatDocument(parent));
this._insertCommandArgumentsBefore(parent,currentNode) ;
- Xmodify.s_log.debug("Post insert-before: <" + currentNode.nodeName+"/>:\n" + this.formatDocument(parent) );
+ xap.xml.xmodify.Xmodify.s_log.debug("Post insert-before: <" + currentNode.nodeName+"/>:\n" + this.formatDocument(parent) );
//this.insertCommandArgumentsAt(index, parent, contextNode, i);
@@ -630,9 +630,9 @@
* A helper method to for the <code>insert-after</code> directive:
*
* @param contextNode
- * @throws XmodifyException
+ * @throws xap.xml.xmodify.XmodifyException
*/
-CommandDirective.prototype._handleInsertAfter = function(contextNode){
+xap.xml.xmodify.CommandDirective.prototype._handleInsertAfter = function(contextNode){
/* @TODO: Validity checks */
var targetNodes = this._commandTargets ;
@@ -647,8 +647,8 @@
if (currentNode.nodeType == google.DOM_ELEMENT_NODE ||
currentNode.nodeType == google.DOM_TEXT_NODE) {
if ( parent == null ) {
- throw new XmodifyException(
- XmodifyException.INVALID_INSERT_AFTER_BECAUSE_OF_PARENT,
+ throw new xap.xml.xmodify.XmodifyException(
+ xap.xml.xmodify.XmodifyException.INVALID_INSERT_AFTER_BECAUSE_OF_PARENT,
"'undefined'"
)
}
@@ -656,23 +656,23 @@
//TODO we might want to make it work in the future.
// to make it work for attributes we'll need additional
// API on the Element: setAttributeAt
- throw new XmodifyException(
- XmodifyException.CHILDREN_CANT_BE_ADDED,
+ throw new xap.xml.xmodify.XmodifyException(
+ xap.xml.xmodify.XmodifyException.CHILDREN_CANT_BE_ADDED,
parent.nodeName
) ;
} else {
- throw new XmodifyException(
- XmodifyException.INVALID_INSERT_BEFORE_BECAUSE_OF_PARENT,
+ throw new xap.xml.xmodify.XmodifyException(
+ xap.xml.xmodify.XmodifyException.INVALID_INSERT_BEFORE_BECAUSE_OF_PARENT,
currentNode.nodeName
) ;
}
// Do the simple thing, at this point:
- Xmodify.s_log.debug("Pre insert-after: <" + currentNode.nodeName+"/>:\n" + this.formatDocument(parent));
+ xap.xml.xmodify.Xmodify.s_log.debug("Pre insert-after: <" + currentNode.nodeName+"/>:\n" + this.formatDocument(parent));
this._insertCommandArgumentsAfter(parent,currentNode) ;
- Xmodify.s_log.debug("Post insert-after: <" + currentNode.nodeName+"/>:\n" + this.formatDocument(parent) );
+ xap.xml.xmodify.Xmodify.s_log.debug("Post insert-after: <" + currentNode.nodeName+"/>:\n" + this.formatDocument(parent) );
//this.insertCommandArgumentsAt(index, parent, contextNode, i);
@@ -684,9 +684,9 @@
* A helper method for the <code>insert-before</code> directive:
* @param parent
* @param contextNode
- * @throws XmodifyException
+ * @throws xap.xml.xmodify.XmodifyException
*/
-CommandDirective.prototype._insertCommandArgumentsAfter
+xap.xml.xmodify.CommandDirective.prototype._insertCommandArgumentsAfter
= function(parent,oldChild){
var arrArguments = this._commandArguments ;
for (var ii=0; ii<arrArguments.length; ++ii ) {
@@ -719,7 +719,7 @@
parent.appendChild(this.makeNodeHTML(newChild));
}
} else {
- throw new XmodifyException("Can't insert the desired element before the indicated element, that target is not an XNode (or subclass tree) instance.") ;
+ throw new xap.xml.xmodify.XmodifyException("Can't insert the desired element before the indicated element, that target is not an XNode (or subclass tree) instance.") ;
}
}
}
@@ -728,9 +728,9 @@
* A helper method for the <code>insert-before</code> directive:
* @param parent
* @param contextNode
- * @throws XmodifyException
+ * @throws xap.xml.xmodify.XmodifyException
*/
-CommandDirective.prototype._insertCommandArgumentsBefore
+xap.xml.xmodify.CommandDirective.prototype._insertCommandArgumentsBefore
= function(parent,oldChild){
var arrArguments = this._commandArguments ;
for (var ii=0; ii<arrArguments.length; ++ii ) {
@@ -749,7 +749,7 @@
oldChild
);
} else {
- throw new XmodifyException("Can't insert the desired element before the indicated element, that target is not an XNode (or subclass tree) instance.") ;
+ throw new xap.xml.xmodify.XmodifyException("Can't insert the desired element before the indicated element, that target is not an XNode (or subclass tree) instance.") ;
}
}
}
@@ -764,9 +764,9 @@
* the element to replace, followed by its <code>remove</code>:
*
* @param contextNode
- * @throws XmodifyException
+ * @throws xap.xml.xmodify.XmodifyException
*/
-CommandDirective.prototype._handleReplace = function(contextNode){
+xap.xml.xmodify.CommandDirective.prototype._handleReplace = function(contextNode){
/* @TODO: Validity checks */
var targetNodes = this._commandTargets ;
@@ -776,7 +776,7 @@
/* Throw an exception? Alert? */
}
- Xmodify.s_log.debug("Pre replacement:\n" + this.formatDocument(contextNode));
+ xap.xml.xmodify.Xmodify.s_log.debug("Pre replacement:\n" + this.formatDocument(contextNode));
for (var ii=0; ii<targetNodes.length; ++ii ) {
// unresolved argument: (arbitrary xml | String | CloneDirective |
@@ -784,18 +784,18 @@
var oldChild = targetNodes[ii] ;
// Just try it for XNode and descendants so far:
if (oldChild instanceof google.XNode || this._bHtmlDocument){
- Xmodify.s_log.debug("Pre replacing <" + oldChild.nodeName+"/>:\n" + this.formatDocument(oldChild.parentNode));
+ xap.xml.xmodify.Xmodify.s_log.debug("Pre replacing <" + oldChild.nodeName+"/>:\n" + this.formatDocument(oldChild.parentNode));
this._replaceWithCommandArguments(oldChild) ;
- Xmodify.s_log.debug("Post replacing: <" + oldChild.nodeName+"/>:\n" + this.formatDocument(oldChild.parentNode) );
+ xap.xml.xmodify.Xmodify.s_log.debug("Post replacing: <" + oldChild.nodeName+"/>:\n" + this.formatDocument(oldChild.parentNode) );
} else {
- throw new XmodifyException(XmodifyException.CANNOT_REPLACE__ORIGINAL_INVALID,""+oldChild) ;
+ throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.CANNOT_REPLACE__ORIGINAL_INVALID,""+oldChild) ;
}
}
- Xmodify.s_log.debug("Post replacement:\n" + this.formatDocument(contextNode));
+ xap.xml.xmodify.Xmodify.s_log.debug("Post replacement:\n" + this.formatDocument(contextNode));
- //Xmodify.s_log.debug("Post replacement: <" + contextNode.nodeName+"/>:\n" + this.formatDocument(contextNode) );
+ //xap.xml.xmodify.Xmodify.s_log.debug("Post replacement: <" + contextNode.nodeName+"/>:\n" + this.formatDocument(contextNode) );
}
@@ -804,10 +804,10 @@
* A helper method for the <code>insert-before</code> directive:
* @param parent
* @param contextNode
- * @throws XmodifyException
+ * @throws xap.xml.xmodify.XmodifyException
*/
-CommandDirective.prototype._replaceWithCommandArguments = function(oldChild){
- //Xmodify.DEBUG=true;
+xap.xml.xmodify.CommandDirective.prototype._replaceWithCommandArguments = function(oldChild){
+ //xap.xml.xmodify.Xmodify.DEBUG=true;
// Do the simple thing, at this point:
var parent = oldChild.parentNode ;
var arrArguments = this._commandArguments ;
@@ -819,7 +819,7 @@
newChild = arrArguments[ii] ;
// Just try it for XNode and descendants so far:
if (oldChild instanceof google.XNode){
- Xmodify.s_log.debug(
+ xap.xml.xmodify.Xmodify.s_log.debug(
"Pre insertion of " + this.formatDocument(newChild)+"\nbefore\n"
+ this.formatDocument(oldChild)
+ this.formatDocument(parent)
@@ -830,15 +830,15 @@
oldChild
);
} catch (insertionException){
- throw new XmodifyException(XmodifyException.CANNOT_REPLACE__INSERTION,newChild.nodeName,""+insertionException);
+ throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.CANNOT_REPLACE__INSERTION,newChild.nodeName,""+insertionException);
}
- Xmodify.s_log.debug(
+ xap.xml.xmodify.Xmodify.s_log.debug(
"Post insertion of " + this.formatDocument(newChild) +"\nbefore\n"
+ this.formatDocument(oldChild)
+ this.formatDocument(parent)
) ;
} else if (this._bHtmlDocument){
- Xmodify.s_log.debug(
+ xap.xml.xmodify.Xmodify.s_log.debug(
"Pre insertion of " + this.formatDocument(newChild)+"\nbefore\n"
+ this.formatDocument(oldChild)
+ this.formatDocument(parent)
@@ -851,15 +851,15 @@
// alert("parent.insertBefore(after");
} catch (insertionException){
- throw new XmodifyException(XmodifyException.CANNOT_REPLACE__INSERTION,newChild.nodeName,""+insertionException);
+ throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.CANNOT_REPLACE__INSERTION,newChild.nodeName,""+insertionException);
}
- Xmodify.s_log.debug(
+ xap.xml.xmodify.Xmodify.s_log.debug(
"Post insertion of " + this.formatDocument(newChild) +"\nbefore\n"
+ this.formatDocument(oldChild)
+ this.formatDocument(parent)
);
} else {
- throw new XmodifyException(XmodifyException.CANNOT_REPLACE,oldChild.nodeName,newChild.nodeName,"unknown cause");
+ throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.CANNOT_REPLACE,oldChild.nodeName,newChild.nodeName,"unknown cause");
}
} // end of the iteration over all replacement nodes
try {
@@ -868,21 +868,21 @@
} catch (removalException){
// Better if we could attempt to back off all the
// changes, but not yet:
- throw new XmodifyException(XmodifyException.CANNOT_REPLACE__REMOVAL,oldChild.nodeName,""+removalException);
+ throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.CANNOT_REPLACE__REMOVAL,oldChild.nodeName,""+removalException);
}
} catch(replacementException){
- throw new XmodifyException(XmodifyException.CANNOT_REPLACE,
+ throw new xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.CANNOT_REPLACE,
oldChild.nodeName,
newChild.nodeName,
""+replacementException
);
} finally {
- Xmodify.s_log.debug(
+ xap.xml.xmodify.Xmodify.s_log.debug(
"Post all insertions and removals composited into replacement:"
+ '\n'+ this.formatDocument(parent)
) ;
- //Xmodify.DEBUG=false;
+ //xap.xml.xmodify.Xmodify.DEBUG=false;
}// end of 'try'/catch blocks around iteration over nodes to to replace in
} // end of _replaceWithCommandArguments()
@@ -893,7 +893,7 @@
* Handles cloning declaration directive
* @throw
*/
-CommandDirective.prototype._handleClone = function(uiDocumentNode){
+xap.xml.xmodify.CommandDirective.prototype._handleClone = function(uiDocumentNode){
this._clones = new Array(this._commandTargets.length) ;
@@ -905,8 +905,8 @@
var cloned = toClone.deepClone(false) ;
this._clones[ll] = clone ;
} else {
- throw new XmodifyException(
- XmodifyException.CANT_BLANK_TO_NODE_TYPE,
+ throw new xap.xml.xmodify.XmodifyException(
+ xap.xml.xmodify.XmodifyException.CANT_BLANK_TO_NODE_TYPE,
"Clone",
currentNode.nodeType
) ;
@@ -921,7 +921,7 @@
* @param document
* @return Formattes string
*/
-CommandDirective.prototype.formatDocument = function(inputDocument){
+xap.xml.xmodify.CommandDirective.prototype.formatDocument = function(inputDocument){
try{
//try to format catch exception.
return inputDocument;//.toXml(true);
@@ -933,7 +933,7 @@
/*
* TODO - Look for possible better place to stick this.
*/
-CommandDirective.prototype.makeNodeHTML = function(node){
+xap.xml.xmodify.CommandDirective.prototype.makeNodeHTML = function(node){
//create the element
var htmlNode = document.createElement(node.getLocalName());
@@ -958,6 +958,6 @@
return htmlNode;
}
-//End of CommandDirective
+//End of xap.xml.xmodify.CommandDirective
Modified: incubator/xap/trunk/src/xap/xml/xmodify/DirectiveSet.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/xml/xmodify/DirectiveSet.js?rev=422273&r1=422272&r2=422273&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/xml/xmodify/DirectiveSet.js (original)
+++ incubator/xap/trunk/src/xap/xml/xmodify/DirectiveSet.js Sat Jul 15 10:22:41 2006
@@ -19,11 +19,11 @@
Xap.provide('xap.xml.xmodify.DirectiveSet');
-DirectiveSet = function( modificationsElement ){
+xap.xml.xmodify.DirectiveSet = function( modificationsElement ){
this._directives = this._createDirectives(modificationsElement.childNodes);
}
-DirectiveSet.prototype.execute = function(uiDocument)
+xap.xml.xmodify.DirectiveSet.prototype.execute = function(uiDocument)
{
for (var i = 0;
i < this._directives.length;
@@ -34,7 +34,7 @@
}
-DirectiveSet.prototype._createDirectives = function(elemsDirectives)
+xap.xml.xmodify.DirectiveSet.prototype._createDirectives = function(elemsDirectives)
{
var dirs = new Array();
@@ -42,7 +42,7 @@
i < elemsDirectives.length;
i++)
{
- dirs[dirs.length] = new CommandDirective (elemsDirectives[i]);
+ dirs[dirs.length] = new xap.xml.xmodify.CommandDirective (elemsDirectives[i]);
} /* end for i */
Modified: incubator/xap/trunk/src/xap/xml/xmodify/UpdateDirective.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/xml/xmodify/UpdateDirective.js?rev=422273&r1=422272&r2=422273&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/xml/xmodify/UpdateDirective.js (original)
+++ incubator/xap/trunk/src/xap/xml/xmodify/UpdateDirective.js Sat Jul 15 10:22:41 2006
@@ -21,7 +21,7 @@
/**
- * Base class for XMLUpdate CommandDirective.
+ * Base class for XMLUpdate xap.xml.xmodify.CommandDirective.
*
* @version modeled after Java $Revision: 1.6 $
* @author Johnny@hisown.com
@@ -33,7 +33,7 @@
*
* @param elemDirectiveElement - element representing the directive
*/
-UpdateDirective = function(elemDirectiveElement)
+xap.xml.xmodify.UpdateDirective = function(elemDirectiveElement)
{
/* Change a command directive into a directive object */
@@ -41,51 +41,51 @@
/* Javascript doesnt have trim, so we make our own */
this._strType = elemDirectiveElement.getLocalName( ) ;
- this._type = UpdateDirective.getDirectiveTypeAsInt(this._strType);
+ this._type = xap.xml.xmodify.UpdateDirective.getDirectiveTypeAsInt(this._strType);
this._directiveElement = elemDirectiveElement;
}
//----------------------------------------------------------------------
// Constants
//----------------------------------------------------------------------
-UpdateDirective.DIRECTIVE_VARIABLE = 0;
-UpdateDirective.DIRECTIVE_ATTRIBUTE = 1;
-UpdateDirective.DIRECTIVE_VALUE_OF = 2;
-UpdateDirective.DIRECTIVE_INSERT_AFTER = 3;
-UpdateDirective.DIRECTIVE_INSERT_BEFORE = 4;
-UpdateDirective.DIRECTIVE_APPEND = 5;
-UpdateDirective.DIRECTIVE_SET_ATTRIBUTE = 6;
-UpdateDirective.DIRECTIVE_REPLACE = 7
-UpdateDirective.DIRECTIVE_REPLACE_CHILDREN = 8;
-UpdateDirective.DIRECTIVE_REMOVE_ELEMENT = 9;
-UpdateDirective.DIRECTIVE_REMOVE_ATTRIBUTE = 10;
-UpdateDirective.DIRECTIVE_INSERT_AT = 11;
-UpdateDirective.DIRECTIVE_CLONE = 12;
-UpdateDirective.DIRECTIVE_CREATE_DOCUMENT = 13;
-UpdateDirective.DIRECTIVE_REMOVE_CHILD = 14;
-UpdateDirective.DIRECTIVE_REMOVE_CHILDREN = 15;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_VARIABLE = 0;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_ATTRIBUTE = 1;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_VALUE_OF = 2;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_AFTER = 3;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_BEFORE = 4;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_APPEND = 5;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_SET_ATTRIBUTE = 6;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_REPLACE = 7
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_REPLACE_CHILDREN = 8;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_ELEMENT = 9;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_ATTRIBUTE = 10;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_AT = 11;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_CLONE = 12;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_CREATE_DOCUMENT = 13;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_CHILD = 14;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_CHILDREN = 15;
/**
* Used to do integer/string translation:
**/
-UpdateDirective.DIRECTIVE_NAMES = new Array(0);
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_VARIABLE] = "variable" ;
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_ATTRIBUTE] = "attribute" ;
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_VALUE_OF] = "value-of" ;
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_INSERT_AFTER] = "insert-after" ;
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_INSERT_BEFORE] = "insert-before" ;
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_APPEND] = "append" ;
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_SET_ATTRIBUTE] = "set-attribute" ;
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_REPLACE] = "replace" ;
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_REPLACE_CHILDREN] = "replace-children" ;
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_REMOVE_ELEMENT] = "remove-element" ;
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_REMOVE_ATTRIBUTE] = "remove-attribute" ;
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_INSERT_AT] = "insert-at" ;
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_CLONE] = "clone" ;
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_CREATE_DOCUMENT] = "create-document" ;
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_REMOVE_CHILD] = "remove-child" ;
-UpdateDirective.DIRECTIVE_NAMES[UpdateDirective.DIRECTIVE_REMOVE_CHILDREN] = "remove-children" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES = new Array(0);
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_VARIABLE] = "variable" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_ATTRIBUTE] = "attribute" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_VALUE_OF] = "value-of" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_AFTER] = "insert-after" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_BEFORE] = "insert-before" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_APPEND] = "append" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_SET_ATTRIBUTE] = "set-attribute" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_REPLACE] = "replace" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_REPLACE_CHILDREN] = "replace-children" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_ELEMENT] = "remove-element" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_ATTRIBUTE] = "remove-attribute" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_INSERT_AT] = "insert-at" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_CLONE] = "clone" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_CREATE_DOCUMENT] = "create-document" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_CHILD] = "remove-child" ;
+xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[xap.xml.xmodify.UpdateDirective.DIRECTIVE_REMOVE_CHILDREN] = "remove-children" ;
//--------------------------------------------------------------------
// Package Protected Class Methods.
@@ -96,17 +96,17 @@
* @param directive - string representation of the directive type
* @return - int representation of the directive type
*/
-UpdateDirective.getDirectiveTypeAsInt = function (strDirective)
+xap.xml.xmodify.UpdateDirective.getDirectiveTypeAsInt = function (strDirective)
{
- for (i = 0 ; i < UpdateDirective.DIRECTIVE_NAMES.length ; i++)
+ for (i = 0 ; i < xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES.length ; i++)
{
- if (UpdateDirective.DIRECTIVE_NAMES[i] == strDirective)
+ if (xap.xml.xmodify.UpdateDirective.DIRECTIVE_NAMES[i] == strDirective)
{
return (i);
}
} /* end for */
- throw (XmodifyException(XmodifyException.UNKNOWN_COMMAND, strDirective));
+ throw (xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.UNKNOWN_COMMAND, strDirective));
} /* end getDirectiveTypeAsInt */
@@ -124,12 +124,12 @@
* Accessor method for the _type protperty
* @return - int type of directive
*/
-UpdateDirective.prototype.getType = function()
+xap.xml.xmodify.UpdateDirective.prototype.getType = function()
{
return(this._type);
}
-UpdateDirective.prototype.getDirectiveElement = function()
+xap.xml.xmodify.UpdateDirective.prototype.getDirectiveElement = function()
{
return(this._directiveElement);
}
Modified: incubator/xap/trunk/src/xap/xml/xmodify/Xmodify.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/xml/xmodify/Xmodify.js?rev=422273&r1=422272&r2=422273&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/xml/xmodify/Xmodify.js (original)
+++ incubator/xap/trunk/src/xap/xml/xmodify/Xmodify.js Sat Jul 15 10:22:41 2006
@@ -23,7 +23,7 @@
* <ol>
* <li> Construct and XmlUpdate object passing a document
* containing one or more sets of XmlUpdate expressions.</li>
- * <li> Use the execute( DocumentContainer ) method to execute the operations
+ * <li> Use the execute( xap.xml.DocumentContainer ) method to execute the operations
* on a given document, node or a set of nodes.</li>
* </ol>
*
@@ -76,10 +76,10 @@
* @version Modeled after Java $Revision: 1.20 $
*/
-Xmodify = function( modificationsElement )
+xap.xml.xmodify.Xmodify = function( modificationsElement )
{
this._modificationsElement = modificationsElement;
- this._directiveSet = new DirectiveSet(modificationsElement);
+ this._directiveSet = new xap.xml.xmodify.DirectiveSet(modificationsElement);
var checkThisOutOnDebugging = true ;
}
@@ -89,7 +89,7 @@
//-----------------------------------------------------------------------
-Xmodify.s_log = xap.util.LogFactory.getLog( "Xmodify" );
+xap.xml.xmodify.Xmodify.s_log = xap.util.LogFactory.getLog( "xap.xml.xmodify.Xmodify" );
//-----------------------------------------------------------------------
// Constructors.
@@ -101,7 +101,7 @@
// Public Methods. (publc instance methods)
//-----------------------------------------------------------------------
-Xmodify.prototype.execute = function (documentContainer)
+xap.xml.xmodify.Xmodify.prototype.execute = function (documentContainer)
{
/*
* Execute our commandsDoc on the UIDocument from the container
@@ -120,7 +120,7 @@
*/
this._directiveSet.execute(uiDoc);
- Xmodify.s_log.debug(uiDoc);
+ xap.xml.xmodify.Xmodify.s_log.debug(uiDoc);
} /* end execute */
Modified: incubator/xap/trunk/src/xap/xml/xmodify/XmodifyException.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/xml/xmodify/XmodifyException.js?rev=422273&r1=422272&r2=422273&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/xml/xmodify/XmodifyException.js (original)
+++ incubator/xap/trunk/src/xap/xml/xmodify/XmodifyException.js Sat Jul 15 10:22:41 2006
@@ -22,21 +22,21 @@
//TODO this entire class needs revamp, for the time being we will leave it as is
/**
- * XmodifyException is the port of UpdateException
+ * xap.xml.xmodify.XmodifyException is the port of UpdateException
*
* Notice how we use this is
*
- * throw(XmodifyException(XmodifyException.CANT_BLANK_TO_NODE_TYPE , "append", "Text"));
+ * throw(xap.xml.xmodify.XmodifyException(xap.xml.xmodify.XmodifyException.CANT_BLANK_TO_NODE_TYPE , "append", "Text"));
*
*
* @author JL@HisOwn.com
*/
-XmodifyException = function( message ){
+xap.xml.xmodify.XmodifyException = function( message ){
this._message = message;
}
-XmodifyException.prototype.toString = function(){
+xap.xml.xmodify.XmodifyException.prototype.toString = function(){
return this._message;
}
@@ -44,29 +44,29 @@
// Constants. (public static final)
//-----------------------------------------------------------------------
-XmodifyException.CANT_BLANK_TO_NODE_TYPE = "Can't %s to %s";
-XmodifyException.SET_ROOT_ELEMENT_EXPECTS_ONE_ARG = "setRootElement() Expects one arg";
-XmodifyException.COMMAND_EXPECTS_ONE_ARG = "%s Expects one arg";
-XmodifyException.ATTRIBUTE_ARGUMENT_NOT_ATTRIB_DIRECTIVE = "Attribute argument %s is not an attribute directive!";
-XmodifyException.UNKNOWN_COMMAND = "Directive %s is unrecognized";
-XmodifyException.INVALID_INSERT_AFTER_BECAUSE_OF_PARENT = "The XPath statement resolved to type %s which does not have a parent. Therefore an insert after cannot be performed." ;
-XmodifyException.INVALID_INSERT_BEFORE_BECAUSE_OF_PARENT = "The XPath statement resolved to type %s which does not have a parent. Therefore an insert before cannot be performed." ;
-XmodifyException.CHILDREN_CANT_BE_ADDED = "The XPath statement returned a node to which children may not be added: %s" ;
+xap.xml.xmodify.XmodifyException.CANT_BLANK_TO_NODE_TYPE = "Can't %s to %s";
+xap.xml.xmodify.XmodifyException.SET_ROOT_ELEMENT_EXPECTS_ONE_ARG = "setRootElement() Expects one arg";
+xap.xml.xmodify.XmodifyException.COMMAND_EXPECTS_ONE_ARG = "%s Expects one arg";
+xap.xml.xmodify.XmodifyException.ATTRIBUTE_ARGUMENT_NOT_ATTRIB_DIRECTIVE = "Attribute argument %s is not an attribute directive!";
+xap.xml.xmodify.XmodifyException.UNKNOWN_COMMAND = "Directive %s is unrecognized";
+xap.xml.xmodify.XmodifyException.INVALID_INSERT_AFTER_BECAUSE_OF_PARENT = "The XPath statement resolved to type %s which does not have a parent. Therefore an insert after cannot be performed." ;
+xap.xml.xmodify.XmodifyException.INVALID_INSERT_BEFORE_BECAUSE_OF_PARENT = "The XPath statement resolved to type %s which does not have a parent. Therefore an insert before cannot be performed." ;
+xap.xml.xmodify.XmodifyException.CHILDREN_CANT_BE_ADDED = "The XPath statement returned a node to which children may not be added: %s" ;
// We're at first doing replacement as a composition of insert-before and remove:
-XmodifyException.CANNOT_REPLACE = "Some problem replacing node <%s/> with node <%s/>: %s" ;
-XmodifyException.CANNOT_REPLACE__REMOVAL = "Some problem removing old node <%s/>: %s" ;
-XmodifyException.CANNOT_REPLACE__INSERTION = "Some problem inserting new node <%s/>: %s" ;
-XmodifyException.CANNOT_REPLACE__ORIGINAL_INVALID
+xap.xml.xmodify.XmodifyException.CANNOT_REPLACE = "Some problem replacing node <%s/> with node <%s/>: %s" ;
+xap.xml.xmodify.XmodifyException.CANNOT_REPLACE__REMOVAL = "Some problem removing old node <%s/>: %s" ;
+xap.xml.xmodify.XmodifyException.CANNOT_REPLACE__INSERTION = "Some problem inserting new node <%s/>: %s" ;
+xap.xml.xmodify.XmodifyException.CANNOT_REPLACE__ORIGINAL_INVALID
="Can't replace the selected element with the indicated element, "
+"the selected element was null or otherwise not an XNode instance: %s."
-XmodifyException.ZERO_RESULTS = "The XPath statement %s returned 0 results." ;
-XmodifyException.UNSPECIFIED_EXCEPTION ="Unspecified Xmodify exception." ;
+xap.xml.xmodify.XmodifyException.ZERO_RESULTS = "The XPath statement %s returned 0 results." ;
+xap.xml.xmodify.XmodifyException.UNSPECIFIED_EXCEPTION ="Unspecified xap.xml.xmodify.Xmodify exception." ;
-/*** End XmodifyException ***/
+/*** End xap.xml.xmodify.XmodifyException ***/
Modified: incubator/xap/trunk/src/xap/xml/xmodify/XmodifyNamespaceHandler.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/xml/xmodify/XmodifyNamespaceHandler.js?rev=422273&r1=422272&r2=422273&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/xml/xmodify/XmodifyNamespaceHandler.js (original)
+++ incubator/xap/trunk/src/xap/xml/xmodify/XmodifyNamespaceHandler.js Sat Jul 15 10:22:41 2006
@@ -19,8 +19,8 @@
/**
- * @fileoverview XmodifyNamespaceHandler receives elements in the
- * NamespaceHandlerManager.XMODIFY_NAMESPACE namespace and uses XModify
+ * @fileoverview xap.xml.xmodify.XmodifyNamespaceHandler receives elements in the
+ * xap.xml.NamespaceHandlerManager.XMODIFY_NAMESPACE namespace and uses XModify
* to execute them.
*
* @author ikaplansky
@@ -28,27 +28,27 @@
/**
- * @class XmodifyNamespaceHandler receives elements in the
- * NamespaceHandlerManager.XMODIFY_NAMESPACE namespace and uses XModify
+ * @class xap.xml.xmodify.XmodifyNamespaceHandler receives elements in the
+ * xap.xml.NamespaceHandlerManager.XMODIFY_NAMESPACE namespace and uses XModify
* to execute them.
*
* @constructor
*/
-XmodifyNamespaceHandler = function( session ){
- NamespaceHandler.call(this, session);
+xap.xml.xmodify.XmodifyNamespaceHandler = function( session ){
+ xap.xml.NamespaceHandler.call(this, session);
}
-XmodifyNamespaceHandler.MODIFICATIONS_TAG = "modifications";
+xap.xml.xmodify.XmodifyNamespaceHandler.MODIFICATIONS_TAG = "modifications";
//-----------------------------------------------------------------------
// Constructors.
//-----------------------------------------------------------------------
-XmodifyNamespaceHandler.prototype = new NamespaceHandler;
+xap.xml.xmodify.XmodifyNamespaceHandler.prototype = new xap.xml.NamespaceHandler;
//-----------------------------------------------------------------------
-// NamespaceHandler Implementation.
+// xap.xml.NamespaceHandler Implementation.
//-----------------------------------------------------------------------
/**
@@ -57,11 +57,11 @@
*
* @param element the element that is namespaced, including all of its
* children
- * @param container The DocumentContainer to be used for processing.
+ * @param container The xap.xml.DocumentContainer to be used for processing.
* @throws UpdateException
*/
-XmodifyNamespaceHandler.prototype.receiveDispatch = function( element ) {
- var xmodify = new Xmodify( element );
+xap.xml.xmodify.XmodifyNamespaceHandler.prototype.receiveDispatch = function( element ) {
+ var xmodify = new xap.xml.xmodify.Xmodify( element );
xmodify.execute( this.getSession().getDocumentContainer() );
}