ate 2004/06/11 07:57:39
Modified: portal/src/java/org/apache/jetspeed/util/descriptor
PortletApplicationWar.java
Log:
Fixed inserting required web.xml elements if appending at the end.
CVS: ----------------------------------------------------------------------
CVS: PR:
CVS: If this change addresses a PR in the problem report tracking
CVS: database, then enter the PR number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system, such as NCSA,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to Apache by someone else; i.e.,
CVS: they sent us a patch or a new module, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.
Revision Changes Path
1.4 +18 -8
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/util/descriptor/PortletApplicationWar.java
Index: PortletApplicationWar.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/util/descriptor/PortletApplicationWar.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PortletApplicationWar.java 10 Jun 2004 19:52:10 -0000 1.3
+++ PortletApplicationWar.java 11 Jun 2004 14:57:39 -0000 1.4
@@ -527,27 +527,37 @@
List allChildren = root.getChildren();
List elementsBeforeList = Arrays.asList(elementsBefore);
toInsert.detach();
- int insertAfter = 0;
+ int insertAfter = 0;
+ boolean moreAfter = false;
for (int i = 0; i < allChildren.size(); i++)
{
Element element = (Element) allChildren.get(i);
if (elementsBeforeList.contains(element.getName()))
{
insertAfter = i;
+ moreAfter = false;
+ }
+ else
+ {
+ moreAfter = true;
}
}
-
- try
+ try
+ {
+ if ( moreAfter )
{
root.addContent((insertAfter+2), toInsert);
}
- catch (ArrayIndexOutOfBoundsException e)
+ else
{
- root.addContent(toInsert);
+ root.addContent((insertAfter+3), toInsert);
}
-
-
+ }
+ catch (ArrayIndexOutOfBoundsException e)
+ {
+ root.addContent(toInsert);
+ }
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]