created branch incorrectly first time, moving from within 'trunk'

git-svn-id: https://svn.apache.org/repos/asf/portals/pluto/branches/1.1.0-ADMIN_PORTLET@482006 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/trunk/KEYS b/trunk/KEYS
deleted file mode 100644
index 29e456b..0000000
--- a/trunk/KEYS
+++ /dev/null
@@ -1,214 +0,0 @@
-(instructions copied from forrest's KEYS file)
-
-This file contains the PGP keys of various developers.
-Please don't use them for email unless you have to. Their main
-purpose is code signing.
-
-Users: pgp < KEYS
-Developers:
-        pgp -kxa <your name> and append it to this file.
-        (pgpk -ll <your name> && pgpk -xa <your name>) >> this file.
-        (gpg --list-sigs <your name>
-             && gpg --armor --export <your name>) >> this file.
-------------------------------------------------------------------------
-
-pub  1024D/E41EDC7E 2003-09-26 Carsten Ziegeler <cziegeler@apache.org>
-sig 3       E41EDC7E 2003-09-26   Carsten Ziegeler <cziegeler@apache.org>
-sig 3       EE56550E 2003-12-01   Cliff Schmidt <cliff@alum.mit.edu>
-sig 3       CC78C893 2003-11-18   Rich Bowen <rbowen@rcbowen.com>
-sig 3       EE65E321 2003-11-24   Martin Kraemer <martin@apache.org>
-sig         40581837 2003-11-27   Nick Kew <nick@webthing.com>
-sig 3       142B509B 2003-11-25   Glenn L. Nielsen (Sign jakarta.apache.org distributions) <glenn@apache.org>
-sig 3       CE19D5C6 2003-11-18   Jamie Wallingford (legobuff) <jamie@legobuff.com>
-sig 3       D147B776 2003-11-28   Mitch Comstock (RAID) <mcomstock@raidworks.com>
-sig 2       65FDCDEE 2003-11-20   James Howison <james@freelancepropaganda.com>
-sig         FD093C41 2003-11-23   James M. Turner <turner@blackbear.com>
-sig 2       A1D69759 2003-11-24   Michael Kellen <idsfa@visi.com>
-sig 2       76D83CC6 2003-11-22   Manoj Kasichainula <manoj@apache.org>
-sig 3       A54DA2DF 2003-11-18   Erin Mulder <meara@alumni.princeton.edu>
-sig         152924AF 2003-11-22   Sander Temme <sander@temme.net>
-sig         964F31D9 2003-11-22   [User id not found]
-sig         B6B45F1F 2003-11-19   Chengetai Masango <chengetai@masango.net>
-sig 2       4C9165B6 2003-11-18   Aaron Mulder <ammulder@alumni.princeton.edu>
-sig 3       F5FC4B42 2003-11-21   Theodore W. Leung <twl@sauria.com>
-sig 2       F88341D9 2003-11-30   Lars Eilebrecht <lars@eilebrecht.org>
-sig 3       A11D56FB 2003-12-03   Geoffrey Young (http://www.modperlcookbook.org/~geoff/) <geoff@modperlcookbook.org>
-sub  1024g/0F6ED732 2003-09-26
-sig         E41EDC7E 2003-09-26   Carsten Ziegeler <cziegeler@apache.org>
-
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.2.3 (MingW32)
-
-mQGiBD90V4MRBAC1lbNdQ9fvvooWXlFx9u/C3Vtsgc+ZsukqBRQRuSEBNZKQr3XC
-NmOy6rlLKan0brlr8L+6xmkQgJCgsNGnjqwIHRe8irMLEqK+uGhpoQ9z4zgc6JVl
-CLarZPvqe7GOifOKlheadWrkkRQMOuKjDF8Nuy10S4jaIEVMhPcorakbYwCgqXzA
-GD/327IVU2SEfL2ezVC1nc0D/Rj43bqn/GzB6pBUIaG2LNAfPtVfdmnqjKa/0PDF
-/hxyGN2Pb5BBlBAZe/ysNRNpGi+kVqGxweccugco6atDRv/INPVQ1dSKAoX/zuuE
-rMeTCaXYE45uBXYhvSsGM2iNJYcS/VW10ZW5RD3F5eWVSo50Xin4obmJmlfr8BTp
-VoxNBACjYrCo9f2MI30fxCgKu9ugyz/rFA7Zja/Hq18jyUWUA8oIQ6VonNvnEu80
-9jf1c23HtKQu+f4yHBDKR6RKsas5kCQDZJncQCn8PHRqSkLWRsAnl2e8fY72QnVI
-pSL7HZ4AnOAaO9sMONQMADq3q9muQofNQDS79IRAWXP7kDT5pbQnQ2Fyc3RlbiBa
-aWVnZWxlciA8Y3ppZWdlbGVyQGFwYWNoZS5vcmc+iF4EExECAB4FAj90V4MCGwMG
-CwkIBwMCAxUCAwMWAgECHgECF4AACgkQEy5J1OQe3H4aLwCdEP8ARIZxOvFITQ7I
-nee1qC85BbsAnjnKXQaUm1unAnNHwN7fNyZnnIuEiEYEExECAAYFAj/K5J0ACgkQ
-aFp3yu5WVQ43XwCfahn9RObiYcvqRFXPtze303XMRQIAoIvStwGIypv7YrjeS/70
-EpaQMPn5iEYEExECAAYFAj+6hk0ACgkQXP03+sx4yJOqUwCg17eCYJCnmzDw9GTe
-/BKGPZj12LYAoMnIahWcyIFLlLOP9ISlMKlr5EkWiJwEEwECAAYFAj/Cd1AACgkQ
-N+P0X+5l4yE+dQQArTUZsgHjZE1M9DRQhZQkU20/WzW4NVxWaYdW2/tIy/a293Zd
-RWG9QDe1VPT7KUoAT306N5HqM4TUjg2QjAyg6ou6J76yk62j1Hsj0RJskf0IMXiF
-NZICn7z+y6FsCI60flgpOKI11GZeAI6FLGppcsF5NCnAP9PKv20EQ07kUeqIRgQQ
-EQIABgUCP8YSFAAKCRBtC8c6QFgYN2IOAJ4lgeI6pvXBeEM13xq9WSplyS9z7gCc
-CO/dGO4i7M9rcDp9B79sy/Qpnk6IRgQTEQIABgUCP8OFGQAKCRD6PI0mFCtQm93V
-AKCMJi0mWq0PLehrhpGwJKrzdt6DSgCgiRqkfD1u4lj6rezjCxH9GR6b9HqIRgQT
-EQIABgUCP7mp+AAKCRCoHuZJzhnVxkHGAJ4moSSBBtV6ynXFk+k26ca1M5Lx5QCd
-G8MrlXJ5ThRD4ZecP79x5x8CmTeIRgQTEQIABgUCP8e9LgAKCRCkdA850Ue3dsVa
-AJ9h8CF7Tj68kwbzhY0/RjkA2pA94gCfQH1azsf2LYhOvObOrknpk1ZALOGIRgQS
-EQIABgUCP7xjvgAKCRDsmT1jZf3N7jUmAJ41pjcLgAkHvGnfv9jZYz4CqvrGfgCd
-ERE/EX2IX0bYOraPIcuhcHaHCQ2IRgQQEQIABgUCP8BjyAAKCRAaCdGD/Qk8QVAN
-AKCMesKnneWni3IardexYlkChRaLXACgtmgMT0KWnWAwk3zji3zkVgk72HqIRgQS
-EQIABgUCP8FOvQAKCRDMITAgodaXWbO0AKCPOmm3BjK/OrGzsu+04g6SfuV8fQCf
-b0SDGLgnslcqkzU02ZxT+hHWAbCJARwEEgECAAYFAj+/wxYACgkQBurPqnbYPMbJ
-ugf/X7I18RgC6uFsPXsCMQh/EQdDO3Cll8SnmCmNz08jlE89cDiHAgJZ6b7n+p+G
-v44DaO5Ofkb+iwtTHuFuvG50qY45X2/oyBJHllXlbxMEyjWfhny6hD84WYnM7PS2
-a6gww0+beCz77ESw6RdHgIFNvZnn0Ca58QLKixlKfNxqaqrR6EG6zUI9qdNX1XVc
-Wfu70EZfaZ0Kx5jTDz4h7TGw59oH+NBDRpGvU213NFyckbcGav11GgLBCwR6Iyzx
-nFTrowWXR2QXfX8akSFg6Oz1k818Pjwolr1l3JF5YAaDxwJ4qZo/ldHSF4/+fAmC
-JLJfRco6ndv8rFr6FV0+SVv5dIhGBBMRAgAGBQI/uaDwAAoJEBD6TIilTaLfcHoA
-oOl0OsrJQ1JAgtyCXTs0VxJAXshnAKDXdDvK0ZevnovRoZvMW6RYv0+STYhGBBAR
-AgAGBQI/v6F3AAoJELK+vEAVKSSvF/8AnjieEHBnFWQQNrZtknhXQeyzkS9eAJ9U
-I6CHLstOQAIQj6dgQIfXS6oaHohGBBARAgAGBQI/v6OIAAoJEMEee0eWTzHZlWIA
-oLPh3TMdnARqbnzFpHQV0BN1Y+53AKDm7WOQM+PUUOcXrlYw63CVC9QPP4hGBBAR
-AgAGBQI/u6D5AAoJEKRZJPC2tF8fWigAoMOg9N7DfgZCaMDH/uiZPeVDYLx1AKD4
-H4Cv3wOrBC9gsfOz8vPc+psGu4hGBBIRAgAGBQI/uc+fAAoJELkkUqxMkWW2D0oA
-nilUs/fdruISz7OcUHSYoFb5lxxpAJ0SbzM82p96RMGjtMtLWdDNm3AKz4hGBBMR
-AgAGBQI/vcjeAAoJEL66K4f1/EtCILwAn2x9+QkXNkfTt5LEHmJAXXzkr2aFAJ9l
-vz17ctX04GyH0E2p7lMU9qJvWoiZBBIBAgAGBQI/ym6tAAoJED6Pt/L4g0HZKPED
-51Q8rmnCha+FQi8+42sTbBjWSkYmsB/84mjddFlK40AfmKpXNnF5lpHCPBfdtuG7
-/r3mnQrT/T5PBlWA088zyQhzBTsCNObNQE/5cwoKv2sOuWMZ/HW5JFYJgfQoqb4b
-hTkSy7d0ncIW4Rq+heZc/E8xWmUpQH1CrFzvB2bsiEYEExECAAYFAj/N+agACgkQ
-CVpF3KEdVvtdTwCgtbh65s6vDfxmgVqxdkqsi3Nak20AmgM7hfMHhUcn+Y8PAyYv
-0OrVvODkuQENBD90V4QQBACNBis1jev/dbIOmVHw096OO2p/R0tuXSx2q0wfjRtE
-qkBOBz/Wdr0gCTJMMOWAYlKhM3ZPbs3bcrT8HXYK5GCpvWQj5SGe2E/Mreolvl+i
-1U4GGhZVVDQziZdImmSDsqCHPj4s5KWJhnkSrE3asWennYqLAEuv62SF/rOawEfr
-2wADBQP9EmVJEG9mDpwj4SZ0kFbBbbqc6t1ntRjx8PkW49znU0NOCM2lIaOM3leM
-8bm5zgbnD4kS7gDItOwzPaHepLrh7a7OVUTpf/HxUgtLAjazF445mjKk1/KQ7oU5
-SR5j3nJZwaI6wTBoI94fk/BBZtxZ4EcdgcJhQABI9LoKr+vTa2eISQQYEQIACQUC
-P3RXhAIbDAAKCRATLknU5B7cfgWMAJ9w/IX0FwxyOhwCveM1PDrVWxT4dQCfaG22
-PDGaBFWsUIyQDUGS56dkC0k=
-=4pJn
------END PGP PUBLIC KEY BLOCK-----
-
-pub  1024D/320B4FB4 2004-12-05 Nick Lothian (Apache) <nlothian@apache.org>
-sig 3       320B4FB4 2004-12-05   Nick Lothian (Apache) <nlothian@apache.org>
-sub  1024g/5436F884 2004-12-05
-sig         320B4FB4 2004-12-05   Nick Lothian (Apache) <nlothian@apache.org>
-
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.2.5 (MingW32)
-
-mQGiBEGy7V4RBACHbTfwKP3tYgujjVlgIuH6O/kZAZkGr5BlK6t3aZxWxn1hnZUb
-u9fNdFK6TuVxLN8/clRHw6SqKjfFsFl0ximws9ArgvAZtOB7lAwI8Dun7cqLiQ92
-4h/FivOXumqsFmUNWLtbbyzlbbjOs6yuUTUMn94X+sjR1BdJ61jHsX27HwCg+gYJ
-C8sC9azTSP520s+QDIqqqC0D/0Ixw9E1ioTREC+DKTl0Yc67NttrRja860eyJ5gW
-3EbADK57jaHUJbUpGkuJhGKnNlCbE4Zg+j//kTKU8RdO/DO9h61MfIAjSjAlI880
-I4GqQcVKN1cRwFCW1qiZHjqMxeDv+SUVuTde6ZmFT7pCpQGy3/vq3H/29ejkVnVn
-EmJsA/4vwczcvXfCt2j2hyq8p/70TO9fm/tWaPLfYZ9s61M2wCXT5414L+K/KS+L
-+ucXCNumVQSMmsAg4rCS9vE+WPxaT/KqvDyEeSpfNA9KK0tgL2pAT+J/ikDqmiFV
-SSwYLdFfmKpfhL1OUHoInmFzhJB0sKFJ2xPY2B5WyKXSPRGUerQrTmljayBMb3Ro
-aWFuIChBcGFjaGUpIDxubG90aGlhbkBhcGFjaGUub3JnPoheBBMRAgAeBQJBsu1e
-AhsDBgsJCAcDAgMVAgMDFgIBAh4BAheAAAoJEJIfsKkyC0+0c6cAoOP9ObcM2kMD
-iEFWoW9btpC6+6RNAJ9fls4oHGsbY63s2NDPe0jMTMGrC7kBDQRBsu1fEAQAg1ys
-XC9D+Gyh33sxe4CD/lQGi0EeFMmsoKB9ZGsKy3BOy9bkYq6QFP4K1+ylYoiQ6Tb3
-BN2IiFqzP2MO8rLq1Gh7XFzbXEidj1xe9kXct5KAE8DnkQ7WTsqj9hpuae1Ipd3P
-dMaAnmGz38pEPezXrR5sUJQF9bg7q7XUWDmZ1HcAAwUD/jl89B8FOXDaNIl/Fb1S
-Kb3DQxbRJ2wQlbXi/td61sS9rznnv4bo2CoJ/Du5EYUoM4QDfj0Q/6eLEMSvz2VI
-b66kU2nLK7ERgk6I8be0ODpeU0XNMtFly7kg51uAhDg9Z0j+sFzbWRCr+zY2NUoo
-hRIdPJ55WPTQBZWaEBCikeEHiEkEGBECAAkFAkGy7V8CGwwACgkQkh+wqTILT7To
-AgCeIYQjWxrjd4c2jsB/ytfDVBBJZiUAn2LByyqYsMAQQVRyJaWF1E8b4TD4
-=Z3c0
------END PGP PUBLIC KEY BLOCK-----
-pub   1024D/DD4200EA 2004-11-02
-uid                  David H. DeWolf <david@daviddewolf.com>
-sig 3        DD4200EA 2004-11-02  David H. DeWolf <david@daviddewolf.com>
-uid                  David H. DeWolf <ddewolf@apache.org>
-sig 3        DD4200EA 2004-11-02  David H. DeWolf <david@daviddewolf.com>
-uid                  David H. DeWolf <ddewolf@rocketmail.com>
-sig 3        DD4200EA 2004-11-02  David H. DeWolf <david@daviddewolf.com>
-uid                  David H. DeWolf <ddewolf@gmail.com>
-sig 3        DD4200EA 2004-11-02  David H. DeWolf <david@daviddewolf.com>
-uid                  David H. DeWolf <david.dewolf@digitalfocus.com>
-sig 3        DD4200EA 2005-06-25  David H. DeWolf <david@daviddewolf.com>
-sub   1024g/F7DE5A9C 2004-11-02
-sig          DD4200EA 2004-11-02  David H. DeWolf <david@daviddewolf.com>
-
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.0 (Cygwin)
-
-mQGiBEGHzhMRBACVBP2u+rePvFsGWoSnlpbXUJO3EyEHSlRKNeu+5MMLp2tYpP6k
-zM9zBFNHf0elbA8KESVkv6D6/YilYfogxvw+dgVy2sFsSDDxplaIOEumX783aiGS
-fYi7KM3W61co2g9RlKZm8Ho8ZVV0WoTD2L/OPKm1PRvlqM6eh6Pmr5fZhwCg88ZE
-jjtjg92j77t/ciZZ9a6YKrcD/0RDdIQl408krXfbCLK6AQXnzu5mJUjWit0HCtXr
-cN2UsAwX1KAANNV54N0IxxBWw1CpUIolIhZBpgE8Se5hNU90sTvvGjieWkiL1rET
-SolKIJT+cqzf6C9dzIydxuR2X+W6l6IKlytk0AYwaup9scAij0Zexx1qxHxjxylU
-Ief9A/9+lVQZ7Wd04Ul6/Wt+tcguP5OIr6fWVoD7+xRH5JtBGurUsm7eRsky65SJ
-OkNxJYsfXR4g7LygCMBZSG/nAx5Eus+Ah4mEHgHJ0h+AZOCY1EDs4K3LN47AkW/D
-+vRbvfvMmh7J1pizubwyo0iyYniraQNI1zCWWrEereB/L3S9FLQnRGF2aWQgSC4g
-RGVXb2xmIDxkYXZpZEBkYXZpZGRld29sZi5jb20+iGEEExECACECGwMGCwkIBwMC
-AxUCAwMWAgECHgECF4AFAkGH1CgCGQEACgkQshdj+t1CAOrZygCgj41mE/x1iVew
-oqXBWdCTA+GYjX4AnRVodDBzkWCndt9n7HfNCL1nFL4vtCREYXZpZCBILiBEZVdv
-bGYgPGRkZXdvbGZAYXBhY2hlLm9yZz6IXgQTEQIAHgIbAwYLCQgHAwIDFQIDAxYC
-AQIeAQIXgAUCQYfUJgAKCRCyF2P63UIA6g9lAJ4i2NY+zD4bxJi0h2EpNkO+rgVF
-/ACgmL2VgAi8/lU8LXQDrLO3F30nrKi0KERhdmlkIEguIERlV29sZiA8ZGRld29s
-ZkByb2NrZXRtYWlsLmNvbT6IXgQTEQIAHgUCQYfSHwIbAwYLCQgHAwIDFQIDAxYC
-AQIeAQIXgAAKCRCyF2P63UIA6gEiAKCU58ktQAUGOMwpJXluG95mhhrCIwCg6bFe
-atZ5JvPoJwwiXBmbbZC3Oeq0I0RhdmlkIEguIERlV29sZiA8ZGRld29sZkBnbWFp
-bC5jb20+iF4EExECAB4FAkGH0jwCGwMGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQ
-shdj+t1CAOqIRACgxA80v9zy9y+Aco3UNsC9DLHkwJ0AnRJPuPkt89NE/opcbgNH
-uI3+ylFbtC9EYXZpZCBILiBEZVdvbGYgPGRhdmlkLmRld29sZkBkaWdpdGFsZm9j
-dXMuY29tPoheBBMRAgAeBQJCvLVHAhsDBgsJCAcDAgMVAgMDFgIBAh4BAheAAAoJ
-ELIXY/rdQgDqCyAAmwf4gVzRpTaAFoSYp6ZmDAR8Qt5JAKCYMvybti9CFzYsa96D
-P7G0aRuxxLkBDQRBh84TEAQA6zybsVGREjBQ+wKLT764hWjR7SkBaIjYLZJHUOwl
-6TNXhl9302lT+DeQAQXeBGUIg79QR/JHjLL5MoMHeQ+xPbY/EtrlGL9O67Nn/gtq
-AqLjlGEwlKBhae9A3bzxViKEHyi2X9Qtib+lgW3jsJta33ifgGC8TWNSxCrBGnPb
-6pMAAwYEAM54Z0pEX7SnW38QomN6qn+JrJ5Kp5R3A2QCkeqTWuykTHZbI4I3vO2q
-TXiHVI8Rz0soAEFLMr+95SnpInf0jm/gBPBaKHS2DHcLMqLZvut3TH8Vs50pBlP3
-KnWqi9xqaJq2TwgWCNh1RFydcd+aC3bCHTNWq9M7B2sxM6hNaEkkiEkEGBECAAkF
-AkGHzhMCGwwACgkQshdj+t1CAOph4gCgpxV7iVMhaAHYaGFWT9m/opl9b+UAnRWl
-X5guSzlwPBtoCQ0rjtIIHGiL
-=k+ts
------END PGP PUBLIC KEY BLOCK-----
-pub   1024D/917DD857 2006-04-27
-uid                  Craig Doremus <cdoremus@apache.org>
-sig 3        917DD857 2006-04-27  Craig Doremus <cdoremus@apache.org>
-sub   2048g/5AA44BC4 2006-04-27
-sig          917DD857 2006-04-27  Craig Doremus <cdoremus@apache.org>
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.3 (MingW32)
-
-mQGiBERRLT0RBAD6viO/WGm7UJ1yh/ZiGw1DeG2KXU0BKcIoXSFl/bfwkmB3/Vim
-096aUU2Q/TvWjKqrdM9WJ8RGcmzGZWmZRaLff+fLSz8Qj3o+65a0OE899KD5okpW
-6lEA7j8gniKbm0lN25tQt6j+9LLDJlzuk4ywxWvf7sH7cWZcKfHR5wsF2wCglIZK
-ev3TIrWciMIQcHc5dbukVAcEAMnj3rUVnNyBQ3nmwxbQ8tMEdNnYyTbXQAKuwzwT
-dWOiZE9ggS4N3hkgcVRlm0Eat6kLlNa9IikaVn8Oe1jt8W+O33lSIuyFyA/lznkh
-3UlIeC3qI9jp8/WjFGKORLG3xu3Xdk0JcXRroPBQHJH1Xm0dcei/z3PDem5xgX9x
-ywDLA/4hde+KTPVin/smXSh98ZmqEjKpcvpfWp5SW5Sg86YdEZyyADIQJDl4+E5g
-s7FryP6GvdO8krFvAmG55kPJV3BB5vplHCSe9suI/VB5ssp6+RTf7Ll7s/fqYojC
-7hXt539vkiXd6XP0s52C9eOWmIcezGwKudezC7K/pvrSOBAE8rQjQ3JhaWcgRG9y
-ZW11cyA8Y2RvcmVtdXNAYXBhY2hlLm9yZz6IYAQTEQIAIAUCRFEtPQIbAwYLCQgH
-AwIEFQIIAwQWAgMBAh4BAheAAAoJEFA40leRfdhX1f4An0d3MutZ47VR3/1hmY41
-mCdas3OWAJ9kqHzA70Q6dE/ZmbllFbpjAQG1ibkCDQREUS1MEAgAxfMGzTD5bs8w
-3lL5b8lmEd3iga3aGjzAn04QGyrZy475cKum5hBLY1lzfRW10nTudIunFe/fNauG
-/BrKrcQD2ebzXW5VWgG39oaoP219PJXCfCKNcg6ZcbxlBFmKcCmpHoyYJpkO3uup
-tL3LQpozNw+Bz48g8X3AMxRVJlqK2wdp6DR9MAifevVi7NdMhjdLrM4In9t72fTD
-+hwUKAIOThxIgQlHOamNzxHKGS8RLxhAhK1O+yV1T254a3z/y3vwZkZrobcBq4pf
-MpK2IZdLpoO+9CDklpxUXS9Pk/sBiHgsI9Ik14aETs2xOiB6fxPbtKJAYHdF0G1i
-5kfGOBbjYwADBQf9HLe+NdU0C/AgueHlQPYTJfTQGNeHyMczefYzPepQkPSNVWGS
-vg9QDXCbdbvDaYTD0Qostuojhvs89UXpCwY3K33xwzkczTZWnbfAiehjTH6ClufD
-c8DQ69Mw+xgF38UbmezY13jpBNmk/nkiL5Nxq5Bd3bc9+40WY+ahqJ5Dzvv6cZ0d
-/USXmEd0lDn8Z0ArNqdruzqmWlsRQnUHfUQw1O+ZXQJj07WwKxQ1EWsPKMHsUCnh
-PyK5fxiQP/WNwC7EAKTpSjOJBGz05SdXpw6Du9ZhUHYVNk8GaCGGBJoR1gaOggmH
-gTtg+IbEjbg1RZGqr/NYPHkXfx3gVqA1HhTkxIhJBBgRAgAJBQJEUS1MAhsMAAoJ
-EFA40leRfdhX36YAn271wqmQdnwlsVg1U6IolfNT9PiTAKCPVWyr211pg1I+CBKX
-BphAwkntjw==
-=1L2C
------END PGP PUBLIC KEY BLOCK-----
diff --git a/trunk/LICENSE b/trunk/LICENSE
deleted file mode 100644
index 29f81d8..0000000
--- a/trunk/LICENSE
+++ /dev/null
@@ -1,201 +0,0 @@
-                                 Apache License

-                           Version 2.0, January 2004

-                        http://www.apache.org/licenses/

-

-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

-

-   1. Definitions.

-

-      "License" shall mean the terms and conditions for use, reproduction,

-      and distribution as defined by Sections 1 through 9 of this document.

-

-      "Licensor" shall mean the copyright owner or entity authorized by

-      the copyright owner that is granting the License.

-

-      "Legal Entity" shall mean the union of the acting entity and all

-      other entities that control, are controlled by, or are under common

-      control with that entity. For the purposes of this definition,

-      "control" means (i) the power, direct or indirect, to cause the

-      direction or management of such entity, whether by contract or

-      otherwise, or (ii) ownership of fifty percent (50%) or more of the

-      outstanding shares, or (iii) beneficial ownership of such entity.

-

-      "You" (or "Your") shall mean an individual or Legal Entity

-      exercising permissions granted by this License.

-

-      "Source" form shall mean the preferred form for making modifications,

-      including but not limited to software source code, documentation

-      source, and configuration files.

-

-      "Object" form shall mean any form resulting from mechanical

-      transformation or translation of a Source form, including but

-      not limited to compiled object code, generated documentation,

-      and conversions to other media types.

-

-      "Work" shall mean the work of authorship, whether in Source or

-      Object form, made available under the License, as indicated by a

-      copyright notice that is included in or attached to the work

-      (an example is provided in the Appendix below).

-

-      "Derivative Works" shall mean any work, whether in Source or Object

-      form, that is based on (or derived from) the Work and for which the

-      editorial revisions, annotations, elaborations, or other modifications

-      represent, as a whole, an original work of authorship. For the purposes

-      of this License, Derivative Works shall not include works that remain

-      separable from, or merely link (or bind by name) to the interfaces of,

-      the Work and Derivative Works thereof.

-

-      "Contribution" shall mean any work of authorship, including

-      the original version of the Work and any modifications or additions

-      to that Work or Derivative Works thereof, that is intentionally

-      submitted to Licensor for inclusion in the Work by the copyright owner

-      or by an individual or Legal Entity authorized to submit on behalf of

-      the copyright owner. For the purposes of this definition, "submitted"

-      means any form of electronic, verbal, or written communication sent

-      to the Licensor or its representatives, including but not limited to

-      communication on electronic mailing lists, source code control systems,

-      and issue tracking systems that are managed by, or on behalf of, the

-      Licensor for the purpose of discussing and improving the Work, but

-      excluding communication that is conspicuously marked or otherwise

-      designated in writing by the copyright owner as "Not a Contribution."

-

-      "Contributor" shall mean Licensor and any individual or Legal Entity

-      on behalf of whom a Contribution has been received by Licensor and

-      subsequently incorporated within the Work.

-

-   2. Grant of Copyright License. Subject to the terms and conditions of

-      this License, each Contributor hereby grants to You a perpetual,

-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable

-      copyright license to reproduce, prepare Derivative Works of,

-      publicly display, publicly perform, sublicense, and distribute the

-      Work and such Derivative Works in Source or Object form.

-

-   3. Grant of Patent License. Subject to the terms and conditions of

-      this License, each Contributor hereby grants to You a perpetual,

-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable

-      (except as stated in this section) patent license to make, have made,

-      use, offer to sell, sell, import, and otherwise transfer the Work,

-      where such license applies only to those patent claims licensable

-      by such Contributor that are necessarily infringed by their

-      Contribution(s) alone or by combination of their Contribution(s)

-      with the Work to which such Contribution(s) was submitted. If You

-      institute patent litigation against any entity (including a

-      cross-claim or counterclaim in a lawsuit) alleging that the Work

-      or a Contribution incorporated within the Work constitutes direct

-      or contributory patent infringement, then any patent licenses

-      granted to You under this License for that Work shall terminate

-      as of the date such litigation is filed.

-

-   4. Redistribution. You may reproduce and distribute copies of the

-      Work or Derivative Works thereof in any medium, with or without

-      modifications, and in Source or Object form, provided that You

-      meet the following conditions:

-

-      (a) You must give any other recipients of the Work or

-          Derivative Works a copy of this License; and

-

-      (b) You must cause any modified files to carry prominent notices

-          stating that You changed the files; and

-

-      (c) You must retain, in the Source form of any Derivative Works

-          that You distribute, all copyright, patent, trademark, and

-          attribution notices from the Source form of the Work,

-          excluding those notices that do not pertain to any part of

-          the Derivative Works; and

-

-      (d) If the Work includes a "NOTICE" text file as part of its

-          distribution, then any Derivative Works that You distribute must

-          include a readable copy of the attribution notices contained

-          within such NOTICE file, excluding those notices that do not

-          pertain to any part of the Derivative Works, in at least one

-          of the following places: within a NOTICE text file distributed

-          as part of the Derivative Works; within the Source form or

-          documentation, if provided along with the Derivative Works; or,

-          within a display generated by the Derivative Works, if and

-          wherever such third-party notices normally appear. The contents

-          of the NOTICE file are for informational purposes only and

-          do not modify the License. You may add Your own attribution

-          notices within Derivative Works that You distribute, alongside

-          or as an addendum to the NOTICE text from the Work, provided

-          that such additional attribution notices cannot be construed

-          as modifying the License.

-

-      You may add Your own copyright statement to Your modifications and

-      may provide additional or different license terms and conditions

-      for use, reproduction, or distribution of Your modifications, or

-      for any such Derivative Works as a whole, provided Your use,

-      reproduction, and distribution of the Work otherwise complies with

-      the conditions stated in this License.

-

-   5. Submission of Contributions. Unless You explicitly state otherwise,

-      any Contribution intentionally submitted for inclusion in the Work

-      by You to the Licensor shall be under the terms and conditions of

-      this License, without any additional terms or conditions.

-      Notwithstanding the above, nothing herein shall supersede or modify

-      the terms of any separate license agreement you may have executed

-      with Licensor regarding such Contributions.

-

-   6. Trademarks. This License does not grant permission to use the trade

-      names, trademarks, service marks, or product names of the Licensor,

-      except as required for reasonable and customary use in describing the

-      origin of the Work and reproducing the content of the NOTICE file.

-

-   7. Disclaimer of Warranty. Unless required by applicable law or

-      agreed to in writing, Licensor provides the Work (and each

-      Contributor provides its Contributions) on an "AS IS" BASIS,

-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or

-      implied, including, without limitation, any warranties or conditions

-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A

-      PARTICULAR PURPOSE. You are solely responsible for determining the

-      appropriateness of using or redistributing the Work and assume any

-      risks associated with Your exercise of permissions under this License.

-

-   8. Limitation of Liability. In no event and under no legal theory,

-      whether in tort (including negligence), contract, or otherwise,

-      unless required by applicable law (such as deliberate and grossly

-      negligent acts) or agreed to in writing, shall any Contributor be

-      liable to You for damages, including any direct, indirect, special,

-      incidental, or consequential damages of any character arising as a

-      result of this License or out of the use or inability to use the

-      Work (including but not limited to damages for loss of goodwill,

-      work stoppage, computer failure or malfunction, or any and all

-      other commercial damages or losses), even if such Contributor

-      has been advised of the possibility of such damages.

-

-   9. Accepting Warranty or Additional Liability. While redistributing

-      the Work or Derivative Works thereof, You may choose to offer,

-      and charge a fee for, acceptance of support, warranty, indemnity,

-      or other liability obligations and/or rights consistent with this

-      License. However, in accepting such obligations, You may act only

-      on Your own behalf and on Your sole responsibility, not on behalf

-      of any other Contributor, and only if You agree to indemnify,

-      defend, and hold each Contributor harmless for any liability

-      incurred by, or claims asserted against, such Contributor by reason

-      of your accepting any such warranty or additional liability.

-

-   END OF TERMS AND CONDITIONS

-

-   APPENDIX: How to apply the Apache License to your work.

-

-      To apply the Apache License to your work, attach the following

-      boilerplate notice, with the fields enclosed by brackets "[]"

-      replaced with your own identifying information. (Don't include

-      the brackets!)  The text should be enclosed in the appropriate

-      comment syntax for the file format. We also recommend that a

-      file or class name and description of purpose be included on the

-      same "printed page" as the copyright notice for easier

-      identification within third-party archives.

-

-   Copyright [yyyy] [name of copyright owner]

-

-   Licensed under the Apache License, Version 2.0 (the "License");

-   you may not use this file except in compliance with the License.

-   You may obtain a copy of the License at

-

-       http://www.apache.org/licenses/LICENSE-2.0

-

-   Unless required by applicable law or agreed to in writing, software

-   distributed under the License is distributed on an "AS IS" BASIS,

-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-   See the License for the specific language governing permissions and

-   limitations under the License.

diff --git a/trunk/README b/trunk/README
deleted file mode 100644
index 4b141ee..0000000
--- a/trunk/README
+++ /dev/null
@@ -1,90 +0,0 @@
-#  Copyright 2006 The Apache Software Foundation

-#

-#  Licensed under the Apache License, Version 2.0 (the "License");

-#  you may not use this file except in compliance with the License.

-#  You may obtain a copy of the License at

-#

-#      http://www.apache.org/licenses/LICENSE-2.0

-#

-#  Unless required by applicable law or agreed to in writing, software

-#  distributed under the License is distributed on an "AS IS" BASIS,

-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-#  See the License for the specific language governing permissions and

-#  limitations under the License

-

-README for Pluto 1.1-beta2

-

-To run the Pluto Portal Driver deployed in Tomcat 5.5.17:

-1. Unzip the binary distribution into a directory.

-	a. <PLUTO-HOME> will be the pluto-1.1.0-beta2 subdirectory.

-2. Execute startup.bat (Windows) or startup.sh (Unix)

-in <PLUTO-HOME>/bin.

-	a. Use shutdown.bat/shutdown.sh to stop the portal

-3. Browse to http://localhost:8080/pluto/portal

-4. Login as tomcat user (password=tomcat).

-

-For information on deploying portlets, building the portal from source

- and for the most up to date documentation please go to: 

-  http://portals.apache.org/pluto

-  

-***********************************************************

-* RELEASE NOTES: 1.1.0-beta2 Sept 26, 2006                *

-***********************************************************

-* Fixed or Resolved Issues                                *

-***********************************************************

-** Bug ****************************************************

- PLUTO-191  Dynamic Inclusion of dependencies in Maven Plugin

- PLUTO-232  Maximize window state does not work properly

- PLUTO-233  Exception thrown if edit or help mode is not supported by portlet

- PLUTO-242  Portlet session is invalidated when maxInactiveInterval < 0

- PLUTO-243  PortalURLParser drops '/' characters when building render path

- PLUTO-245  Parsing of portlet.xml strips space from init-param values

- PLUTO-246  PortalURLParser should URLEncode query string parameters 

- PLUTO-248  PortalUrlParser should encode '#' character

- PLUTO-251  Pluto fails when navigating between pages using the drop-downs

- PLUTO-254  NPE in PortalDriverServlet when requesting a resource that doesn't exist 

-***********************************************************

-

-** New Feature ********************************************

- PLUTO-214  Add logout link to portal page.

- PLUTO-255   Seperate portal-driver into portal-driver-api and portal-driver-impl

-***********************************************************

-***********************************************************

-

-***********************************************************

-***********************************************************

-* Open Issues                                             *

-***********************************************************

-

-** Bug ****************************************************

- PLUTO-124  POST Data gets truncated due to internal redirect by pluto

- PLUTO-122  Portlet Preferences need to be user specific

- PLUTO-257  Pluto 1.1 plugin for the deployment of custom portlets does not work

- PLUTO-200  Missing Resource Exception from PortletConfig.getResourceBundle

- PLUTO-234  Session Timeout Test in testsuite fails

-***********************************************************

-    

-** New Feature ********************************************

- PLUTO-215  Create admin portlet for Pluto portal driver

- PLUTO-252  Custom Tags with response.encodeUrl( url ) and Render hidden portlet mode.

- PLUTO-38   user profile attribute support

- PLUTO-186  ToolTips to Portlet Controls

-***********************************************************

-    

-** Improvement ********************************************

- PLUTO-204  Add spec PLT number to TestResult in portlet tests

- PLUTO-247  PortalURLParser: Avoid putting '?' and '&' characters in query string if unnecessary

-***********************************************************

-    

-** Task ***************************************************

- PLUTO-218  [1.1] Script to package source release

- PLUTO-217  [1.1] Script to package binary release

-***********************************************************

-

-** Test ***************************************************

- PLUTO-206  Improve pluto-testsuite to test more aspects

-***********************************************************

-    

-** Wish ***************************************************

- PLUTO-153  Jetty Deployment Support

-***********************************************************
\ No newline at end of file
diff --git a/trunk/dist-build.xml b/trunk/dist-build.xml
deleted file mode 100644
index 5571f85..0000000
--- a/trunk/dist-build.xml
+++ /dev/null
@@ -1,196 +0,0 @@
-<!--

-  Copyright 2005-2006 The Apache Software Foundation

-

-  Licensed under the Apache License, Version 2.0 (the "License");

-  you may not use this file except in compliance with the License.

-  You may obtain a copy of the License at

-

-      http://www.apache.org/licenses/LICENSE-2.0

-

-  Unless required by applicable law or agreed to in writing, software

-  distributed under the License is distributed on an "AS IS" BASIS,

-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-  See the License for the specific language governing permissions and

-  limitations under the License.

--->

-<!--

-	Builds a binary and source distribution of Pluto 1.1, bundling it into zip, gzip and bzip2 files.

-	

-	Run the binary build using the command line:

-		ant -f dist-build.xml

-				

-	The binary distribution is done in the following way:

-	1. Downloads Tomcat from Apache and unzips it into a working directory. To this distribution, the

-		build:

-		a. Adds emptySessionPath="true" to server.xml.

-		b. Adds a pluto user with pluto role to tomcat-users.xml.

-		c. Adds a pluto role to the tomcat user in tomcat-users.xml.

-	2. Runs 'mvn install' and 'mvn pluto:install' to create the	Pluto driver and testsuite 

-		and installs them into the Tomcat dist in the working directory.

-	3. Bundles up the altered Tomcat dist with Pluto into a zip, gzip and bzip2 file.

-	

-	Run the source build using the command line:

-		ant -f dist-build.xml src-dist	

-

-	All built distributions end up in target/dist.				

--->

-<project name="PlutoDistributions" default="bin-dist">

-

-	<property name="pluto.version" value="1.1.0-SNAPSHOT" description="Version of Pluto 1.1 to build"/>

-	<property name="tomcat.version" value="5.5.17" description="Version of Tomcat to deploy Pluto"/>

-

-	<property name="dist.basedir" value="target/dist" description="Base working directory"/>

-	<property name="base.name" value="apache-tomcat-${tomcat.version}"/>

-	<property name="dist.dir" value="${dist.basedir}/${base.name}"/>

-	<property name="pluto.name" value="pluto-${pluto.version}"/>

-	<property name="pluto.dir" value="${dist.basedir}/${pluto.name}"/>

-	<property name="unzip.file" value="${dist.basedir}/${base.name}.tar.gz"/>

-	<property name="tar.file" value="${dist.basedir}/${base.name}.tar"/>

-

-	<fileset dir="." id="src.fileset">

-		<include name="**/*"/>

-		<exclude name="**/*.class"/>

-		<exclude name="**/*.zip"/>

-		<exclude name="**/*.tar.gz"/>

-		<exclude name="**/*.tar.b2"/>

-		<exclude name="**/target/**/*"/>

-		<exclude name="**/.svn/*"/>

-		<exclude name="bin/**/*"/>

-		<exclude name=".classpath"/>

-		<exclude name=".project"/>

-	</fileset>					

-	

-	<target name="src-dist" depends="prepare-src-dist">

-		<zip destfile="${dist.basedir}/${pluto.name}-src.zip">

-			<zipfileset refid="src.fileset"/>							

-		</zip>

-

-		<antcall target="srctar-nocompress"/>

-		

-		<gzip src="${dist.basedir}/${pluto.name}-src.tar" 

-			destfile="${dist.basedir}/${pluto.name}-src.tar.gz"/>

-		

-		<bzip2 src="${dist.basedir}/${pluto.name}-src.tar" 

-			destfile="${dist.basedir}/${pluto.name}-src.tar.bz2"/>

-		

-		<antcall target="clean"/>	

-	</target>

-

-	<target name="srctar-nocompress" description="Creates tar source distributions">

-		<tar destfile="${dist.basedir}/${pluto.name}-src.tar">

-				<tarfileset dir="."> <!-- refid does not work -->

-					<include name="**/*"/>

-					<exclude name="**/*.class"/>

-					<exclude name="**/*.zip"/>

-					<exclude name="**/*.tar.gz"/>

-					<exclude name="**/*.tar.bz2"/>

-					<exclude name="**/target/**/*"/>

-					<exclude name="**/.svn/*"/>

-					<exclude name="bin/**/*"/>

-					<exclude name=".classpath"/>

-					<exclude name=".project"/>

-				</tarfileset>	

-		</tar>	

-	</target>

-

-	<target name="prepare-src-dist">

-		<mkdir dir="${dist.basedir}"/>		

-	</target>

-

-	<target name="bin-dist" depends="prepare-bin-dist,run-maven" description="Creates zip, gzip, and bzip2 distributions">

-		<!-- Copy over jars needed to deploy custom portlets -->

-		<copy file="pluto-util/target/pluto-util-${pluto.version}.jar" todir="${dist.dir}/PlutoDomain"/>			

-		<copy file="pluto-descriptor-api/target/pluto-descriptor-api-${pluto.version}.jar" todir="${dist.dir}/PlutoDomain"/>			

-		<copy file="pluto-descriptor-impl/target/pluto-descriptor-impl-${pluto.version}.jar" todir="${dist.dir}/PlutoDomain"/>			

-

-		<!-- Zip everything up -->

-		<zip destfile="${dist.basedir}/${pluto.name}-bin.zip">

-			<zipfileset prefix="${pluto.name}" dir="${dist.dir}" includes="**/*"/>

-		</zip>

-

-		<antcall target="tar-nocompress"/>

-		

-		<gzip src="${dist.basedir}/${pluto.name}-bin.tar" 

-			destfile="${dist.basedir}/${pluto.name}-bin.tar.gz"/>

-		

-		<bzip2 src="${dist.basedir}/${pluto.name}-bin.tar" 

-			destfile="${dist.basedir}/${pluto.name}-bin.tar.bz2"/>

-				

-		<antcall target="clean"/>	

-	</target>

-	

-	<target name="tar-nocompress" description="Creates tar binary distributions">

-		<tar destfile="${dist.basedir}/${pluto.name}-bin.tar">

-			<tarfileset prefix="${pluto.name}" dir="${dist.dir}" mode="755" username="pluto" group="pluto">

-		    	<include name="bin/*.sh"/>

-			</tarfileset>

-			<tarfileset prefix="${pluto.name}" dir="${dist.dir}" username="pluto" group="pluto">

-				<include name="**/*"/>

-				<exclude name="bin/*.sh"/>

-			</tarfileset>

-		</tar>		

-	</target>

-	

-	<target name="prepare-bin-dist">

-		<exec executable="mvn" vmlauncher="false" dir="${basedir}">

-			<arg line="clean:clean"/>

-		</exec>

-		<mkdir dir="${dist.basedir}"/>

-		

-		<get src="http://archive.apache.org/dist/tomcat/tomcat-5/v${tomcat.version}/bin/${base.name}.tar.gz"

-		     dest="${unzip.file}"

-		/>

-		

-		<gunzip src="${unzip.file}"

-			dest="${dist.basedir}"

-			description="Creates tar from tar.gz tomcat dist"

-		/>

-		

-		<untar src="${tar.file}"

-			dest="${dist.basedir}"

-			description="Untars tomcat dist"

-		/>		

-

-		<!-- Copy over README -->

-		<copy file="README" todir="${dist.dir}"/>

-

-		<!-- Add emptySessionPath="true" to Connector element in server.xml -->

-		<replace file="${dist.dir}/conf/server.xml"

-			token="connectionTimeout=&quot;20000&quot; disableUploadTimeout=&quot;true&quot; /&gt;" 

-			value="connectionTimeout=&quot;20000&quot; disableUploadTimeout=&quot;true&quot; emptySessionPath=&quot;true&quot; /&gt;" 

-			summary="true"

-		/>

-

-		<!-- Put tomcat user in 'pluto' role in tomcat-users.xml -->

-		<replace file="${dist.dir}/conf/tomcat-users.xml"

-			token="roles=&quot;tomcat&quot;" 

-			value="roles=&quot;tomcat,pluto&quot;" 

-			summary="true"

-		/>

-		

-		<!-- Add 'pluto' user to tomcat-users.xml -->

-		<replace file="${dist.dir}/conf/tomcat-users.xml"

-			token="&lt;/tomcat-users&gt;" 

-			value="&lt;user name=&quot;pluto&quot; password=&quot;pluto&quot; roles=&quot;pluto&quot; /&gt;${line.separator}&lt;/tomcat-users&gt;" 

-			summary="true"

-		/>

-	</target>

-

-	<target name="run-maven" description="Runs maven2 goals">

-		<exec executable="mvn" vmlauncher="false" dir="${basedir}">

-			<arg line="install"/>

-		</exec>

-		<exec executable="mvn" vmlauncher="false" dir="${basedir}">

-			<arg line="pluto:install -DinstallDir=${user.dir}/${dist.dir}"/>

-		</exec>

-	</target>

-		

-	<target name="clean">

-		<delete dir="${dist.dir}"/>

-		<delete file="${unzip.file}"/>	

-		<delete file="${tar.file}"/>	

-   	    <delete file="${dist.basedir}/${pluto.name}-src.tar"/>

-   	    <delete file="${dist.basedir}/${pluto.name}-bin.tar"/>

-	</target>

-

-</project>

diff --git a/trunk/maven-pluto-plugin/pom.xml b/trunk/maven-pluto-plugin/pom.xml
deleted file mode 100644
index d275d92..0000000
--- a/trunk/maven-pluto-plugin/pom.xml
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<!--

-  Copyright 2005-2006 The Apache Software Foundation

-

-  Licensed under the Apache License, Version 2.0 (the "License");

-  you may not use this file except in compliance with the License.

-  You may obtain a copy of the License at

-

-      http://www.apache.org/licenses/LICENSE-2.0

-

-  Unless required by applicable law or agreed to in writing, software

-  distributed under the License is distributed on an "AS IS" BASIS,

-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-  See the License for the specific language governing permissions and

-  limitations under the License.

--->

-<project xmlns="http://maven.apache.org/POM/4.0.0"

-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

-  

-  <parent>

-    <groupId>org.apache.pluto</groupId>

-    <artifactId>pluto</artifactId>

-    <version>1.1.0-SNAPSHOT</version>

-  </parent>

-  <modelVersion>4.0.0</modelVersion>

-  <artifactId>maven-pluto-plugin</artifactId> 

-  <packaging>maven-plugin</packaging>

-  <name>Maven Pluto Installer Plugin</name>

-  

-  <dependencies>

-    <dependency>

-      <groupId>org.apache.pluto</groupId>

-      <artifactId>pluto-util</artifactId>

-      <version>${pom.version}</version>

-      <scope>compile</scope>

-    </dependency>

-    <dependency>

-      <groupId>org.apache.maven</groupId>

-      <artifactId>maven-core</artifactId>

-      <version>${maven.version}</version>

-    </dependency>

-    <dependency>

-      <groupId>org.apache.maven</groupId>

-      <artifactId>maven-artifact</artifactId>

-      <version>${maven.version}</version>

-    </dependency>

-    <dependency>

-      <groupId>org.apache.maven</groupId>

-      <artifactId>maven-model</artifactId>

-      <version>${maven.version}</version>

-    </dependency>

-    <dependency>

-      <groupId>org.apache.maven</groupId>

-      <artifactId>maven-project</artifactId>

-      <version>${maven.version}</version>

-    </dependency>

-    <dependency>

-      <groupId>org.apache.maven</groupId>

-      <artifactId>maven-plugin-api</artifactId>

-      <version>${maven.version}</version>

-    </dependency>

-    

-    <!-- Do not remove this dep: See MNG-1178 -->

-    <dependency>

-      <groupId>junit</groupId>

-      <artifactId>junit</artifactId>

-      <version>${junit.version}</version>

-      <scope>test</scope>

-    </dependency>

-    

-  </dependencies>

-  

-  <build> 

-    <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>    

-    <resources>

-      <resource>

-        <directory>src/main/scripts</directory>

-        <includes>

-          <include>**/*.mmld</include>

-        </includes>

-      </resource>

-      <resource>
-        <directory>src/main/resources</directory>        

-        <filtering>true</filtering>

-      </resource>

-    </resources>

-    <plugins>

-      <plugin>

-        <artifactId>maven-site-plugin</artifactId>

-        <configuration>

-          <resourcesDirectory>${basedir}/../pluto-site/src/site/resources</resourcesDirectory>

-        </configuration>

-      </plugin>

-      <plugin>

-        <artifactId>maven-plugin-plugin</artifactId>        

-        <configuration>

-          <goalPrefix>pluto</goalPrefix>

-        </configuration>

-      </plugin>

-    </plugins>

-  </build>

-  

-</project>

-

-

-

diff --git a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractManagementMojo.java b/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractManagementMojo.java
deleted file mode 100644
index 83c6fd8..0000000
--- a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractManagementMojo.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.maven;

-

-import org.apache.maven.artifact.factory.ArtifactFactory;

-import org.apache.maven.artifact.Artifact;

-import org.apache.maven.artifact.repository.ArtifactRepository;

-import org.apache.maven.artifact.resolver.ArtifactResolver;

-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;

-import org.apache.maven.artifact.resolver.ArtifactResolutionException;

-import org.apache.maven.plugin.MojoExecutionException;

-import org.apache.pluto.util.install.ServerConfig;

-import org.apache.pluto.util.install.InstallationConfig;

-import org.apache.pluto.util.install.PortalInstallerFactory;

-import org.apache.pluto.util.install.PortalInstaller;

-

-import java.io.File;

-import java.util.ArrayList;

-import java.util.List;

-import java.util.Iterator;

-import java.util.Collection;

-import java.util.Map;

-import java.util.HashMap;

-

-/**

- * Abstract Mojo for installation tasks.

- *

- * @since 07/29/2005

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- */

-public abstract class AbstractManagementMojo extends AbstractPlutoMojo {

-

-    /**

-     * @parameter expression="${domain}"

-     */

-    protected String domain = "PlutoDomain";

-

-    /**

-     * @parameter expression="${server}"

-     */

-    protected String server = "PlutoServer";

-

-    /**

-     * @parameter expression="${host}"

-     */

-    protected String host = "localhost";

-

-    /**

-     * @parameter expression="${port}"

-     */

-    protected int port;

-

-    /**

-     * @component

-     */

-    protected ArtifactFactory artifactFactory;

-

-    /**

-     * @component

-     */

-    protected ArtifactResolver artifactResolver;

-

-    /**

-     * @parameter expression="${localRepository}

-     */

-    protected ArtifactRepository artifactRepository;

-

-    /**

-     * @parameter expression="${project.remoteArtifactRepositories}"

-     */

-    protected List remoteRepositories;

-

-    /**

-     * @parameter expression="${ctx}" default-value="pluto"

-     *

-     */

-    protected String portalContext;

-

-    /**

-     * @parameter expression="${pom.currentVersion} default="1.0-SNAPSHOT"

-     */

-    protected String version;

-

-    /**

-     *  at parameter expression="${portletApps}"

-     */

-    protected Map portletApps = new HashMap();

-

-    protected AbstractManagementMojo() {

-    	// Do nothing.

-    }

-

-    protected List getSharedDependencies() throws ArtifactNotFoundException, ArtifactResolutionException {

-       return getDependencies(InstallationDependency.getSharedDependencies());

-    }

-

-    protected List getEndorsedDependencies() throws ArtifactNotFoundException, ArtifactResolutionException {

-       return getDependencies(InstallationDependency.getEndorsedDependencies());

-    }

-

-    private List getDependencies(Collection artifacts) throws ArtifactNotFoundException, ArtifactResolutionException {

-        List list = new ArrayList();

-        Iterator it = artifacts.iterator();

-        while(it.hasNext()) {

-            InstallationDependency dep = (InstallationDependency)it.next();

-            Artifact artifact = artifactFactory.createArtifactWithClassifier(

-                    dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), dep.getType(), null

-            );

-

-            artifactResolver.resolve(artifact, remoteRepositories, artifactRepository);

-            if(artifact.getFile() == null) {

-                getLog().warn("Unable to find file for artifact: "+artifact.getArtifactId());

-            }

-

-            list.add(artifact.getFile());

-        }

-        return list;

-    }

-

-    protected ServerConfig getServerConfig() {

-        ServerConfig config = new ServerConfig();

-        config.setDomain(domain);

-        config.setHost(host);

-        config.setPort(port);

-        config.setServer(server);

-        return config;

-    }

-

-    protected PortalInstaller getHandler() {

-        return PortalInstallerFactory.getAppServerHandler(installationDirectory);

-    }

-

-    protected InstallationConfig createInstallationConfig() throws ArtifactNotFoundException, ArtifactResolutionException {

-        InstallationConfig config = new InstallationConfig();

-        config.setInstallationDirectory(installationDirectory);

-        config.setPortalContextPath(portalContext);

-        config.setPortalApplication(getPortalApplication());

-        config.setPortletApplications(getPortletApplications());

-        config.setEndorsedDependencies(getEndorsedDependencies());

-        config.setSharedDependencies(getSharedDependencies());

-        config.setServerConfig(getServerConfig());

-        return config;

-    }

-

-    private File getPortalApplication() throws ArtifactNotFoundException, ArtifactResolutionException  {

-        InstallationDependency dep = InstallationDependency.PORTAL;

-        Artifact artifact = artifactFactory.createBuildArtifact(

-           dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), dep.getType()

-        );

-        artifactResolver.resolve(artifact, remoteRepositories, artifactRepository);

-        return artifact.getFile();

-    }

-

-    private Map getPortletApplications() throws ArtifactNotFoundException, ArtifactResolutionException {

-        Map files = new HashMap();

-        InstallationDependency dep = InstallationDependency.TESTSUITE;

-        Artifact artifact = artifactFactory.createBuildArtifact(

-                dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), dep.getType()

-        );

-        artifactResolver.resolve(artifact, remoteRepositories, artifactRepository);

-

-        files.put("testsuite", artifact.getFile());

-        /*

-        Iterator apps = portletApps.iterator();

-        while(apps.hasNext()) {

-            //files.add(artifactFactory.createBuildArtifact(

-            //    InstallMojo.GROUP_ID, apps.next().toString(), version, "war"

-            //).getFile());

-        }

-        */

-        return files;

-    }

-

-    protected void doValidate() throws Exception {

-        if(installationDirectory == null || !installationDirectory.exists()) {

-            throw new MojoExecutionException("A valid installation directory must be provided in order to install pluto.");

-

-        }

-    }

-}

diff --git a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractPlutoMojo.java b/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractPlutoMojo.java
deleted file mode 100644
index 336fa9a..0000000
--- a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractPlutoMojo.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.maven;

-

-import org.apache.maven.plugin.AbstractMojo;

-import org.apache.maven.plugin.MojoExecutionException;

-import org.apache.maven.project.MavenProject;

-

-import java.io.File;

-

-/**

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @todo Document

- * @since Jul 30, 2005

- */

-public abstract class AbstractPlutoMojo extends AbstractMojo {

-

-    /**

-     * @parameter expression="${installDir}"

-     */

-    protected File installationDirectory = null;

-

-    /**

-     * @parameter expression="${project}"

-     * @required

-     * @readonly

-     */

-    protected MavenProject project = null;

-

-    public void execute() throws MojoExecutionException {

-        // Validation of the installDir property is done by maven.

-        try {

-            doValidate();

-            doExecute();

-        } catch (MojoExecutionException ex) {

-            throw ex;

-        } catch (Exception ex) {

-            throw new MojoExecutionException("Error Installing Pluto", ex);

-        }

-    }

-

-    /**

-     * Process the actual execution.

-     * @throws Exception

-     */

-    protected abstract void doExecute() throws Exception;

-

-    protected abstract void doValidate() throws Exception;

-}

diff --git a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractPortletMojo.java b/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractPortletMojo.java
deleted file mode 100644
index 51508e4..0000000
--- a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AbstractPortletMojo.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.maven;

-

-/**

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @todo Document

- * @since Jul 30, 2005

- */

-public abstract class AbstractPortletMojo extends AbstractPlutoMojo {

-

-

-}

diff --git a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AssembleMojo.java b/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AssembleMojo.java
deleted file mode 100644
index de812d6..0000000
--- a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/AssembleMojo.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.maven;

-

-import org.apache.pluto.util.assemble.Assembler;

-import org.apache.pluto.util.assemble.AssemblerConfig;

-import org.apache.pluto.util.assemble.AssemblerFactory;

-import org.apache.maven.plugin.MojoExecutionException;

-import org.apache.maven.plugin.logging.Log;

-

-import java.io.File;

-

-/**

- * TODO: Document

- * TODO: Refactor this and the assembler to model deployer and allow no arg constructor

- * 

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @since Jul 30, 2005

- * @see org.apache.pluto.util.assemble.Assembler

- * 

- * @goal assemble

- * @description prepares a web application as a portlet application

- * @phase process-resources

- */

-public class AssembleMojo extends AbstractPortletMojo {

-	

-	// Private Member Variables ------------------------------------------------

-	

-    /**

-     * The portlet application descriptor (<code>WEB-INF/portlet.xml</code>).

-     * @parameter expression="${basedir}/src/main/webapp/WEB-INF/portlet.xml"

-     * @required

-     */

-    private File portletXml = null;

-

-    /**

-     * The original webapp descriptor (<code>WEB-INF/web.xml</code>).

-     * @parameter expression="${basedir}/src/main/webapp/WEB-INF/web.xml"

-     * @required

-     */

-    private File webXml = null;

-    

-    /**

-     * The file to which the updated webapp descriptor is written. 

-     * @parameter expression="${project.build.directory}/pluto-resources/web.xml"

-     */

-    private File webXmlDestination = null;

-    

-    

-    // AbstractPlutoMojo Impl --------------------------------------------------

-    

-    protected void doExecute() throws Exception {

-        // Log parameter values.

-    	Log log = getLog();

-        if (log.isInfoEnabled()) {

-            log.info("Reading web.xml from :" + webXml.getAbsolutePath());

-            log.info("Reading portlet.xml from: " + portletXml.getAbsolutePath());

-            log.info("Writing web.xml to: " + webXmlDestination.getAbsolutePath());

-        }

-        // Assemble portlet app by updating web.xml.

-        AssemblerConfig config = createAssemblerConfig();

-        Assembler assembler = AssemblerFactory.getFactory()

-        		.createAssembler(config);

-        assembler.assemble(config);

-    }

-

-    protected void doValidate() throws MojoExecutionException {

-        if (webXml == null || !webXml.exists()) {

-            throw new MojoExecutionException("Web application descriptor must be a valid web.xml");

-        }

-        if (portletXml == null || !portletXml.exists()) {

-            throw new MojoExecutionException("Portlet descriptor must be a valid portlet.xml");

-        }

-    }

-    

-    // Private Methods ---------------------------------------------------------

-    

-    private AssemblerConfig createAssemblerConfig() {

-        AssemblerConfig config = new AssemblerConfig();

-        config.setPortletDescriptor(portletXml);

-        config.setWebappDescriptor(webXml);

-        config.setDestination(webXmlDestination);

-        return config;

-    }

-    

-}

diff --git a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/DeployMojo.java b/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/DeployMojo.java
deleted file mode 100644
index 40c6527..0000000
--- a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/DeployMojo.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.maven;

-

-import org.apache.maven.plugin.MojoExecutionException;

-import org.apache.pluto.util.deploy.Deployer;

-import org.apache.pluto.util.deploy.DeploymentConfig;

-import org.apache.pluto.util.deploy.file.Tomcat5FileSystemDeployer;

-

-import java.util.Properties;

-import java.io.File;

-

-

-/**

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @todo Document

- * @since Jul 30, 2005

- *

- * @goal deploy

- * @requiresDependencyResolution runtime

- */

-public class DeployMojo extends AbstractPortletMojo {

-	

-	// Private Member Variables ------------------------------------------------

-	

-    /**

-     * @parameter expression="${project.build.outputDirectory}/${maven.final.name}

-     */

-    private File deployment = null;

-

-    /**

-     * @parameter expression="${pluto.deploy.file}"

-     */

-    private String deployerClass = Tomcat5FileSystemDeployer.class.getName();

-

-    /**

-     * @parameter expression="${pluto.deploy.tomcat5.service}"

-     */

-    private String tomcatService = "Catalina";

-    

-    /**

-     * @parameter expression="${pluto.deploy.tomcat5.host}"

-     */

-    private String tomcatHost = "localhost";

-    

-    

-    // AbstractPlutoMojo Impl --------------------------------------------------

-    

-    protected void doValidate() throws MojoExecutionException {

-    	System.err.println("installationDirectory: " + installationDirectory);

-    	if (deployment != null) {

-    		System.err.println("deployment: " + deployment.getAbsolutePath());

-    	} else {

-    		System.err.println("deployment: null");

-    	}

-    	System.err.println("DeployerClass: " + deployerClass);

-    	

-        if (deployment == null || !deployment.exists()) {

-            throw new MojoExecutionException("Deployment must be specified.");

-        }

-    }

-    

-    protected void doExecute() throws Exception {

-        if (!deployment.getName().endsWith(".war")) {

-            throw new MojoExecutionException(deployment.getName()

-            		+ " is not a valid deployment. Please specify a war.");

-        }

-

-        Deployer deployer = createDeployer();

-        //deployer.deploy(createConfig(), createInputStream());

-

-    }

-

-

-    private DeploymentConfig createConfig() {

-        return new DeploymentConfigImpl();

-    }

-

-

-    private Deployer createDeployer() throws Exception {

-        Class clazz = Class.forName(deployerClass);

-        return (Deployer) clazz.newInstance();

-    }

-

-    private class DeploymentConfigImpl extends DeploymentConfig {

-        private Properties props;

-

-        public DeploymentConfigImpl() {

-            super(deployment.getName().substring(0, deployment.getName().lastIndexOf(".")));

-            props = new Properties(project.getProperties());

-            props.putAll(System.getProperties());

-            props.setProperty("tomcat5.home", installationDirectory.getAbsolutePath());

-            props.setProperty("tomcat.service", tomcatService);

-            props.setProperty("tomcat.host", tomcatHost);

-        }

-

-        public String getDeploymentProperty(String key) {

-            String property = props.getProperty(key);

-            return property;

-        }

-    }

-}

diff --git a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallMojo.java b/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallMojo.java
deleted file mode 100644
index c03b483..0000000
--- a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallMojo.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.maven;

-

-/**

- * @goal install

- * @description the pluto ApplicationServerHook goal installs the pluto portal into the specified application server

- * @requiresDependencyResolution runtime

- *

- */

-public class InstallMojo extends AbstractManagementMojo {

-

-    protected void doExecute() throws Exception {

-        getHandler().install(createInstallationConfig());

-    }

-}

diff --git a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallationDependency.java b/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallationDependency.java
deleted file mode 100644
index 9894a7f..0000000
--- a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/InstallationDependency.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.maven;

-

-import java.io.IOException;

-import java.util.ArrayList;

-import java.util.Collection;

-import java.util.Collections;

-import java.util.List;

-import java.util.Properties;

-

-/**

- *

- */

-class InstallationDependency {    

-    

-    private static final Properties VERSION_PROPERTIES = new Properties();

-    private static final String PROPERTIES_FILE = "/versions.properties";

-    static

-    {

-        try 

-        {

-            VERSION_PROPERTIES.load(InstallationDependency.class.getResourceAsStream(PROPERTIES_FILE));

-        } 

-        catch (IOException e) 

-        {

-            throw new RuntimeException("Cannot load " + PROPERTIES_FILE + " from the classpath!", e);

-        }

-    }

-

-    public static final InstallationDependency PORTLET_API =

-        new InstallationDependency("javax.portlet", "portlet-api", 

-                VERSION_PROPERTIES.getProperty("portlet-api.version"));

-

-    public static final InstallationDependency  DESCRIPTOR_API =

-        new InstallationDependency("org.apache.pluto", "pluto-descriptor-api", 

-                VERSION_PROPERTIES.getProperty("pluto.version"));

-

-    public static final InstallationDependency  DESCRIPTOR_IMPL =

-            new InstallationDependency("org.apache.pluto", "pluto-descriptor-impl", 

-                    VERSION_PROPERTIES.getProperty("pluto.version"));

-

-    public static final InstallationDependency  CONTAINER =

-            new InstallationDependency("org.apache.pluto", "pluto-container", 

-                    VERSION_PROPERTIES.getProperty("pluto.version"));

-

-    public static final InstallationDependency  TAGLIB =

-            new InstallationDependency("org.apache.pluto", "pluto-taglib", 

-                    VERSION_PROPERTIES.getProperty("pluto.version"));

-

-    public static final InstallationDependency  PORTAL =

-            new InstallationDependency("org.apache.pluto", "pluto-portal", 

-                    VERSION_PROPERTIES.getProperty("pluto.version"), "war");

-

-    public static final InstallationDependency  TESTSUITE =

-            new InstallationDependency("org.apache.pluto", "pluto-testsuite", 

-                    VERSION_PROPERTIES.getProperty("pluto.version"), "war");

-

-    public static final InstallationDependency  CASTOR =

-            new InstallationDependency("castor", "castor", 

-                    VERSION_PROPERTIES.getProperty("castor.version"));

-

-    public static final InstallationDependency  XERCES =

-            new InstallationDependency("xerces", "xercesImpl", 

-                    VERSION_PROPERTIES.getProperty("xercesImpl.version"));

-

-    public static final InstallationDependency  XML_PARSER_APIS =

-            new InstallationDependency("xerces", "xmlParserAPIs", 

-                    VERSION_PROPERTIES.getProperty("xmlParserAPIs.version"));

-

-    private static final List ENDORSED = new ArrayList();

-    private static final List SHARED = new ArrayList();

-

-    static {

-//        ENDORSED.add(XERCES);

-//        ENDORSED.add(XML_PARSER_APIS);

-        SHARED.add(XERCES);

-        SHARED.add(XML_PARSER_APIS);

-

-        SHARED.add(PORTLET_API);

-        SHARED.add(DESCRIPTOR_API);

-        SHARED.add(DESCRIPTOR_IMPL);

-        SHARED.add(CONTAINER);

-        SHARED.add(TAGLIB);

-        SHARED.add(CASTOR);

-    }

-

-

-    public static Collection getEndorsedDependencies() {

-        return Collections.unmodifiableCollection(ENDORSED);

-    }

-

-    public static Collection getSharedDependencies() {

-        return Collections.unmodifiableCollection(SHARED);

-    }

-

-    private String groupId;

-    private String artifactId;

-    private String version;

-    private String type;

-

-    public InstallationDependency(String groupId, String artifactId, String version) {

-        this(groupId, artifactId, version, "jar");

-    }

-

-    public InstallationDependency(String groupId, String artifactId, String version, String type) {

-        if (version == null || version.trim().equalsIgnoreCase(""))

-        {

-            throw new RuntimeException("Missing or invalid property for artifact " + 

-                    artifactId + " in " + PROPERTIES_FILE + "!");

-        }

-        

-        this.groupId = groupId;

-        this.artifactId = artifactId;

-        this.version = version;

-        this.type = type;

-    }

-

-

-    public String getGroupId() {

-        return groupId;

-    }

-

-    public void setGroupId(String groupId) {

-        this.groupId = groupId;

-    }

-

-    public String getArtifactId() {

-        return artifactId;

-    }

-

-    public void setArtifactId(String artifactId) {

-        this.artifactId = artifactId;

-    }

-

-    public String getVersion() {

-        return version;

-    }

-

-    public void setVersion(String version) {

-        this.version = version;

-    }

-

-    public String getType() {

-        return type;

-    }

-

-    public void setType(String type) {

-        this.type = type;

-    }

-    

-}

diff --git a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/PublishMojo.java b/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/PublishMojo.java
deleted file mode 100644
index 8df0543..0000000
--- a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/PublishMojo.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.maven;

-

-import org.apache.maven.plugin.AbstractMojo;

-import org.apache.maven.plugin.MojoExecutionException;

-import org.apache.maven.plugin.MojoFailureException;

-import org.apache.maven.project.MavenProject;

-import org.apache.pluto.util.publish.PortletPublishConfig;

-import org.apache.pluto.util.publish.PortletPublishServiceFactory;

-import org.apache.pluto.util.publish.PortletPublishService;

-import org.apache.pluto.util.UtilityException;

-

-/**

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>:

- * @version 1.0

- * @since Dec 5, 2005

- *

- * @goal publish

- * @requiresDependencyResolution runtime

- */

-public class PublishMojo extends AbstractMojo {

-

-    /**

-     * @parameter expression="${host}"

-     */

-    protected String host = "localhost";

-

-    /**

-     * @parameter expression="${port}"

-     */

-    protected int port = 8080;

-

-    /**

-     * @parameter  expression="${protocol}"

-     */

-    protected String protocol = "http";

-

-    /**

-     * @parameter expression="${portalContext}"

-     */

-    protected String portalContextPath = "pluto";

-

-    /**

-     * @parameter expression="${username}"

-     */

-    protected String username = "pluto";

-

-    /**

-     * @parameter expression="${password}"

-     */

-    protected String password = "pluto";

-

-    /**

-     * @parameter expression="${project.build.finalName}"

-     */

-    protected String portletApplicationContext;

-

-    /**

-     * @parameter expression="${project}"

-     */

-    protected MavenProject project;

-

-    public void execute() throws MojoExecutionException, MojoFailureException {

-

-        PortletPublishConfig config = new PortletPublishConfig();

-        config.setHost(host);

-        config.setPort(port);

-        config.setProtocol(protocol);

-        config.setUsername(username);

-        config.setPassword(password);

-        config.setContext(portalContextPath);

-        config.setPortletApplicationContext(portletApplicationContext);

-

-        PortletPublishService publisher =

-            PortletPublishServiceFactory.getFactory().createPortletPublishService(config);

-

-        try {

-            publisher.publish(config);

-        }

-        catch(UtilityException ue) {

-            throw new MojoExecutionException(ue.getMessage());

-        }

-    }

-}

diff --git a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/ReinstallMojo.java b/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/ReinstallMojo.java
deleted file mode 100644
index 532ccd4..0000000
--- a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/ReinstallMojo.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.maven;

-

-import org.apache.pluto.util.install.InstallationConfig;

-

-

-/**

- * @goal reinstall

- * @requiresDependencyResolution runtime

- */

-public class ReinstallMojo extends AbstractManagementMojo {

-

-    public ReinstallMojo() {

-

-    }

-

-    protected void doExecute() throws Exception {

-        InstallationConfig config = createInstallationConfig();

-        getHandler().uninstall(config);

-        getHandler().install(config);

-    }

-}

diff --git a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/UninstallMojo.java b/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/UninstallMojo.java
deleted file mode 100644
index fc5f8b9..0000000
--- a/trunk/maven-pluto-plugin/src/main/java/org/apache/pluto/maven/UninstallMojo.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.maven;

-

-/**

- * @goal uninstall

- * @requiresDependencyResolution runtime

- */

-public class UninstallMojo extends AbstractManagementMojo {

-

-    protected void doExecute() throws Exception {

-        getHandler().uninstall(createInstallationConfig());

-   }

-}

diff --git a/trunk/maven-pluto-plugin/src/main/resources/versions.properties b/trunk/maven-pluto-plugin/src/main/resources/versions.properties
deleted file mode 100644
index f6bb6c8..0000000
--- a/trunk/maven-pluto-plugin/src/main/resources/versions.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-#  Copyright 2005-2006 The Apache Software Foundation
-#
-#  Licensed under the Apache License, Version 2.0 (the "License");
-#  you may not use this file except in compliance with the License.
-#  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-
-
-# The properties defined in this file should align with the names of the 
-# <property> elements of Pluto's parent POM. This property file is 
-# interpolated and placed in the maven-pluto-plugin jar, and is 
-# used by the InstallationDependency class.
-portlet-api.version=${portlet-api.version}
-servlet-api.version=${servlet-api.version}
-jsp-api.version=${jsp-api.version}
-jstl.version=${jstl.version}
-taglibs.standard.version=${taglibs.standard.version}
-xerces.version=${xerces.version}
-xercesImpl.version=${xerces.version}
-xmlParserAPIs.version=${xerces.version}
-castor.version=${castor.version}
-commons-digester.version=${commons-digester.version}
-commons-cli.version=${commons-cli.version}
-commons-httpclient.version=${commons-httpclient.version}
-commons-beanutils.version=${commons-beanutils.version}
-commons-logging.version=${commons-logging.version}
-log4j.version=${log4j.version}
-springframework.version=${springframework.version}
-plexus.version=${plexus.version}
-maven.version=${maven.version}
-ant.version=${ant.version}
-junit.version=${junit.version}
-jmock.version=${jmock.version}
-# The version of Pluto's parent POM.
-pluto.version=${pom.version}
diff --git a/trunk/maven-pluto-plugin/src/main/scripts/hello.mmld b/trunk/maven-pluto-plugin/src/main/scripts/hello.mmld
deleted file mode 100644
index 7dfee5b..0000000
--- a/trunk/maven-pluto-plugin/src/main/scripts/hello.mmld
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--

-Copyright 2004 The Apache Software Foundation.

-Licensed  under the  Apache License,  Version 2.0  (the "License");

-you may not use  this file  except in  compliance with the License.

-You may obtain a copy of the License at

-

-http://www.apache.org/licenses/LICENSE-2.0

-

-Unless required by applicable law or agreed to in writing, software

-distributed  under the  License is distributed on an "AS IS" BASIS,

-WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or

-implied.

-

-See the License for the specific language governing permissions and

-limitations under the License.

--->

-<mojo xmlns="marmalade:mojo">

-  <metadata>

-    <goal>hello</goal>

-    <description>Say Hello to the World.</description>

-    <parameters>

-      <parameter>

-        <name>salutation</name>

-        <expression>#project.build.directory</expression>

-        <description>Description of what this parameter is used for.</description>

-      </parameter>

-    </parameters>

-  </metadata>

-  <execute>

-    <c:out xmlns:c="marmalade:core">Hello, World</c:out>

-  </execute>

-</mojo>

-

diff --git a/trunk/maven-pluto-plugin/src/site/site.xml b/trunk/maven-pluto-plugin/src/site/site.xml
deleted file mode 100644
index 95adf3f..0000000
--- a/trunk/maven-pluto-plugin/src/site/site.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>

-<!--

-  Copyright 2005-2006 The Apache Software Foundation

-

-  Licensed under the Apache License, Version 2.0 (the "License");

-  you may not use this file except in compliance with the License.

-  You may obtain a copy of the License at

-

-      http://www.apache.org/licenses/LICENSE-2.0

-

-  Unless required by applicable law or agreed to in writing, software

-  distributed under the License is distributed on an "AS IS" BASIS,

-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-  See the License for the specific language governing permissions and

-  limitations under the License.

--->

-<project name="Maven">

-  <bannerLeft>

-    <name>Pluto Maven Plugin</name>

-    <src>http://portals.apache.org/pluto/images/pluto.png</src>

-    <href>http://portals.apache.org/pluto</href>

-  </bannerLeft>

-  <bannerRight>

-    <src>http://portals.apache.org/pluto/images/banner.png</src>

-  </bannerRight>

-  <body>

-    <links>

-      <item name="Pluto Home" href="http://portals.apache.org/pluto"/>

-      <item name="JSR 168" href="http://jcp.org/en/jsr/detail?id=168"/>

-	  <item name="Chinese Translation" href="http://heavyz.sourceforge.net/pluto_zh/pluto-container"/>

-    </links>

-

-	<menu name="Pluto Ant Tasks">

-      <item name="Getting Started" href="/getting-started.html"/>

-	</menu>

-

-    ${reports}

-  </body>

-</project>

diff --git a/trunk/pluto-ant-tasks/pom.xml b/trunk/pluto-ant-tasks/pom.xml
deleted file mode 100644
index cbb7cd8..0000000
--- a/trunk/pluto-ant-tasks/pom.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<!--

-  Copyright 2005-2006 The Apache Software Foundation

-

-  Licensed under the Apache License, Version 2.0 (the "License");

-  you may not use this file except in compliance with the License.

-  You may obtain a copy of the License at

-

-      http://www.apache.org/licenses/LICENSE-2.0

-

-  Unless required by applicable law or agreed to in writing, software

-  distributed under the License is distributed on an "AS IS" BASIS,

-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-  See the License for the specific language governing permissions and

-  limitations under the License.

--->

-<project xmlns="http://maven.apache.org/POM/4.0.0"

-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

-  

-  <parent>

-    <groupId>org.apache.pluto</groupId>

-    <artifactId>pluto</artifactId>

-    <version>1.1.0-SNAPSHOT</version>

-  </parent>

-  <modelVersion>4.0.0</modelVersion>

-  <artifactId>pluto-ant-tasks</artifactId> 

-  <packaging>jar</packaging>

-  <name>Pluto Ant Tasks</name> 

-  <description>The Pluto Ant Tasks are used to assemble, deploy, and publish portlets to the Pluto Portal Driver.</description>

-  

-  <dependencies>

-    <dependency>

-      <groupId>org.apache.pluto</groupId>

-      <artifactId>pluto-util</artifactId>

-      <version>${pom.version}</version>

-      <scope>compile</scope>

-    </dependency>

-    <dependency>

-      <groupId>ant</groupId>

-      <artifactId>ant</artifactId>

-      <version>${ant.version}</version>

-      <scope>provided</scope>

-    </dependency>

-  </dependencies>

-

-  <build> 

-    <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory> 

-    <plugins>

-      <plugin>

-        <artifactId>maven-site-plugin</artifactId>

-        <configuration>

-          <resourcesDirectory>${basedir}/../pluto-site/src/site/resources</resourcesDirectory>

-        </configuration>

-      </plugin>

-      <plugin>

-        <artifactId>maven-assembly-plugin</artifactId>

-        <configuration>

-          <descriptor>src/assemble/bin.xml</descriptor>

-        </configuration>

-      </plugin>

-    </plugins>

-  </build>

-  

-</project>

-

-

diff --git a/trunk/pluto-ant-tasks/src/assemble/bin.xml b/trunk/pluto-ant-tasks/src/assemble/bin.xml
deleted file mode 100644
index d5d6c50..0000000
--- a/trunk/pluto-ant-tasks/src/assemble/bin.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<!--

-  Copyright 2005-2006 The Apache Software Foundation

-

-  Licensed under the Apache License, Version 2.0 (the "License");

-  you may not use this file except in compliance with the License.

-  You may obtain a copy of the License at

-

-      http://www.apache.org/licenses/LICENSE-2.0

-

-  Unless required by applicable law or agreed to in writing, software

-  distributed under the License is distributed on an "AS IS" BASIS,

-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-  See the License for the specific language governing permissions and

-  limitations under the License.

--->

-<assembly>

-  <id>bin</id>

-  <formats>

-    <format>tar.gz</format>

-    <format>tar.bz2</format>

-    <format>zip</format>

-  </formats>

-  <fileSets>

-    <fileSet>

-      <directory>../</directory>

-      <outputDirectory>/</outputDirectory>

-      <includes>

-        <include>README*</include>

-		<include>LICENSE*</include>

-		<include>NOTICE*</include>

-      </includes>

-    </fileSet>

-    <fileSet>

-      <directory>target</directory>

-	  <outputDirectory></outputDirectory>

-      <includes>

-        <include>*.jar</include>

-      </includes>

-    </fileSet>

-    <fileSet>

-      <directory>target/site</directory>

-	  <outputDirectory>docs</outputDirectory>

-      <includes>

-        <include>**/*.*</include>

-      </includes>

-    </fileSet>

-  </fileSets>

-  <dependencySets>

-    <dependencySet>

-	  <outputDirectory>lib</outputDirectory>

-      <scope>runtime</scope>

-    </dependencySet>

-  </dependencySets>

-</assembly>

-

diff --git a/trunk/pluto-ant-tasks/src/assemble/src.xml b/trunk/pluto-ant-tasks/src/assemble/src.xml
deleted file mode 100644
index e6d6b4c..0000000
--- a/trunk/pluto-ant-tasks/src/assemble/src.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<!--

-  Copyright 2005-2006 The Apache Software Foundation

-

-  Licensed under the Apache License, Version 2.0 (the "License");

-  you may not use this file except in compliance with the License.

-  You may obtain a copy of the License at

-

-      http://www.apache.org/licenses/LICENSE-2.0

-

-  Unless required by applicable law or agreed to in writing, software

-  distributed under the License is distributed on an "AS IS" BASIS,

-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-  See the License for the specific language governing permissions and

-  limitations under the License.

--->

-<assembly>

-  <id>src</id>

-  <formats>

-    <format>tar.gz</format>

-    <format>tar.bz2</format>

-    <format>zip</format>

-  </formats>

-  <fileSets>

-    <fileSet>

-      <includes>

-        <include>README*</include>

-        <include>LICENSE*</include>

-        <include>NOTICE*</include>

-        <include>pom.xml</include>

-      </includes>

-    </fileSet>

-    <fileSet>

-      <directory>src</directory>

-    </fileSet>

-  </fileSets>

-</assembly>

diff --git a/trunk/pluto-ant-tasks/src/main/java/org/apache/pluto/ant/AssembleTask.java b/trunk/pluto-ant-tasks/src/main/java/org/apache/pluto/ant/AssembleTask.java
deleted file mode 100644
index 4f36fb7..0000000
--- a/trunk/pluto-ant-tasks/src/main/java/org/apache/pluto/ant/AssembleTask.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.ant;

-

-import org.apache.tools.ant.Task;

-import org.apache.tools.ant.BuildException;

-import org.apache.pluto.util.UtilityException;

-import org.apache.pluto.util.assemble.Assembler;

-import org.apache.pluto.util.assemble.AssemblerFactory;

-import org.apache.pluto.util.assemble.AssemblerConfig;

-

-import java.io.File;

-

-/**

- * TODO JavaDoc

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>:

- * @version 1.0

- * @since Nov 23, 2005

- */

-public class AssembleTask extends Task {

-

-    private File portletxml;

-

-    private File webxml;

-

-    private File destfile;

-

-    private File webapp;

-

-    public File getPortletxml() {

-        if(webapp != null)

-            return new File(webapp, "WEB-INF/portlet.xml");

-        return portletxml;

-    }

-

-    public void setPortletxml(File portletxml) {

-        this.portletxml = portletxml;

-    }

-

-    public File getWebxml() {

-        if(webapp != null)

-            return new File(webapp, "WEB-INF/web.xml");

-        return webxml;

-    }

-

-    public void setWebxml(File webxml) {

-        this.webxml = webxml;

-    }

-

-    public File getDestfile() {

-        if(destfile != null)

-            return destfile;

-        return getWebxml();

-    }

-

-    public void setDestfile(File destfile) {

-        this.destfile = destfile;

-    }

-

-    public File getWebapp() {

-        return webapp;

-    }

-

-    public void setWebapp(File webapp) {

-        this.webapp = webapp;

-    }

-

-    public void execute() throws BuildException {

-

-        validateArgs();

-

-        try {

-            AssemblerConfig config = new AssemblerConfig();

-            config.setPortletDescriptor(getPortletxml());

-            config.setWebappDescriptor(getWebxml());

-            config.setDestination(getDestfile());

-

-            Assembler assembler =

-                AssemblerFactory.getFactory().createAssembler(config);

-

-           assembler.assemble(config);

-        }

-

-        catch(UtilityException ue) {

-            throw new BuildException(ue);

-        }

-    }

-

-    private void validateArgs() throws BuildException {

-        if(webapp != null) {

-            if(!webapp.exists()) {

-               throw new BuildException("webapp "+webapp.getAbsolutePath()+ " does not exist");

-            }

-            return;

-        }

-

-        if(portletxml == null || !portletxml.exists()) {

-            throw new BuildException("portletxml "+portletxml+" does not exist");

-        }

-

-        if(webxml == null || !webxml.exists()) {

-            throw new BuildException("webxml "+webxml + " does not exist");

-        }

-    }

-}

diff --git a/trunk/pluto-ant-tasks/src/main/java/org/apache/pluto/ant/PublishTask.java b/trunk/pluto-ant-tasks/src/main/java/org/apache/pluto/ant/PublishTask.java
deleted file mode 100644
index 19a5fb4..0000000
--- a/trunk/pluto-ant-tasks/src/main/java/org/apache/pluto/ant/PublishTask.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.ant;

-

-import org.apache.tools.ant.Task;

-import org.apache.tools.ant.BuildException;

-import org.apache.pluto.util.UtilityException;

-import org.apache.pluto.util.publish.PortletPublishConfig;

-import org.apache.pluto.util.publish.PortletPublishServiceFactory;

-import org.apache.pluto.util.publish.PortletPublishService;

-

-/**

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>:

- * @version 1.0

- * @since Nov 23, 2005

- */

-public class PublishTask extends Task {

-

-    private String host;

-

-    private int port;

-

-    private String portalContext;

-

-    private String username;

-

-    private String password;

-

-    private String portletApplicationContext;

-

-    public String getHost() {

-        return host;

-    }

-

-    public void setHost(String host) {

-        this.host = host;

-    }

-

-    public int getPort() {

-        return port;

-    }

-

-    public void setPort(int port) {

-        this.port = port;

-    }

-

-    public String getPortalContext() {

-        return portalContext;

-    }

-

-    public void setPortalContext(String portalContext) {

-        this.portalContext = portalContext;

-    }

-

-    public String getUsername() {

-        return username;

-    }

-

-    public void setUsername(String username) {

-        this.username = username;

-    }

-

-    public String getPassword() {

-        return password;

-    }

-

-    public void setPassword(String password) {

-        this.password = password;

-    }

-

-    public String getPortletApplicationContext() {

-        return portletApplicationContext;

-    }

-

-    public void setPortletApplicationContext(String portletApplicationContext) {

-        this.portletApplicationContext = portletApplicationContext;

-    }

-

-    public void execute() throws BuildException {

-

-        validateArgs();

-

-        try {

-            PortletPublishConfig config = new PortletPublishConfig();

-            config.setHost(getHost());

-            config.setPort(getPort());

-            config.setContext(getPortalContext());

-            config.setUsername(getUsername());

-            config.setPassword(getPassword());

-            config.setPortletApplicationContext(getPortletApplicationContext());

-

-            PortletPublishService publisher = PortletPublishServiceFactory.getFactory()

-                .createPortletPublishService(config);

-            publisher.publish(config);

-        }

-        catch(UtilityException ue) {

-            throw new BuildException(ue);

-        }

-    }

-

-    private void validateArgs() throws BuildException {

-

-    }

-}

diff --git a/trunk/pluto-ant-tasks/src/site/apt/getting-started.apt b/trunk/pluto-ant-tasks/src/site/apt/getting-started.apt
deleted file mode 100644
index c1014c0..0000000
--- a/trunk/pluto-ant-tasks/src/site/apt/getting-started.apt
+++ /dev/null
@@ -1,59 +0,0 @@
-~~

-~~ Copyright 2005-2006 The Apache Software Foundation.

-~~

-~~ Licensed under the Apache License, Version 2.0 (the "License");

-~~ you may not use this file except in compliance with the License.

-~~ You may obtain a copy of the License at

-~~

-~~      http://www.apache.org/licenses/LICENSE-2.0

-~~

-~~ Unless required by applicable law or agreed to in writing, software

-~~ distributed under the License is distributed on an "AS IS" BASIS,

-~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-~~ See the License for the specific language governing permissions and

-~~ limitations under the License.

-~~

- 

- ------

- Getting Started

- ------

- David H. DeWolf

- ------

- 23 Nov 2005

- ------

-

-Getting Started

-

-  The Pluto Ant Tasks have been created to assist those not using

-  maven with the assembly, deployment, and publishing of Maven.

-  A usage example is shown below:

-

----------------

-

-  <path id="classes">

-    <!--

-      Pluto Ant Tasks depend upon the following libraries:

-        * pluto-ant-tasks-${version}.jar

-        * pluto-util-${version}.jar

-        * pluto-descriptor-api-${version}.jar

-        * pluto-descriptor-util-${version}.jar

-        * commons-logging-1.0.4.jar

-        * castor-0.9.6

-      -->

-    <fileset dir="/path/to/pluto-libraries" includes="**/*.jar"/>

-    <fileset dir="/path/to/commons-logging" includes="**/*.jar"/>

-    <fileset dir="/path/to/castor" includes="**/*.jar"/>

-  </path>

-

-  <typedef name="passemble" classname="org.apache.pluto.ant.AssembleTask"

-		  classpathref="classes"/>

-

-   <target name="passemble">

-     <passemble 

-       webxml="src/config/web.xml" 

-       portletxml="src/config/portlet.xml" 

-       destfile="src/webapp/WEB-INF/web.xml"/>

-   </target>

-

----------------

-

diff --git a/trunk/pluto-ant-tasks/src/site/site.xml b/trunk/pluto-ant-tasks/src/site/site.xml
deleted file mode 100644
index ca0aad8..0000000
--- a/trunk/pluto-ant-tasks/src/site/site.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>

-<!--

-  Copyright 2005-2006 The Apache Software Foundation

-

-  Licensed under the Apache License, Version 2.0 (the "License");

-  you may not use this file except in compliance with the License.

-  You may obtain a copy of the License at

-

-      http://www.apache.org/licenses/LICENSE-2.0

-

-  Unless required by applicable law or agreed to in writing, software

-  distributed under the License is distributed on an "AS IS" BASIS,

-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-  See the License for the specific language governing permissions and

-  limitations under the License.

--->

-<project name="Maven">

-  <bannerLeft>

-    <name>Pluto Ant Plugin</name>

-    <src>http://portals.apache.org/pluto/images/pluto.png</src>

-    <href>http://portals.apache.org/pluto</href>

-  </bannerLeft>

-  <bannerRight>

-    <src>http://portals.apache.org/pluto/images/banner.png</src>

-  </bannerRight>

-  <body>

-    <links>

-      <item name="Pluto Home" href="http://portals.apache.org/pluto"/>

-      <item name="JSR 168" href="http://jcp.org/en/jsr/detail?id=168"/>

-	  <item name="Chinese Translation" href="http://heavyz.sourceforge.net/pluto_zh/pluto-container"/>

-    </links>

-

-	<menu name="Pluto Ant Tasks">

-      <item name="Getting Started" href="/getting-started.html"/>

-	</menu>

-

-    ${reports}

-  </body>

-</project>

diff --git a/trunk/pluto-container/pom.xml b/trunk/pluto-container/pom.xml
deleted file mode 100644
index ed1816f..0000000
--- a/trunk/pluto-container/pom.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright 2005-2006 The Apache Software Foundation
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.apache.pluto</groupId>
-        <artifactId>pluto</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <groupId>org.apache.pluto</groupId>
-    <artifactId>pluto-container</artifactId>
-    <packaging>jar</packaging>
-    <name>Pluto Portlet Container</name>
-    <description>The pluto portlet container.</description>
-
-
-    <dependencies>
-
-        <!-- Pluto Support Libraries =========================================== -->
-        <dependency>
-            <groupId>org.apache.pluto</groupId>
-            <artifactId>pluto-descriptor-api</artifactId>
-            <version>${pom.version}</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.pluto</groupId>
-            <artifactId>pluto-descriptor-impl</artifactId>
-            <version>${pom.version}</version>
-            <scope>runtime</scope>
-        </dependency>
-
-        <!-- Other Support Libraries =========================================== -->
-        <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-            <version>${commons-logging.version}</version>
-            <scope>compile</scope>
-        </dependency>
-
-        <!-- Specification Libraries =========================================== -->
-        <dependency>
-            <groupId>javax.portlet</groupId>
-            <artifactId>portlet-api</artifactId>
-            <version>${portlet-api.version}</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
-            <version>${servlet-api.version}</version>
-            <scope>provided</scope>
-        </dependency>
-
-        <!-- Testing Libraries ================================================= -->
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>${junit.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.easymock</groupId>
-            <artifactId>easymock</artifactId>
-            <version>2.2</version>
-        </dependency>
-        <dependency>
-            <groupId>jmock</groupId>
-            <artifactId>jmock</artifactId>
-            <version>${jmock.version}</version>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <!-- Assembly Plugin: Create Distributions =========================== -->
-            <plugin>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <configuration>
-                    <descriptor>src/assemble/bin.xml</descriptor>
-                </configuration>
-            </plugin>
-            <!-- Surefire Plugin: Exec Tests ===================================== -->
-            <plugin>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <configuration>
-                    <includes>
-                        <include>**/*Test.java</include>
-                    </includes>
-                    <excludes>
-                        <!-- Abstract -->
-                        <exclude>**/PlutoTestCase.java</exclude>
-                    </excludes>
-                </configuration>
-            </plugin>
-            <plugin>
-                <artifactId>maven-site-plugin</artifactId>
-                <configuration>
-                    <resourcesDirectory>${basedir}/../pluto-site/src/site/resources</resourcesDirectory>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>
-
-
-
-
diff --git a/trunk/pluto-container/src/assemble/bin.xml b/trunk/pluto-container/src/assemble/bin.xml
deleted file mode 100644
index 29e85b7..0000000
--- a/trunk/pluto-container/src/assemble/bin.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<!--

-  Copyright 2005-2006 The Apache Software Foundation

-

-  Licensed under the Apache License, Version 2.0 (the "License");

-  you may not use this file except in compliance with the License.

-  You may obtain a copy of the License at

-

-      http://www.apache.org/licenses/LICENSE-2.0

-

-  Unless required by applicable law or agreed to in writing, software

-  distributed under the License is distributed on an "AS IS" BASIS,

-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-  See the License for the specific language governing permissions and

-  limitations under the License.

--->

-<assembly>

-  <id>bin</id>

-  <formats>

-    <format>tar.gz</format>

-    <format>tar.bz2</format>

-    <format>zip</format>

-  </formats>

-  <fileSets>

-    <fileSet>

-      <directory>../</directory>

-      <outputDirectory>/</outputDirectory>

-      <includes>

-        <include>README*</include>

-		<include>LICENSE*</include>

-		<include>NOTICE*</include>

-      </includes>

-    </fileSet>

-    <fileSet>

-      <directory>target</directory>

-	  <outputDirectory>/</outputDirectory>

-      <includes>

-        <include>*.jar</include>

-      </includes>

-    </fileSet>

-    <fileSet>

-      <directory>target/site</directory>

-	  <outputDirectory>docs</outputDirectory>

-      <includes>

-        <include>**/*.*</include>

-      </includes>

-    </fileSet>

-  </fileSets>

-  <dependencySets>

-    <dependencySet>

-	  <outputDirectory>lib</outputDirectory>

-      <scope>runtime</scope>

-    </dependencySet>

-  </dependencySets>

-</assembly>

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/Constants.java b/trunk/pluto-container/src/main/java/org/apache/pluto/Constants.java
deleted file mode 100644
index 5bdf223..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/Constants.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto;

-

-/**

- * Constant values used to bind internal portlet objects as attributes,

- * typically to a request.

- * @version 1.0

- */

-public class Constants {

-

-    /**

-     * The key used to bind the <code>PortletRequest</code> to the underlying

-     * <code>HttpServletRequest</code>.

-     */

-    public final static String PORTLET_REQUEST = "javax.portlet.request";

-

-    /**

-     * The key used to bind the <code>PortletResponse</code> to the underlying

-     * <code>HttpServletRequest</code>.

-     */

-    public final static String PORTLET_RESPONSE = "javax.portlet.response";

-

-    /**

-     * The key used to bind the <code>PortletConfig</code> to the underlying

-     * PortletConfig.

-     */

-    public final static String PORTLET_CONFIG = "javax.portlet.config";

-

-    /**

-     *

-     */

-    public final static String TITLE_KEY = "javax.portlet.title";

-

-    /**

-     *

-     */

-    public final static String SHORT_TITLE_KEY = "javax.portlet.short-title";

-

-    /**

-     * 

-     */

-    public final static String KEYWORDS_KEY = "javax.portlet.keywords";

-

-    /**

-     * The key used to bind the method of processing being requested by the

-     * container to the underlying <code>PortletRquest</code>.

-     */

-    public final static String METHOD_ID = "org.apache.pluto.core.method";

-

-    /**

-     * The unique method identifier for render requests.  Render requests are

-     * requested through a call to the {@link PortletContainer#doRender(org.apache.pluto.PortletWindow,

-        * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}

-     * method.

-     */

-    public final static Integer METHOD_RENDER = new Integer(1);

-

-    /**

-     * The unique method identifier for render requests.  Render requests are

-     * requested through a call to the {@link PortletContainer#doAction(org.apache.pluto.PortletWindow,

-        * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}

-     * method.

-     */

-    public final static Integer METHOD_ACTION = new Integer(3);

-

-    /**

-     * The unique method identifier for render requests.  Render requests are

-     * requested through a call to the {@link PortletContainer#doLoad(org.apache.pluto.PortletWindow,

-        * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}

-     * method.

-     */

-    public final static Integer METHOD_NOOP = new Integer(5);

-

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/OptionalContainerServices.java b/trunk/pluto-container/src/main/java/org/apache/pluto/OptionalContainerServices.java
deleted file mode 100644
index 901bd59..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/OptionalContainerServices.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto;

-

-import org.apache.pluto.spi.optional.PortletPreferencesService;

-import org.apache.pluto.spi.optional.PortletEnvironmentService;

-import org.apache.pluto.spi.optional.PortletInvokerService;

-import org.apache.pluto.spi.optional.PortletRegistryService;

-import org.apache.pluto.internal.InternalPortletWindow;

-

-/**

- * Defines the services necessary for integration between the Pluto Container

- * and a Portal.

- *

- * @since 1.1.0

- * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

- */

-public interface OptionalContainerServices {

-

-    /**

-     * Returns the portlet preferences service implementation

-     * used by the container.

-     *

-     * @return portlet preferences service implementation.

-     */

-    PortletPreferencesService getPortletPreferencesService();

-

-    /**

-     * Returns the environment services implementation

-     * used by the container.

-     *

-     * @return portlet environment services implementation.

-     */

-    PortletEnvironmentService getPortletEnvironmentService();

-

-    /**

-     * Returns the portlet registry services implementation

-     * used by the container.

-     *

-     * @return registry service implementation

-     */

-    PortletRegistryService getPortletRegistryService();

-

-    

-    /**

-     * Returns an invoker for the specified PortletWindow.

-     *

-     * @param portletWindow  the InternalPortletWindow used for invocation.

-     * @return an invoker which can be used to service the indicated portlet.

-     */

-    PortletInvokerService getPortletInvokerService(InternalPortletWindow portletWindow);

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/PlutoConfigurationException.java b/trunk/pluto-container/src/main/java/org/apache/pluto/PlutoConfigurationException.java
deleted file mode 100644
index e94e238..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/PlutoConfigurationException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto;

-

-/**

- * Exception thrown when Pluto configuration fails.

- *

- * @author ddewolf@apache.org

- * @since Jul 2, 2005

- */

-public class PlutoConfigurationException extends RuntimeException {

-

-    public PlutoConfigurationException(String message) {

-        super(message);

-    }

-

-    public PlutoConfigurationException(String message, Throwable cause) {

-        super(message, cause);

-    }

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/PortletContainer.java b/trunk/pluto-container/src/main/java/org/apache/pluto/PortletContainer.java
deleted file mode 100644
index 141d104..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/PortletContainer.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto;

-

-import java.io.IOException;

-import java.util.Iterator;

-

-import javax.portlet.PortletException;

-import javax.servlet.ServletContext;

-import javax.servlet.http.HttpServletRequest;

-import javax.servlet.http.HttpServletResponse;

-

-import org.apache.pluto.descriptors.portlet.PortletAppDD;

-

-/**

- * The publicized entry point into Pluto. The base functionality of the portlet

- * container can be enhanced or even modified by PortletContainerServices.

- * <p/>

- * <P> The methods of this class have to be called in the following order:

- * <TABLE> <TR><TH>Method</TH><TH>Description</TH><TH>Constraints</TH></TR>

- * <TR><TD>{@link #init(javax.servlet.ServletContext)}</TD> <TD>Initialized the

- * portlet container.</TD> <TD>Performed only once per container

- * lifecycle.</TD></TR>

- * <p/>

- * <TR><TD>{@link #doAction(org.apache.pluto.PortletWindow,

-    * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}</TD>

- * <TD>Perform the action for the targeted portlet</TD> <TD>Optionally performed

- * for a single portlet per request</TD></TR>

- * <p/>

- * <TR><TD>{@link #doRender(org.apache.pluto.PortletWindow,

-    * javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)}</TD>

- * <TD>Render the portlet</TD> <TD>Performed once for each portlet per

- * request.</TD></TR>

- * <p/>

- * <TR><TD>{@link #destroy()}</TD> <TD>Destroy and remove container from

- * service.</TD> <TD>Performed only once per container lifecylce</TD></TR>

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:esm@apache.org">Elliot Metsger</a>

- * @version $Id: PortletContainer.java 36010 2004-07-30 14:16:06Z ddewolf $

- */

-public interface PortletContainer {

-

-    /**

-     * Initializes the container for use within the given servlet context.

-     * @param servletContext  the servlet context.

-     * @throws PortletContainerException if an error occurs.

-     */

-    public void init(ServletContext servletContext)

-    throws PortletContainerException;

-

-    /**

-     * Shuts down the container. After calling this method it is no longer valid

-     * to call any method on the portlet container.

-     * @throws PortletContainerException if an error occurs while shutting down

-     *                                   the container

-     */

-    public void destroy() throws PortletContainerException;

-

-    /**

-     * Calls the render method of the given portlet window.

-     * @param internalPortletWindow the portlet Window

-     * @param request               the servlet request

-     * @param response              the servlet response

-     * @throws PortletException          if one portlet has trouble fulfilling

-     *                                   the request

-     * @throws IOException               if the streaming causes an I/O problem

-     * @throws PortletContainerException if the portlet container implementation

-     *                                   has trouble fulfilling the request

-     */

-    public void doRender(PortletWindow internalPortletWindow,

-                         HttpServletRequest request,

-                         HttpServletResponse response)

-        throws PortletException, IOException, PortletContainerException;

-

-

-    /**

-     * Indicates that a portlet action occured in the current request and calls

-     * the processAction method of this portlet.

-     * @param internalPortletWindow the portlet Window

-     * @param request               the servlet request

-     * @param response              the servlet response

-     * @throws PortletException          if one portlet has trouble fulfilling

-     *                                   the request

-     * @throws PortletContainerException if the portlet container implementation

-     *                                   has trouble fulfilling the request

-     */

-    public void doAction(PortletWindow internalPortletWindow,

-                         HttpServletRequest request,

-                         HttpServletResponse response)

-        throws PortletException, IOException, PortletContainerException;

-

-    /**

-     * Indicates that the portlet must be initialized

-     * @param internalPortletWindow the portlet Window

-     * @param servletRequest        the servlet request

-     * @param servletResponse       the servlet response

-     * @throws PortletException          if one portlet has trouble fulfilling

-     *                                   the request

-     * @throws PortletContainerException if the portlet container implementation

-     *                                   has trouble fulfilling the request

-     */

-    public void doLoad(PortletWindow internalPortletWindow,

-                       HttpServletRequest servletRequest,

-                       HttpServletResponse servletResponse)

-        throws PortletException, IOException, PortletContainerException;

-

-    /**

-     * Returns whether the container is already initialized or not.

-     * @return <code>true</code> if the container is initialized

-     */

-    public boolean isInitialized();

-

-    /**

-     * Retrieve the unique container name

-     * @return the container name.

-     */

-    public String getName();

-

-    /**

-     * Retreive the required container services associated with this container.

-     * @return the required container services associated with this container.

-     */

-    public RequiredContainerServices getRequiredContainerServices();

-

-    /**

-     * Retrieve the optional container services associated with this contianer.

-     * @return the container services provided by either the portal or the defaults.

-     */

-    public OptionalContainerServices getOptionalContainerServices();

-    

-    /**

-     * Retrieve the {@link PortletAppDD} for the portlet

-     * located at the supplied context.

-     * 

-     * Must not return null.

-     * 

-     * @param context the context of the portlet

-     * @return the portlet application descriptor

-     * @throws PortletContainerException if the container has trouble obtaining

-     *                                   the context of the portlet, or retrieving

-     *                                   the <code>PortletAppDD</code>

-     */    

-    public PortletAppDD getPortletApplicationDescriptor(String context)

-        throws PortletContainerException;

-

-

-    

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/PortletContainerException.java b/trunk/pluto-container/src/main/java/org/apache/pluto/PortletContainerException.java
deleted file mode 100644
index fe9d159..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/PortletContainerException.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto;

-

-/**

- * Thrown when an internal portlet container exception occurs within Pluto.

- * This type of exception indicates an error from which the container is not

- * able to recover.

- *

- * @version 1.0

- */

-public class PortletContainerException extends Exception {

-    private Throwable cause;

-

-    /**

-     * Constructs a new PortletContainerException.

-     * This exception will have no message and no root cause.

-     */

-    public PortletContainerException() {

-

-    }

-

-    /**

-     * Constructs a new PortletContainerException with the given message.

-     * @param text the message explaining the exception occurance

-     */

-    public PortletContainerException(String text) {

-        super(text);

-    }

-

-    /**

-     * Constructs a new PortletContainerException with the given message and

-     * root cause.

-     * @param text  the message explaining the exception occurance

-     * @param cause the root cause of the is exception

-     */

-    public PortletContainerException(String text, Throwable cause) {

-        super(text);

-        this.cause = cause;

-    }

-

-    /**

-     * Constructs a new portlet invoker exception when the portlet needs to

-     * throw an exception. The exception's message is based on the localized

-     * message of the underlying exception.

-     * @param cause the root cause

-     */

-    public PortletContainerException(Throwable cause) {

-        super(cause.getLocalizedMessage());

-        this.cause = cause;

-    }

-

-    /**

-     * Returns the exception that cause this portlet exception.

-     * @return the <CODE>Throwable</CODE> that caused this portlet exception.

-     */

-    public Throwable getRootCause() {

-        return (cause);

-    }

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/PortletContainerFactory.java b/trunk/pluto-container/src/main/java/org/apache/pluto/PortletContainerFactory.java
deleted file mode 100644
index 86b593b..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/PortletContainerFactory.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto;

-

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-import org.apache.pluto.core.DefaultOptionalContainerServices;

-import org.apache.pluto.core.PortletContainerImpl;

-import org.apache.pluto.util.ArgumentUtility;

-

-/**

- * Factory used to create new PortletContainer instances.  The factor constructs

- * the underlying pluto container implementation by using the the given

- * container services.

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @version 1.0

- * @since Sep 18, 2004

- */

-public class PortletContainerFactory {

-

-    /** Logger. */

-    private static final Log LOG = LogFactory.getLog(PortletContainerFactory.class);

-

-

-    /** Singleton instance of the <code>PortletContainerFactory</code>. */

-    private static final PortletContainerFactory FACTORY =

-    		new PortletContainerFactory();

-

-    /**

-     * Accessor method for the singleton instance of the

-     * <code>PortletContainerFactory</code>.

-     * @return singleton instance of the PortletContainerFactory

-     */

-    public static PortletContainerFactory getInstance() {

-    	return FACTORY;

-    }

-

-    /**

-     * Private constructor that prevents external instantiation.

-     */

-    private PortletContainerFactory() {

-    	// Do nothing.

-    }

-

-    /**

-     * Create a container with the given containerName, initialized from the given

-     * servlet config, and using the given container services.

-     * @param containerName  the name of the portlet container.

-     * @param requiredServices  the required portlet container services.

-     * @return newly created PortletContainer instance.

-     * @throws PortletContainerException

-     */

-    public PortletContainer createContainer(

-    		String containerName,

-    		RequiredContainerServices requiredServices)

-        throws PortletContainerException {

-        return createContainer(containerName,

-                               requiredServices,

-                               new DefaultOptionalContainerServices());

-   }

-

-    public PortletContainer createContainer(

-    		String containerName,

-    		RequiredContainerServices requiredServices,

-    		OptionalContainerServices optionalServices) {

-    	

-        ArgumentUtility.validateNotNull("requiredServices", requiredServices);

-        ArgumentUtility.validateNotEmpty("containerName", containerName);

-        

-        DefaultOptionalContainerServices optionalServicesWrapper =

-        		new DefaultOptionalContainerServices(optionalServices);

-        PortletContainer container = new PortletContainerImpl(

-        		containerName, requiredServices, optionalServicesWrapper);

-        

-        if (LOG.isInfoEnabled()) {

-            LOG.info("Portlet Container [" + containerName + "] created.");

-        }

-        return container;

-    }

-}

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/PortletContainerRuntimeException.java b/trunk/pluto-container/src/main/java/org/apache/pluto/PortletContainerRuntimeException.java
deleted file mode 100644
index cabdae8..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/PortletContainerRuntimeException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto;

-

-/**

- * Runtime exception thrown when an unexpected condition is encountered.

- *

- * @version 1.0

- */

-public class PortletContainerRuntimeException extends RuntimeException {

-

-    public PortletContainerRuntimeException() {

-

-    }

-

-    public PortletContainerRuntimeException(String message) {

-        super(message);

-    }

-

-    public PortletContainerRuntimeException(String message, Throwable cause) {

-        super(message, cause);

-    }

-

-    public PortletContainerRuntimeException(Throwable cause) {

-        super(cause);

-    }

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/PortletWindow.java b/trunk/pluto-container/src/main/java/org/apache/pluto/PortletWindow.java
deleted file mode 100644
index 359839b..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/PortletWindow.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto;

-

-import javax.portlet.PortletMode;

-import javax.portlet.WindowState;

-

-/**

- * Thin representation of the portlet window for which the container

- * request should be processed.  The PortletWindow is used internally

- * to map the request to the configured Portlet Application and Portlet.

- *

- * @see org.apache.pluto.core.PortletWindowImpl

- * @see org.apache.pluto.descriptors.portlet.PortletDD

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @version 1.0

- * @since Sep 22, 2004

- */

-public interface PortletWindow {

-

-    /**

-     * Retrieve this windows unique id which will be

-     *  used to communicate back to the referencing portal.

-     * @return unique id.

-     */

-    public PortletWindowID getId();

-

-    /**

-     * Retrieve the context path in which the Portlet resides.

-     * @return context path

-     */

-    public String getContextPath();

-

-    /**

-     * Retrieve the name of the portlet as configured in the

-     * <code>portlet.xml</code>.

-     * @return the name of the portlet.

-     */

-    public String getPortletName();

-

-    /**

-     * Retrieve the current window state for this window.

-     * @return the current window state.

-     */

-    public WindowState getWindowState();

-

-    /**

-     * Retrieve the current portlet mode for this window.

-     * @return the current portlet mode.

-     */

-    public PortletMode getPortletMode();

-    

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/PortletWindowID.java b/trunk/pluto-container/src/main/java/org/apache/pluto/PortletWindowID.java
deleted file mode 100644
index a5f8783..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/PortletWindowID.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto;

-

-/**

- * The portlet window ID.

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @version 1.0

- */

-public interface PortletWindowID {

-	

-	/**

-	 * Returns the unique string ID of the portlet window.

-	 * <p>

-	 * Depending on the implementation of <code>toString()</code> is dangerous,

-	 * because the original implementation in <code>Object</code> is not

-	 * qualified.

-	 * </p>

-	 * @return the unique string ID of the portlet window.

-	 */

-	public String getStringId();

-	

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/RequiredContainerServices.java b/trunk/pluto-container/src/main/java/org/apache/pluto/RequiredContainerServices.java
deleted file mode 100644
index f7b19c0..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/RequiredContainerServices.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto;

-

-import org.apache.pluto.spi.PortalCallbackService;

-

-import javax.portlet.PortalContext;

-

-/**

- * This interface defines the services required for integration between the

- * Pluto Portlet Container and a Portal.

- * 

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- */

-public interface RequiredContainerServices {

-

-    /**

-     * Returns the PortalContext instance associated with this group of

-     * portlet container services.

-     * @return a PortalContext implementation.

-     */

-    public PortalContext getPortalContext();

-

-    /**

-     * Returns the portal callback service implementation instance associated

-     * with this group of portlet container services. 

-     * @return a PortalCallbackService implementation.

-     */

-    public PortalCallbackService getPortalCallbackService();

-    

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java b/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java
deleted file mode 100644
index e96e23f..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultOptionalContainerServices.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.core;

-

-import org.apache.pluto.OptionalContainerServices;

-import org.apache.pluto.internal.InternalPortletWindow;

-import org.apache.pluto.spi.optional.PortletPreferencesService;

-import org.apache.pluto.spi.optional.PortletEnvironmentService;

-import org.apache.pluto.spi.optional.PortletInvokerService;

-import org.apache.pluto.spi.optional.PortletRegistryService;

-

-/**

- * Default Optional Container Services implementation.

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @version 1.0

- * @since Sep 18, 2004

- */

-public class DefaultOptionalContainerServices implements OptionalContainerServices {

-

-    private PortletPreferencesService preferenceService;

-    private PortletRegistryService portletRegistryService;

-    

-    

-    /**

-     * Constructs an instance using the default portlet preferences service

-     * implementation.

-     */

-    public DefaultOptionalContainerServices() {

-        preferenceService = new DefaultPortletPreferencesService();

-        portletRegistryService = PortletContextManager.getManager();

-    }

-    

-    /**

-     * Constructs an instance using specified optional container services

-     * implementation. If the portlet preferences service is provided, it will

-     * be used. Otherwise, the default portlet preferences service will be used.

-     * @param root  the root optional container services implementation.

-     */

-    public DefaultOptionalContainerServices(OptionalContainerServices root) {

-        this();

-        if (root.getPortletPreferencesService() != null) {

-            preferenceService = root.getPortletPreferencesService();

-        }

-

-        if (root.getPortletRegistryService() != null) {

-            portletRegistryService = root.getPortletRegistryService();

-        }

-    }

-    

-    

-    // OptionalContainerServices Impl ------------------------------------------

-    

-    public PortletPreferencesService getPortletPreferencesService() {

-        return preferenceService;

-    }

-

-

-    public PortletRegistryService getPortletRegistryService() {

-        return portletRegistryService;

-    }

-

-    /**

-     * TODO:

-     */

-    public PortletEnvironmentService getPortletEnvironmentService() {

-        return null;

-    }

-    

-    /**

-     * TODO:

-     */

-    public PortletInvokerService getPortletInvokerService(

-    		InternalPortletWindow window) {

-        return null;

-    }

-    

-}

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultPortletPreferencesService.java b/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultPortletPreferencesService.java
deleted file mode 100644
index 1062c08..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/core/DefaultPortletPreferencesService.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.core;

-

-import java.util.HashMap;

-import java.util.Map;

-

-import javax.portlet.PortletRequest;

-

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-import org.apache.pluto.PortletContainerException;

-import org.apache.pluto.PortletWindow;

-import org.apache.pluto.internal.InternalPortletPreference;

-import org.apache.pluto.spi.optional.PortletPreferencesService;

-

-/**

- * Default implementation of the portlet preferences service. The portlet

- * preferences service is a singleton held by the pluto portlet container.

- * 

- * @see javax.portlet.PortletPreferences

- * @see org.apache.pluto.internal.impl.PortletPreferencesImpl

- * @see javax.portlet.PortletPreferences

- * 

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public class DefaultPortletPreferencesService

-implements PortletPreferencesService {

-	

-	/** Logger. */

-	private static final Log LOG = LogFactory.getLog(

-			DefaultPortletPreferencesService.class);

-	

-	

-	// Private Member Variables ------------------------------------------------

-	

-	/**

-	 * The in-memory portlet preferences storage: key is the preference name as

-	 * a string, value is an array of PortletPreference objects.

-	 */

-	private Map storage = new HashMap();

-	

-	

-	// Constructor -------------------------------------------------------------

-	

-	/**

-	 * Default no-arg constructor.

-	 */

-	public DefaultPortletPreferencesService() {

-		// Do nothing.

-	}

-	

-	

-	// PortletPreferencesService Impl ------------------------------------------

-	

-	/**

-	 * Returns the stored portlet preferences array. The preferences managed by

-	 * this service should be protected from being directly accessed, so this

-	 * method returns a cloned copy of the stored preferences.

-	 * 

-	 * @param portletWindow  the portlet window.

-	 * @param request  the portlet request from which the remote user is retrieved.

-	 * @return a copy of the stored portlet preferences array.

-	 * @throws PortletContainerException

-	 */

-	public InternalPortletPreference[] getStoredPreferences(

-			PortletWindow portletWindow,

-			PortletRequest request)

-	throws PortletContainerException {

-        String key = getFormattedKey(portletWindow, request);

-        InternalPortletPreference[] preferences = (InternalPortletPreference[])

-        		storage.get(key);

-        if (preferences == null) {

-            if (LOG.isDebugEnabled()) {

-                LOG.debug("No portlet preferences found for: " + key);

-            }

-            return new InternalPortletPreference[0];

-        } else {

-        	if (LOG.isDebugEnabled()) {

-        		LOG.debug("Got " + preferences.length + " stored preferences.");

-        	}

-        	return clonePreferences(preferences);

-        }

-    }

-	

-	/**

-	 * Stores the portlet preferences to the in-memory storage. This method

-	 * should be invoked after the portlet preferences are validated by the

-	 * preference validator (if defined).

-	 * <p>

-	 * The preferences managed by this service should be protected from being

-	 * directly accessed, so this method clones the passed-in preferences array

-	 * and saves it.

-	 * </p>

-	 * 

-	 * @see javax.portlet.PortletPreferences#store()

-	 *

-	 * @param portletWindow  the portlet window

-	 * @param request  the portlet request from which the remote user is retrieved.

-	 * @param preferences  the portlet preferences to store.

-	 * @throws PortletContainerException

-	 */

-    public void store(PortletWindow portletWindow,

-                      PortletRequest request,

-                      InternalPortletPreference[] preferences)

-    throws PortletContainerException {

-        String key = getFormattedKey(portletWindow, request);

-        storage.put(key, clonePreferences(preferences));

-        if (LOG.isDebugEnabled()) {

-            LOG.debug("Portlet preferences stored for: " + key);

-        }

-    }

-    

-    

-    // Private Methods ---------------------------------------------------------

-    

-    /**

-     * Formats the preference key for the portlet preference using specified

-     * portlet window and remote user.

-     * @param portletWindow  the portlet window.

-     * @param request  the remote request.

-     */

-    private String getFormattedKey(PortletWindow portletWindow,

-                                   PortletRequest request) {

-    	StringBuffer buffer = new StringBuffer();

-    	buffer.append("user=").append(request.getRemoteUser()).append(";");

-    	buffer.append("portletName=").append(portletWindow.getPortletName());

-    	return buffer.toString();

-    }

-    

-    /**

-     * Clones a PortletPreference array. This method performs a deep clone on

-     * the passed-in portlet preferences array. Every PortletPreference object

-     * in the array are cloned (via the <code>PortletPreference.clone()</code>

-     * method) and injected into the new array.

-     * 

-     * @param preferences  the portlet preferences array to clone.

-     * @return a deep-cloned copy of the portlet preferences array.

-     */

-    private InternalPortletPreference[] clonePreferences(

-    		InternalPortletPreference[] preferences) {

-    	if (preferences == null) {

-    		return null;

-    	}

-    	InternalPortletPreference[] copy =

-    			new InternalPortletPreference[preferences.length];

-    	for (int i = 0; i < preferences.length; i++) {

-    		if (preferences[i] != null) {

-    			copy[i] = (InternalPortletPreference) preferences[i].clone();

-    		} else {

-    			copy[i] = null;

-    		}

-    	}

-    	return copy;

-    }

-    

-}

-

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java
deleted file mode 100644
index 2572470..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContainerImpl.java
+++ /dev/null
@@ -1,380 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.core;

-

-import java.io.IOException;

-import java.util.Map;

-

-import javax.portlet.PortletException;

-import javax.servlet.ServletContext;

-import javax.servlet.http.HttpServletRequest;

-import javax.servlet.http.HttpServletResponse;

-

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-

-import org.apache.pluto.descriptors.portlet.PortletAppDD;

-import org.apache.pluto.internal.InternalPortletWindow;

-import org.apache.pluto.internal.PortletDescriptorRegistry;

-import org.apache.pluto.internal.impl.ActionRequestImpl;

-import org.apache.pluto.internal.impl.ActionResponseImpl;

-import org.apache.pluto.internal.impl.PortletWindowImpl;

-import org.apache.pluto.internal.impl.RenderRequestImpl;

-import org.apache.pluto.internal.impl.RenderResponseImpl;

-import org.apache.pluto.spi.PortletURLProvider;

-import org.apache.pluto.OptionalContainerServices;

-import org.apache.pluto.PortletContainer;

-import org.apache.pluto.PortletContainerException;

-import org.apache.pluto.PortletWindow;

-import org.apache.pluto.RequiredContainerServices;

-

-/**

- * Default Pluto Container implementation.

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @author <a href="mailto:esm@apache.org">Elliot Metsger</a>

- * @version 1.0

- * @since Sep 18, 2004

- */

-public class PortletContainerImpl implements PortletContainer {

-

-    /** Internal logger. */

-    private static final Log LOG = LogFactory.getLog(PortletContainerImpl.class);

-    

-    

-    // Private Member Variables ------------------------------------------------

-    

-    /** The portlet container name. */

-    private String name = null;

-    

-    /** The required container services associated with this container. */

-    private RequiredContainerServices requiredContainerServices = null;

-    

-    /** The optional container services associated with this container. */

-    private OptionalContainerServices optionalContainerServices = null;

-    

-    /** The servlet context associated with this container. */

-    private ServletContext servletContext = null;

-

-    /** Flag indicating whether or not we've been initialized. */

-    private boolean initialized = false;

-    

-    

-    // Constructor -------------------------------------------------------------

-    

-    /** Default Constructor.  Create a container implementation

-     *  whith the given name and given services.

-     *

-     * @param name  the name of the container.

-     * @param requiredServices  the required container services implementation.

-     * @param optionalServices  the optional container services implementation.

-     */

-    public PortletContainerImpl(String name,

-                                RequiredContainerServices requiredServices,

-                                OptionalContainerServices optionalServices) {

-        this.name = name;

-        this.requiredContainerServices = requiredServices;

-        this.optionalContainerServices = optionalServices;

-    }

-    

-    

-    // PortletContainer Impl ---------------------------------------------------

-    

-    /**

-     * Initialize the container for use within the given configuration scope.

-     * @param servletContext  the servlet context of the portal webapp.

-     */

-    public void init(ServletContext servletContext)

-    throws PortletContainerException {

-    	if (servletContext == null) {

-    		throw new PortletContainerException(

-    				"Unable to initialize portlet container [" + name + "]: "

-    				+ "servlet context is null.");

-    	}

-        this.servletContext = servletContext;

-        this.initialized = true;

-        infoWithName("Container initialized successfully.");

-    }

-

-    /**

-     * Determine whether this container has been initialized or not.

-     * @return true if the container has been initialized.

-     */

-    public boolean isInitialized() {

-        return initialized;

-    }

-

-    /**

-     * Destroy this container.

-     */

-    public void destroy() {

-        this.servletContext = null;

-        this.initialized = false;

-        infoWithName("Container destroyed.");

-    }

-

-

-    /**

-     * Renders the portlet associated with the specified portlet window.

-     * @param portletWindow  the portlet window.

-     * @param request  the servlet request.

-     * @param response  the servlet response.

-     * @throws IllegalStateException  if the container is not initialized.

-     * @throws PortletException

-     * @throws IOException

-     * @throws PortletContainerException

-     * 

-     * @see javax.portlet.Portlet#render(javax.portlet.RenderRequest,javax.portlet.RenderResponse)

-     */

-    public void doRender(PortletWindow portletWindow,

-                         HttpServletRequest request,

-                         HttpServletResponse response)

-    throws PortletException, IOException, PortletContainerException {

-    	

-    	ensureInitialized();

-    	

-        InternalPortletWindow internalPortletWindow =

-        		new PortletWindowImpl(servletContext, portletWindow);

-        debugWithName("Render request received for portlet: "

-        		+ portletWindow.getPortletName());

-        

-        RenderRequestImpl renderRequest = new RenderRequestImpl(

-        		this, internalPortletWindow, request);

-        RenderResponseImpl renderResponse = new RenderResponseImpl(

-        		this, internalPortletWindow, request, response);

-

-        PortletInvoker invoker = new PortletInvoker(internalPortletWindow);

-        invoker.render(renderRequest, renderResponse);

-        debugWithName("Portlet rendered for: "

-        		+ portletWindow.getPortletName());

-    }

-

-    /**

-     * Process action for the portlet associated with the given portlet window.

-     * @param portletWindow  the portlet window.

-     * @param request  the servlet request.

-     * @param response  the servlet response.

-     * @throws PortletException

-     * @throws IOException

-     * @throws PortletContainerException

-     * 

-     * @see javax.portlet.Portlet#processAction(javax.portlet.ActionRequest,javax.portlet.ActionResponse)

-     */

-    public void doAction(PortletWindow portletWindow,

-                         HttpServletRequest request,

-                         HttpServletResponse response)

-    throws PortletException, IOException, PortletContainerException {

-    	

-    	ensureInitialized();

-    	

-        InternalPortletWindow internalPortletWindow =

-            	new PortletWindowImpl(servletContext, portletWindow);

-    	debugWithName("Action request received for portlet: "

-    			+ portletWindow.getPortletName());

-    	

-        ActionRequestImpl actionRequest = new ActionRequestImpl(

-        		this, internalPortletWindow, request);

-        ActionResponseImpl actionResponse = new ActionResponseImpl(

-        		this, internalPortletWindow, request, response);

-        

-        PortletInvoker invoker = new PortletInvoker(internalPortletWindow);

-        invoker.action(actionRequest, actionResponse);

-        debugWithName("Portlet action processed for: "

-        		+ portletWindow.getPortletName());

-        

-        // After processing action, send a redirect URL for rendering.

-        String location = actionResponse.getRedirectLocation();

-

-        if (location == null) {

-        	

-        	// Create portlet URL provider to encode redirect URL.

-        	debugWithName("No redirect location specified.");

-            PortletURLProvider redirectURL = requiredContainerServices

-            		.getPortalCallbackService()

-            		.getPortletURLProvider(request, internalPortletWindow);

-            

-            // Encode portlet mode if it is changed.

-            if (actionResponse.getChangedPortletMode() != null) {

-                redirectURL.setPortletMode(

-                		actionResponse.getChangedPortletMode());

-            }

-            

-            // Encode window state if it is changed.

-            if (actionResponse.getChangedWindowState() != null) {

-                redirectURL.setWindowState(

-                		actionResponse.getChangedWindowState());

-            }

-            

-            // Encode render parameters retrieved from action response.

-            Map renderParameters = actionResponse.getRenderParameters();

-            redirectURL.clearParameters();

-            redirectURL.setParameters(renderParameters);

-            

-            // Encode redirect URL as a render URL.

-            redirectURL.setAction(false);

-            

-            // Set secure of the redirect URL if necessary.

-            if (actionRequest.isSecure()) {

-                redirectURL.setSecure();

-            }

-            

-            // Encode the redirect URL to a string.

-            location = actionResponse.encodeRedirectURL(redirectURL.toString());

-        }

-

-        // Here we intentionally use the original response

-        // instead of the wrapped internal response.

-        response.sendRedirect(location);

-        debugWithName("Redirect URL sent.");

-    }

-

-    /**

-     * Loads the portlet associated with the specified portlet window.

-     * @param portletWindow  the portlet window.

-     * @param request  the servlet request.

-     * @param response  the servlet response.

-     * @throws PortletException

-     * @throws IOException

-     * @throws PortletContainerException

-     */

-    public void doLoad(PortletWindow portletWindow,

-                       HttpServletRequest request,

-                       HttpServletResponse response)

-    throws PortletException, IOException, PortletContainerException {

-    	

-    	ensureInitialized();

-    	

-        InternalPortletWindow internalPortletWindow =

-        		new PortletWindowImpl(servletContext, portletWindow);

-        debugWithName("Load request received for portlet: "

-        		+ portletWindow.getPortletName());

-        

-        RenderRequestImpl renderRequest = new RenderRequestImpl(

-        		this, internalPortletWindow, request);

-        RenderResponseImpl renderResponse = new RenderResponseImpl(

-        		this, internalPortletWindow, request, response);

-        

-        PortletInvoker invoker = new PortletInvoker(internalPortletWindow);

-        invoker.load(renderRequest, renderResponse);

-        debugWithName("Portlet loaded for: " + portletWindow.getPortletName());

-    }

-

-    public String getName() {

-        return name;

-    }

-

-    public RequiredContainerServices getRequiredContainerServices() {

-        return requiredContainerServices;

-    }

-

-    /**

-     * Retrieve the optional container services used by the container.

-     * If no implementation was provided during construction, the default

-     * instance will be returned.

-     *

-     * @return services used by the container.

-     */

-    public OptionalContainerServices getOptionalContainerServices() {

-        return optionalContainerServices;

-    }

-    

-    public PortletAppDD getPortletApplicationDescriptor(String context) 

-        throws PortletContainerException {

-        

-        // make sure the container has initialized

-        ensureInitialized();

-        

-        // sanity check

-        if (context == null || context.trim().equals("")) {

-            final String msg = "Context was null or the empty string.";

-            errorWithName(msg);

-            throw new PortletContainerException(msg);

-        }

-        

-        // obtain the context of the portlet

-        ServletContext portletCtx = servletContext.getContext(context);

-        if (portletCtx == null) {

-            final String msg = "Unable to obtain the servlet context for " +

-                "portlet context [" + context + "].  Ensure the portlet has " +

-                "been deployed and that cross context support is enabled.";

-            errorWithName(msg);

-            throw new PortletContainerException(msg);

-        }

-        

-        // obtain the portlet application descriptor for the portlet

-        // context.

-        PortletAppDD portletAppDD = PortletDescriptorRegistry

-                                        .getRegistry()

-                                        .getPortletAppDD(portletCtx);

-        

-        // we can't return null

-        if (portletAppDD == null) {

-            final String msg = "Obtained a null portlet application description for " +

-                "portlet context [" + context + "]";

-            errorWithName(msg);

-            throw new PortletContainerException(msg);

-        }

-        

-        return portletAppDD;        

-    }

-    

-    

-    // Private Methods ---------------------------------------------------------

-    

-    /**

-     * Ensures that the portlet container is initialized.

-     * @throws IllegalStateException  if the container is not initialized.

-     */

-    private void ensureInitialized() throws IllegalStateException {

-    	if (!isInitialized()) {

-    		throw new IllegalStateException(

-    				"Portlet container [" + name + "] is not initialized.");

-    	}

-    }

-    

-    /**

-     * Prints a message at DEBUG level with the container name prefix.

-     * @param message  log message.

-     */

-    private void debugWithName(String message) {

-    	if (LOG.isDebugEnabled()) {

-    		LOG.debug("Portlet Container [" + name + "]: " + message);

-    	}

-    }

-    

-    /**

-     * Prints a message at INFO level with the container name prefix.

-     * @param message  log message.

-     */

-    private void infoWithName(String message) {

-    	if (LOG.isInfoEnabled()) {

-    		LOG.info("Portlet Container [" + name + "]: " + message);

-    	}

-    }

-    

-    /**

-     * Prints a message at ERROR level with the container name prefix.

-     * @param message  log message.

-     */

-    private void errorWithName(String message) {

-        if (LOG.isErrorEnabled()) {

-            LOG.info("Portlet Container [" + name + "]: " + message);

-        }

-    }

-    

-}

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java b/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
deleted file mode 100644
index 1577444..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletContextManager.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.core;

-

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-import org.apache.pluto.PortletContainerException;

-import org.apache.pluto.descriptors.portlet.PortletAppDD;

-import org.apache.pluto.internal.InternalPortletContext;

-import org.apache.pluto.internal.PortletDescriptorRegistry;

-import org.apache.pluto.internal.impl.PortletContextImpl;

-import org.apache.pluto.spi.optional.PortletRegistryEvent;

-import org.apache.pluto.spi.optional.PortletRegistryListener;

-import org.apache.pluto.spi.optional.PortletRegistryService;

-

-import javax.servlet.ServletContext;

-import java.lang.reflect.Method;

-import java.net.URL;

-import java.net.MalformedURLException;

-import java.util.ArrayList;

-import java.util.HashMap;

-import java.util.HashSet;

-import java.util.Iterator;

-import java.util.List;

-import java.util.Map;

-

-/**

- * Manager used to cache the portlet configurations which have

- * been previously parsed.

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @version 1.0

- * @since Sep 20, 2004

- */

-public class PortletContextManager implements PortletRegistryService {

-

-    /**

-     * Log Instance

-     */

-    private static final Log LOG = LogFactory.getLog(PortletContextManager.class);

-

-    /**

-     * The singleton manager instance.

-     */

-    private static final PortletContextManager MANAGER = new PortletContextManager();

-

-    // Private Member Variables ------------------------------------------------

-

-    /**

-     * The PortletContext cache map: key is servlet context, and value is the

-     * associated portlet context.

-     */

-    private Map portletContexts = new HashMap();

-

-    /**

-     * The registered listeners that should be notified upon

-     * registry events.

-     */

-    private List registryListeners = new ArrayList();

-

-    // Constructor -------------------------------------------------------------

-

-    /**

-     * Private constructor that prevents external instantiation.

-     */

-    private PortletContextManager() {

-        // Do nothing.

-    }

-

-    /**

-     * Returns the singleton manager instance.

-     *

-     * @return the singleton manager instance.

-     */

-    public static PortletContextManager getManager() {

-        return MANAGER;

-    }

-

-    // Public Methods ----------------------------------------------------------

-

-    /**

-     * Retrieves the PortletContext associated with the given ServletContext.

-     * If one does not exist, it is created.

-     *

-     * @param servletContext the servlet context.

-     * @return the InternalPortletContext associated with the ServletContext.

-     * @throws PortletContainerException

-     */

-    public InternalPortletContext register(ServletContext servletContext)

-        throws PortletContainerException {

-        String applicationId = getContextPath(servletContext);

-        if (!portletContexts.containsKey(servletContext)) {

-

-            PortletAppDD portletAppDD = PortletDescriptorRegistry.getRegistry()

-                .getPortletAppDD(servletContext);

-

-            PortletContextImpl portletContext = new PortletContextImpl(

-                applicationId,  servletContext, portletAppDD);

-

-            if (portletContext.getApplicationId() == null) {

-                throw new IllegalStateException("Unable to resolve unique identifier for portletContext.");

-            }

-            portletContexts.put(applicationId, portletContext);

-            fireRegistered(portletContext);

-        }

-        return (InternalPortletContext)portletContexts.get(applicationId);

-    }

-

-    public void remove(InternalPortletContext context) {

-        portletContexts.remove(context);

-        fireRemoved(context);

-    }

-

-

-    public Iterator getRegisteredPortletApplications() throws PortletContainerException {

-        return new HashSet(portletContexts.values()).iterator();

-    }

-

-    public PortletAppDD getPortletApplicationDescriptor(String name) throws PortletContainerException {

-        InternalPortletContext ipc = (InternalPortletContext) portletContexts.get(name);

-        if (ipc != null) {

-            return ipc.getPortletApplicationDefinition();

-        }

-        return null;

-    }

-

-    public void addPortletRegistryListener(PortletRegistryListener listener) {

-        registryListeners.add(listener);

-    }

-

-    public void removePortletRegistryListener(PortletRegistryListener listener) {

-        registryListeners.remove(listener);

-    }

-

-    private void fireRegistered(InternalPortletContext context) {

-        PortletRegistryEvent event = new PortletRegistryEvent();

-        event.setApplicationId(context.getApplicationId());

-        event.setPortletApplicationDescriptor(context.getPortletApplicationDefinition());

-

-        Iterator i = registryListeners.iterator();

-        while (i.hasNext()) {

-            ((PortletRegistryListener) i.next()).portletApplicationRegistered(event);

-        }

-

-        LOG.info("Portlet Context '" + context.getApplicationId() + "' registered.");

-    }

-

-    private void fireRemoved(InternalPortletContext context) {

-        PortletRegistryEvent event = new PortletRegistryEvent();

-        event.setApplicationId(context.getApplicationId());

-        event.setPortletApplicationDescriptor(context.getPortletApplicationDefinition());

-

-        Iterator i = registryListeners.iterator();

-        while (i.hasNext()) {

-            ((PortletRegistryListener) i.next()).portletApplicationRemoved(event);

-        }

-

-        LOG.info("Portlet Context '" + context.getApplicationId() + "' removed.");

-    }

-

-

-//

-// Utility

-

-    /**

-     * Servlet 2.5 ServletContext.getContextPath() method.

-     */

-    private static Method contextPathGetter;

-

-    static {

-        try {

-            contextPathGetter = ServletContext.class.getMethod("getContextPath", new Class[0]);

-        }

-        catch (NoSuchMethodException e) {

-            LOG.warn("Servlet 2.4 or below detected.  Unable to find getContextPath on ServletContext.");

-        }

-    }

-

-    protected String getContextPath(ServletContext context) {

-        String contextPath = null;

-        if (contextPathGetter != null) {

-            try {

-                contextPath = (String) contextPathGetter.invoke(context, new Class[0]);

-            } catch (Exception e) {

-                LOG.warn("Unable to directly retrieve context path from ServletContext. Computing. . . ");

-            }

-        }

-

-        if(contextPath == null) {

-            contextPath = computeContextPath(context);

-        }

-

-        return contextPath;

-    }

-

-    private static final String WEB_XML = "/WEB-INF/web.xml";

-

-    protected String computeContextPath(ServletContext context) {

-        try {

-            URL webXmlUrl = context.getResource(WEB_XML);

-            String path = webXmlUrl.toExternalForm();

-            path = path.substring(0, path.indexOf(WEB_XML));

-            path = path.substring(path.lastIndexOf("/"));

-

-            int id = path.indexOf(".war");

-            if(id > 0) {

-                path = path.substring(0, id);

-            }

-

-            return path;

-        } catch (MalformedURLException e) {

-            LOG.warn("Erorr retrieving web.xml from ServletContext. Unable to derive contextPath.");

-            return null;

-        }

-    }

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletInvoker.java b/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletInvoker.java
deleted file mode 100644
index 6339df6..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletInvoker.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.core;

-

-import java.io.IOException;

-

-import javax.portlet.PortletException;

-import javax.servlet.RequestDispatcher;

-import javax.servlet.ServletContext;

-import javax.servlet.http.HttpServletRequest;

-import javax.servlet.http.HttpServletResponse;

-

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-import org.apache.pluto.Constants;

-import org.apache.pluto.internal.InternalPortletWindow;

-import org.apache.pluto.internal.impl.ActionRequestImpl;

-import org.apache.pluto.internal.impl.ActionResponseImpl;

-import org.apache.pluto.internal.impl.PortletRequestImpl;

-import org.apache.pluto.internal.impl.PortletResponseImpl;

-import org.apache.pluto.internal.impl.RenderRequestImpl;

-import org.apache.pluto.internal.impl.RenderResponseImpl;

-import org.apache.pluto.util.StringManager;

-

-/**

- * Used internally to invoke/dispatch requests from the container to

- * the portlet application.

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-class PortletInvoker {

-

-    /** Logger.  */

-    private static final Log LOG = LogFactory.getLog(PortletInvoker.class);

-

-    /** Exception Messages. */

-    private static final StringManager EXCEPTIONS = StringManager.getManager(

-    		PortletInvoker.class.getPackage().getName());

-    

-    

-    // Private Member Variables ------------------------------------------------

-    

-    /** Portlet Window for which we are invoking the portlet. */

-    private InternalPortletWindow portletWindow = null;

-    

-    

-    // Constructor -------------------------------------------------------------

-    

-    /**

-     * Default Constructor.  Create a new invoker which

-     * is initialized for the given <code>InternalPortletWindow</code>.

-     *

-     * @param portletWindow  the portlet window.

-     */

-    public PortletInvoker(InternalPortletWindow portletWindow) {

-        this.portletWindow = portletWindow;

-    }

-    

-    

-    // Public Methods ----------------------------------------------------------

-    

-    /**

-     * Invoke the portlet with an action request.

-     *

-     * @param request action request used for the invocation.

-     * @param response action response used for the invocation.

-     * @throws PortletException if a error occurs within the portlet.

-     * @throws IOException if an IO error occurs writing the response.

-     *

-     * @see PortletServlet

-     * @see javax.portlet.Portlet#processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)

-     */

-    public void action(ActionRequestImpl request, ActionResponseImpl response)

-    throws PortletException, IOException {

-        if (LOG.isDebugEnabled()) {

-            LOG.debug("Performing Action Invocation");

-        }

-        invoke(request, response, Constants.METHOD_ACTION);

-    }

-

-    /**

-     * Invoke the portlet with a render request.

-     *

-     * @param request action request used for the invocation.

-     * @param response action response used for the invocation.

-     * @throws PortletException if a error occurs within the portlet.

-     * @throws IOException if an IO error occurs writing the response.

-     *

-     * @see PortletServlet

-     * @see javax.portlet.Portlet#render(javax.portlet.RenderRequest, javax.portlet.RenderResponse)

-     */

-    public void render(RenderRequestImpl request, RenderResponseImpl response)

-    throws PortletException, IOException {

-        if (LOG.isDebugEnabled()) {

-            LOG.debug("Performing Render Invocation");

-        }

-        invoke(request, response, Constants.METHOD_RENDER);

-    }

-

-    /**

-     * Invoke the portlet with a load request.

-     *

-     * @param request action request used for the invocation.

-     * @param response action response used for the invocation.

-     * @throws PortletException if a error occurs within the portlet.

-     *

-     * @see PortletServlet

-     */

-    public void load(PortletRequestImpl request, PortletResponseImpl response)

-    throws PortletException, IOException {

-        if (LOG.isDebugEnabled()) {

-            LOG.debug("Performing Load Invocation");

-        }

-        invoke(request, response, Constants.METHOD_NOOP);

-    }

-    

-    

-    // Private Invoke Method ---------------------------------------------------

-    

-    /**

-     * Perform the invocation.

-     *

-     * @param request portlet request

-     * @param response portlet response

-     * @param methodID method identifier

-     * @throws PortletException if a portlet exception occurs.

-     * @throws IOException if an error occurs writing to the response.

-     */

-    private void invoke(PortletRequestImpl request,

-                        PortletResponseImpl response,

-                        Integer methodID)

-    throws PortletException, IOException {

-

-        String uri = portletWindow.getPortletEntity().getControllerServletUri();

-        if (LOG.isDebugEnabled()) {

-        	LOG.debug("Dispatching to portlet servlet at: " + uri);

-        }

-        

-        ServletContext servletContext = portletWindow.getServletContext();

-        RequestDispatcher dispatcher = servletContext.getRequestDispatcher(uri);

-

-        if (dispatcher != null) {

-            try {

-                // Tomcat does not like to properly include wrapped requests

-                // and responses. Thus we "unwrap" and then include.

-                HttpServletRequest servletRequest =

-                		request.getHttpServletRequest();

-                HttpServletResponse servletResponse =

-                		response.getHttpServletResponse();

-                

-                servletRequest.setAttribute(Constants.METHOD_ID, methodID);

-                servletRequest.setAttribute(Constants.PORTLET_REQUEST, request);

-                servletRequest.setAttribute(Constants.PORTLET_RESPONSE, response);

-                

-                dispatcher.include(servletRequest, servletResponse);

-

-            } catch (javax.servlet.UnavailableException ex) {

-                int seconds = ex.isPermanent()?-1:ex.getUnavailableSeconds();

-                String message =  EXCEPTIONS.getString(

-                    "error.portlet.invoker.unavailable",

-                    uri, new String[] {String.valueOf(seconds)}

-                );

-                if (LOG.isErrorEnabled()) {

-                    LOG.error(message, ex);

-                }

-                throw new javax.portlet.UnavailableException(

-                        message, seconds);

-                

-            } catch (javax.servlet.ServletException ex) {

-                String message = EXCEPTIONS.getString("error.portlet.invoker");

-                if(LOG.isErrorEnabled()) {

-                    LOG.error(message);

-                }

-

-                if (ex.getRootCause() != null &&

-                    ex.getRootCause() instanceof PortletException) {

-                        throw (PortletException) ex.getRootCause();

-                }

-                else if(ex.getRootCause() != null) {

-                    throw new PortletException(ex.getRootCause());

-                }

-                else {

-                    throw new PortletException(ex);

-                }

-                

-            } finally {

-                request.removeAttribute(Constants.METHOD_ID);

-                request.removeAttribute(Constants.PORTLET_REQUEST);

-                request.removeAttribute(Constants.PORTLET_RESPONSE);

-            }

-        } else {

-            String msg = EXCEPTIONS.getString(

-                "error.portlet.invoker.dispatcher",

-                new String[] {servletContext.getServletContextName(), uri}

-            );

-            if (LOG.isErrorEnabled()) {

-                LOG.error(msg);

-            }

-            throw new PortletException(msg);

-        }

-    }

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletServlet.java b/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletServlet.java
deleted file mode 100644
index 6a5c9ea..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/core/PortletServlet.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.core;

-

-import org.apache.pluto.Constants;

-import org.apache.pluto.PortletContainerException;

-import org.apache.pluto.descriptors.portlet.PortletAppDD;

-import org.apache.pluto.descriptors.portlet.PortletDD;

-import org.apache.pluto.internal.InternalPortletConfig;

-import org.apache.pluto.internal.InternalPortletContext;

-import org.apache.pluto.internal.InternalPortletRequest;

-import org.apache.pluto.internal.InternalPortletResponse;

-import org.apache.pluto.internal.impl.ActionRequestImpl;

-import org.apache.pluto.internal.impl.ActionResponseImpl;

-import org.apache.pluto.internal.impl.PortletConfigImpl;

-import org.apache.pluto.internal.impl.RenderRequestImpl;

-import org.apache.pluto.internal.impl.RenderResponseImpl;

-

-import javax.portlet.Portlet;

-import javax.portlet.PortletException;

-import javax.servlet.ServletContext;

-import javax.servlet.ServletException;

-import javax.servlet.http.HttpServlet;

-import javax.servlet.http.HttpServletRequest;

-import javax.servlet.http.HttpServletResponse;

-import java.io.IOException;

-import java.util.Iterator;

-

-/**

- * Portlet Invocation Servlet. This servlet recieves cross context requests from

- * the the container and services the portlet request for the specified method.

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @version 1.1

- * @since 09/22/2004

- */

-public class PortletServlet extends HttpServlet {

-

-    // Private Member Variables ------------------------------------------------

-

-    /**

-     * The portlet name as defined in the portlet app descriptor.

-     */

-    private String portletName = null;

-

-    /**

-     * The portlet instance wrapped by this servlet.

-     */

-    private Portlet portlet = null;

-

-    /**

-     * The internal portlet context instance.

-     */

-    private InternalPortletContext portletContext = null;

-

-    /**

-     * The internal portlet config instance.

-     */

-    private InternalPortletConfig portletConfig = null;

-

-    // HttpServlet Impl --------------------------------------------------------

-

-    public String getServletInfo() {

-        return "Pluto PortletServlet [" + portletName + "]";

-    }

-

-    /**

-     * Initialize the portlet invocation servlet.

-     *

-     * @throws ServletException if an error occurs while loading portlet.

-     */

-    public void init() throws ServletException {

-

-        // Call the super initialization method.

-        super.init();

-

-        // Retrieve portlet name as defined as an initialization parameter.

-        portletName = getInitParameter("portlet-name");

-

-        // Retrieve the associated internal portlet context.

-        ServletContext servletContext = getServletContext();

-        try {

-            portletContext = PortletContextManager.getManager()

-                .register(servletContext);

-

-        } catch (PortletContainerException ex) {

-            throw new ServletException(ex);

-        }

-

-        // Retrieve the portletDD and create portlet config.

-        PortletDD portletDD = null;

-        PortletAppDD portletAppDD =

-            portletContext.getPortletApplicationDefinition();

-        for (Iterator it = portletAppDD.getPortlets().iterator();

-             it.hasNext();) {

-            PortletDD currentDD = (PortletDD) it.next();

-            if (currentDD.getPortletName().equals(portletName)) {

-                portletDD = currentDD;

-                break;

-            }

-        }

-        if (portletDD == null) {

-            throw new ServletException("Unable to resolve portlet '"

-                + portletName + "'");

-        }

-        portletConfig = new PortletConfigImpl(getServletConfig(),

-            portletContext,

-            portletDD);

-

-        // Create and initialize the portlet wrapped in the servlet.

-        try {

-            ClassLoader loader = Thread.currentThread().getContextClassLoader();

-            Class clazz = loader.loadClass((portletDD.getPortletClass()));

-            portlet = (Portlet) clazz.newInstance();

-            portlet.init(portletConfig);

-        } catch (ClassNotFoundException ex) {

-            ex.printStackTrace();

-            throw new ServletException(ex);

-        } catch (IllegalAccessException ex) {

-            ex.printStackTrace();

-            throw new ServletException(ex);

-        } catch (InstantiationException ex) {

-            ex.printStackTrace();

-            throw new ServletException(ex);

-        } catch (PortletException ex) {

-            ex.printStackTrace();

-            throw new ServletException(ex);

-        }

-    }

-

-    public void destroy() {

-        PortletContextManager.getManager().remove(portletContext);

-        if (portlet != null) {

-            portlet.destroy();

-        }

-        super.destroy();

-    }

-

-    protected void doGet(HttpServletRequest request,

-                         HttpServletResponse response)

-        throws ServletException, IOException {

-        dispatch(request, response);

-    }

-

-    protected void doPost(HttpServletRequest request,

-                          HttpServletResponse response)

-        throws ServletException, IOException {

-        dispatch(request, response);

-    }

-

-    protected void doPut(HttpServletRequest request,

-                         HttpServletResponse response)

-        throws ServletException, IOException {

-        dispatch(request, response);

-    }

-

-    // Private Methods ---------------------------------------------------------

-

-    /**

-     * Dispatch the request to the appropriate portlet methods. This method

-     * assumes that the following attributes are set in the servlet request

-     * scope:

-     * <ul>

-     * <li>METHOD_ID: indicating which method to dispatch.</li>

-     * <li>PORTLET_REQUEST: the internal portlet request.</li>

-     * <li>PORTLET_RESPONSE: the internal portlet response.</li>

-     * </ul>

-     *

-     * @param request  the servlet request.

-     * @param response the servlet response.

-     * @throws ServletException

-     * @throws IOException

-     */

-    private void dispatch(HttpServletRequest request,

-                          HttpServletResponse response)

-        throws ServletException, IOException {

-        InternalPortletRequest portletRequest = null;

-        InternalPortletResponse portletResponse = null;

-        try {

-

-            // Save portlet config into servlet request.

-            request.setAttribute(Constants.PORTLET_CONFIG, portletConfig);

-

-            // Retrieve attributes from the servlet request.

-            Integer methodId = (Integer) request.getAttribute(

-                Constants.METHOD_ID);

-            portletRequest = (InternalPortletRequest) request.getAttribute(

-                Constants.PORTLET_REQUEST);

-            portletResponse = (InternalPortletResponse) request.getAttribute(

-                Constants.PORTLET_RESPONSE);

-            portletRequest.init(portletContext, request);

-

-            // The requested method is RENDER: call Portlet.render(..)

-            if (methodId == Constants.METHOD_RENDER) {

-                RenderRequestImpl renderRequest =

-                    (RenderRequestImpl) portletRequest;

-                RenderResponseImpl renderResponse =

-                    (RenderResponseImpl) portletResponse;

-                portlet.render(renderRequest, renderResponse);

-

-            }

-

-            // The requested method is ACTION: call Portlet.processAction(..)

-            else if (methodId == Constants.METHOD_ACTION) {

-                ActionRequestImpl actionRequest =

-                    (ActionRequestImpl) portletRequest;

-                ActionResponseImpl actionResponse =

-                    (ActionResponseImpl) portletResponse;

-                portlet.processAction(actionRequest, actionResponse);

-            }

-

-            // The requested method is NOOP: do nothing.

-            else if (methodId == Constants.METHOD_NOOP) {

-                // Do nothing.

-            }

-

-        } catch (javax.portlet.UnavailableException ex) {

-            ex.printStackTrace();

-            /*

-            if (e.isPermanent()) {

-                throw new UnavailableException(e.getMessage());

-            } else {

-                throw new UnavailableException(e.getMessage(), e.getUnavailableSeconds());

-            }*/

-

-            // Portlet.destroy() isn't called by Tomcat, so we have to fix it.

-            try {

-                portlet.destroy();

-            } catch (Throwable th) {

-                // Don't care for Exception

-            }

-

-            // TODO: Handle everything as permanently for now.

-            throw new javax.servlet.UnavailableException(ex.getMessage());

-

-        } catch (PortletException ex) {

-            ex.printStackTrace();

-            throw new ServletException(ex);

-

-        } finally {

-            request.removeAttribute(Constants.PORTLET_CONFIG);

-            if (portletRequest != null) {

-                portletRequest.release();

-            }

-        }

-    }

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/core/UserInfoAttribute.java b/trunk/pluto-container/src/main/java/org/apache/pluto/core/UserInfoAttribute.java
deleted file mode 100644
index e427449..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/core/UserInfoAttribute.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.core;

-

-/**

- * Encapsulates a user information attribute as described in

- * PLT.17 of the JSR-168 specification.

- * 

- * @author <a href="cdoremus@apache.org">Craig Doremus</a>

- */

-public interface UserInfoAttribute {

-

-    String getName();

-

-    String getValue();

-

-    String getAuthUser();

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/Configuration.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/Configuration.java
deleted file mode 100644
index ae2a7fc..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/Configuration.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal;

-

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-

-import java.util.ResourceBundle;

-import java.util.PropertyResourceBundle;

-

-/**

- * Central location for Configuration info.

- *

- * @author ddewolf@apache.org

- * @since Jul 2, 2005

- */

-class Configuration {

-    

-    private static final Log LOG = 

-            LogFactory.getLog(Configuration.class);

-

-    public static final ResourceBundle BUNDLE =

-        PropertyResourceBundle.getBundle("org.apache.pluto.core.pluto-configuration");

-

-    private static final String DESCRIPTOR_SERVICE =

-        "org.apache.pluto.descriptors.services.PortletAppDescriptorService";

-            

-

-    public static String getPortletAppDescriptorServiceImpl() {

-        String impl =  BUNDLE.getString(DESCRIPTOR_SERVICE);

-        if(LOG.isDebugEnabled()) {

-            LOG.debug("Using Descriptor Service Impl: "+impl);

-        }

-        return impl;

-    }

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionRequest.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionRequest.java
deleted file mode 100644
index 41f4cef..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionRequest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal;

-

-/**

- * The internal action request extends the internal portlet request and provides

- * some action-specific methods (currently, no specific methods are declared).

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @since 2006-02-17

- */

-public interface InternalActionRequest extends InternalPortletRequest {

-	

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionResponse.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionResponse.java
deleted file mode 100644
index bdeaa25..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalActionResponse.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal;

-

-import java.util.Map;

-

-import javax.portlet.PortletMode;

-import javax.portlet.WindowState;

-

-/**

- * The internal action response interface extends the internal portlet response

- * interface and provides some action-specific methods.

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public interface InternalActionResponse extends InternalPortletResponse {

-

-    /**

-     * Retrieves the render parameters associated with this response.

-     * @return map of all render parameters associated with this request.

-     */

-    public Map getRenderParameters();

-

-    /**

-     * Retrieve the portlet mode.

-     * @return the changed portlet mode.

-     */

-    public PortletMode getChangedPortletMode();

-

-    /**

-     * Retrieve the window state.

-     * @return the changed window state.

-     */

-    public WindowState getChangedWindowState();

-

-    /**

-     * Retreive the location for which the action should

-     * be redirected.

-     * @return the redirect location.

-     */

-    public String getRedirectLocation();

-    

-}

-

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletConfig.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletConfig.java
deleted file mode 100644
index c837ac7..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletConfig.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal;

-

-import javax.portlet.PortletConfig;

-import javax.servlet.ServletConfig;

-

-import org.apache.pluto.descriptors.portlet.PortletDD;

-

-public interface InternalPortletConfig extends PortletConfig {

-

-    public ServletConfig getServletConfig();

-

-    public PortletDD getPortletDefinition();

-}

-

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletContext.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletContext.java
deleted file mode 100644
index 4b1f06c..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletContext.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal;

-

-import javax.portlet.PortletContext;

-import javax.servlet.ServletContext;

-

-import org.apache.pluto.descriptors.portlet.PortletAppDD;

-

-public interface InternalPortletContext extends PortletContext {

-

-    /**

-     * Retrieve the unique identifier for the portlet context.

-     * @return unique identifier.

-     */

-    public String getApplicationId();

-

-    /**

-     *

-     * @return servlet context within which we belong

-     */

-    public ServletContext getServletContext();

-

-    /**

-     *

-     * @return application config

-     */

-    public PortletAppDD getPortletApplicationDefinition();

-}

-

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletPreference.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletPreference.java
deleted file mode 100644
index 861421b..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletPreference.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal;

-

-/**

- * This class represents a portlet preference, which is a name-value pair.

- * 

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public interface InternalPortletPreference {

-	

-	/**

-	 * Returns the name of this portlet preference.

-	 * @return the name of this portlet preference.

-	 */

-    public String getName();

-    

-    /**

-     * Returns the values of this portlet preference, which is a string array.

-     * @return the values of this portlet preference as a string array.

-     */

-    public String[] getValues();

-    

-    /**

-     * Sets values of this portlet preference.

-     * @param values  values of this portlet preference to set.

-     */

-    public void setValues(String[] values);

-    

-    /**

-     * Returns true if this portlet preference is marked as read-only.

-     * @return true if this portlet preference is marked as read-only.

-     */

-    public boolean isReadOnly();

-    

-    /**

-     * Clone a copy of itself.

-     * @return a copy of itself.

-     */

-    public Object clone();

-    

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletRequest.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletRequest.java
deleted file mode 100644
index e29da08..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletRequest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal;

-

-import org.apache.pluto.PortletContainer;

-

-import javax.portlet.PortletRequest;

-import javax.portlet.PortletContext;

-import javax.servlet.http.HttpServletRequest;

-

-/**

- * The internal portlet request interface extends PortletRequest and adds

- * some methods used by Pluto.

- * 

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public interface InternalPortletRequest extends PortletRequest {

-

-    /**

-     * Initializes the portlet request for use within the target context.

-     * This method ensures that the portlet utilizes resources from the

-     * <b>included</b> context, and not those from the intiating (portal)

-     * context.

-     * 

-     * @param context  the target portlet context.

-     * @param request  the servlet request.

-     */

-    public void init(PortletContext context, HttpServletRequest request);

-

-    /**

-     * Recycle the request by rolling the underlying request

-     * back to the originating request.

-     */

-    public void release();

-

-    public InternalPortletWindow getInternalPortletWindow();

-

-    public PortletContainer getPortletContainer();

-

-    public HttpServletRequest getHttpServletRequest();

-    

-}

-

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletResponse.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletResponse.java
deleted file mode 100644
index 43ccee9..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletResponse.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal;

-

-import javax.portlet.PortletResponse;

-

-/**

- * The internal portlet response interface extends PortletResponse and adds

- * some methods used by Pluto.

- * 

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public interface InternalPortletResponse extends PortletResponse {

-

-    public InternalPortletWindow getInternalPortletWindow();

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletWindow.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletWindow.java
deleted file mode 100644
index e2b7912..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalPortletWindow.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal;

-

-import javax.servlet.ServletContext;

-

-import org.apache.pluto.PortletWindow;

-

-

-/**

- * The internal portlet window represents a single window of a portlet instance

- * as it can be shown only once on a single page. There is a one-to-one relation

- * between portlet windows and portlet entities. Adding the same portlet e.g.

- * twice on a page results in two different windows.

- * 

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public interface InternalPortletWindow extends PortletWindow {

-

-    /**

-     * The Context from which this window can be serviced.

-     * @return the associated servlet context.

-     */

-    public ServletContext getServletContext();

-

-    /**

-     * Returns the portlet entity. The return value cannot be NULL.

-     * @return the portlet entity

-     */

-    public PortletEntity getPortletEntity();

-    

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderRequest.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderRequest.java
deleted file mode 100644
index ee29beb..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderRequest.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal;

-

-/**

- * The internal render request interface extends the internal portlet request

- * interface and provides some render-specific methods.

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @since 2006-02-17

- */

-public interface InternalRenderRequest extends InternalPortletRequest {

-	

-    public void setIncluded(boolean included);

-    

-    public boolean isIncluded();

-    

-    public void setIncludedQueryString(String queryString);

-    

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderResponse.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderResponse.java
deleted file mode 100644
index 9be7e9f..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/InternalRenderResponse.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal;

-

-/**

- * The internal render response interface extends the internal portlet response

- * interface and provides some render-specific methods.

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @since 2006-02-17

- */

-public interface InternalRenderResponse extends InternalPortletResponse {

-	

-    public void setIncluded(boolean included);

-

-    public boolean isIncluded();

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/PortletDescriptorRegistry.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/PortletDescriptorRegistry.java
deleted file mode 100644
index e218d64..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/PortletDescriptorRegistry.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal;

-

-import org.apache.pluto.PlutoConfigurationException;

-import org.apache.pluto.PortletContainerException;

-import org.apache.pluto.descriptors.portlet.PortletAppDD;

-import org.apache.pluto.descriptors.services.PortletAppDescriptorService;

-import org.apache.pluto.util.StringManager;

-

-import javax.servlet.ServletContext;

-import java.io.IOException;

-import java.io.InputStream;

-import java.util.Map;

-import java.util.WeakHashMap;

-

-/**

- * Simple caching mechanism used to manage portlet descriptors. This mechanism

- * takes special considerations to make sure that the cache is invalidated for

- * any ServletContext that is destroyed, thus allowing for a the context to be

- * redeployed.

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @version 1.0

- * @since Nov 3, 2004

- */

-public class PortletDescriptorRegistry {

-	

-    /** Portlet deployment descriptor location. */

-    private static final String PORTLET_XML = "/WEB-INF/portlet.xml";

-

-    /** Exception Messages. */

-    private static final StringManager EXCEPTIONS = StringManager.getManager(

-            PortletDescriptorRegistry.class.getPackage().getName());

-    

-    /** The static singleton registry instance. */

-    private static final PortletDescriptorRegistry REGISTRY =

-    		new PortletDescriptorRegistry();

-    

-    

-    // Private Member Variables ------------------------------------------------

-    

-    /** The portlet application descriptor service. */

-    private PortletAppDescriptorService portletDDService = null;

-    

-    /**

-     * Cache of descriptors.  WeakHashMap is used so that

-     * once the context is destroyed (kinda), the cache is eliminated.

-     * Ideally we'd use a ServletContextListener, but at this

-     * point I'm wondering if we really want to add another

-     * config requirement in the servlet xml? Hmm. . .

-     */

-    private Map cache = new WeakHashMap();

-

-    

-    // Constructor -------------------------------------------------------------

-    

-    /**

-     * Returns the singleton registry instance.

-     * @return the singleton registry instance.

-     */

-    public static PortletDescriptorRegistry getRegistry() {

-        return REGISTRY;

-    }

-

-    /**

-     * Private constructor that prevents external instantiation.

-     * We must modify the context class loader in order for

-     * the Configuration utility to find the properties file.

-     * @throws PlutoConfigurationException  if fail to instantiate portlet

-     *         application descriptor service.

-     */

-    private PortletDescriptorRegistry()

-    throws PlutoConfigurationException {

-        String className = Configuration.getPortletAppDescriptorServiceImpl();

-        try {

-            Class clazz = Class.forName(className);

-            portletDDService = (PortletAppDescriptorService) clazz.newInstance();

-        } catch (ClassNotFoundException ex) {

-            throw new PlutoConfigurationException(

-            		"Unable to find class " + className, ex);

-        } catch (InstantiationException ex) {

-            throw new PlutoConfigurationException(

-            		"Unable to instantiate class " + className, ex);

-        } catch (IllegalAccessException ex) {

-            throw new PlutoConfigurationException(

-            		"Unable to access class " + className, ex);

-        }

-    }

-    

-    

-    // Public Methods ----------------------------------------------------------

-    

-    /**

-     * Retrieve the Portlet Application Deployment Descriptor for the given

-     * servlet context.  Create it if it does not allready exist.

-     *

-     * @param servletContext  the servlet context.

-     * @return The portlet application deployment descriptor.

-     * @throws PortletContainerException

-     */

-    public PortletAppDD getPortletAppDD(ServletContext servletContext)

-    throws PortletContainerException {

-        PortletAppDD portletAppDD = (PortletAppDD) cache.get(servletContext);

-        if (portletAppDD == null) {

-        	portletAppDD = createDefinition(servletContext);

-            cache.put(servletContext, portletAppDD);

-        }

-        return portletAppDD;

-    }

-    

-    

-    // Private Methods ---------------------------------------------------------

-    

-    /**

-     * Creates the portlet.xml deployment descriptor representation.

-     *

-     * @param servletContext  the servlet context for which the DD is requested.

-     * @return the Portlet Application Deployment Descriptor.

-     * @throws PortletContainerException

-     */

-    private PortletAppDD createDefinition(ServletContext servletContext)

-    throws PortletContainerException {

-        PortletAppDD portletAppDD = null;

-        try {

-            InputStream in = servletContext.getResourceAsStream(PORTLET_XML);

-            portletAppDD = portletDDService.read(in);

-        } catch (IOException ex) {

-            throw new PortletContainerException(EXCEPTIONS.getString(

-                    "error.context.descriptor.load",

-                    new String[] { servletContext.getServletContextName() }),

-                    ex);

-        }

-        return portletAppDD;

-    }

-    

-}

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/PortletEntity.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/PortletEntity.java
deleted file mode 100644
index fe97c0c..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/PortletEntity.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal;

-

-import org.apache.pluto.internal.InternalPortletPreference;

-import org.apache.pluto.descriptors.portlet.PortletDD;

-import org.apache.pluto.descriptors.servlet.ServletDD;

-

-import javax.portlet.PreferencesValidator;

-import javax.portlet.ValidatorException;

-

-/**

- * The PortletEntity encapsulates all data pertaining to a single portlet

- * instance.  This instance may appear zero or more times per user. The

- * PortletEntity consists of two primary peices of information, the Portlet

- * Definition as defined by the {@link PortletDD} and the Wrapping Servlet

- * information as defined by the{@link ServletDD}

- * 

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- */

-public interface PortletEntity {

-	

-    /**

-     * Returns the URI to the controller servlet that wraps this portlet.

-     * @return the URI to the controller servlet that wraps this portlet.

-     */

-    public String getControllerServletUri();

-    

-    /**

-     * Returns an array of default preferences of this portlet. The default

-     * preferences are retrieved from the portlet application descriptor.

-     * <p>

-     * Data retrieved from <code>portlet.xml</code> are injected into the domain

-     * object <code>PortletPreferenceDD</code>. This method converts the domain

-     * objects into <code>PortletPreference</code> objects.

-     * </p>

-     * <p>

-     * Note that if no value is bound to a given preference key,

-     * <code>PortletPreferenceDD.getValues()</code> will return an empty string

-     * list, but the value array of <code>PortletPreference</code> should be set

-     * to null (instead of an empty array).

-     * </p>

-     * <p>

-     * This method never returns null, but the values held by PortletPreference

-     * may be null.

-     * </p>

-     * @return the preference set

-     * 

-     * @see org.apache.pluto.descriptors.portlet.PortletPreferenceDD

-     */

-    public InternalPortletPreference[] getDefaultPreferences();

-

-    /**

-     * Returns the portlet description. The return value cannot be NULL.

-     * @return the portlet description.

-     */

-    public PortletDD getPortletDefinition();

-    

-    /**

-     * Returns the preferences validator instance for this portlet.

-     * One validator instance is created per portlet definition.

-     * @return the preferences validator instance for this portlet.

-     * @throws ValidatorException  if fail to instantiate the validator.

-     */

-    public PreferencesValidator getPreferencesValidator()

-    throws ValidatorException;

-    

-}

-

-

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/PreferencesValidatorRegistry.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/PreferencesValidatorRegistry.java
deleted file mode 100644
index 1eb4b16..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/PreferencesValidatorRegistry.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal;

-

-import java.util.HashMap;

-import java.util.Map;

-

-import javax.portlet.PreferencesValidator;

-import javax.portlet.ValidatorException;

-

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-import org.apache.pluto.descriptors.portlet.PortletDD;

-

-/**

- * The portlet preferences validator registry. This class caches the portlet

- * preferences validator instances for portlet definitions, and ensure that

- * only one validator instance is created per portlet definition.

- * 

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @since 2006-02-10

- */

-public class PreferencesValidatorRegistry {

-	

-	/** Logger. */

-	private static final Log LOG = LogFactory.getLog(PreferencesValidatorRegistry.class);

-	

-	/** The static singleton registry instance. */

-	private static final PreferencesValidatorRegistry REGISTRY =

-			new PreferencesValidatorRegistry();

-	

-	

-	// Private Member Variables ------------------------------------------------

-	

-	/**

-	 * The preferences validator cache: key is the portlet definition, value is

-	 * the portlet preferences validator instance.

-	 */

-	private Map cache = new HashMap();

-	

-	

-	// Constructor -------------------------------------------------------------

-	

-	/**

-	 * Private constructor that prevents external instantiation.

-	 */

-	private PreferencesValidatorRegistry() {

-		// Do nothing.

-	}

-	

-	public static PreferencesValidatorRegistry getRegistry() {

-		return REGISTRY;

-	}

-	

-	

-	// Public Methods ----------------------------------------------------------

-	

-	/**

-	 * Returns the preferences validator instance for the given portlet

-	 * definition. If no preferences validator class is defined for the portlet

-	 * definition, null is returned. This method caches the validator instances

-	 * in the cache to ensure that only one validator instance is created per

-	 * portlet definition.

-	 * @param portletDD  the portlet definition.

-	 * @return the preferences validator if defined for the portlet definition.

-	 * @throw ValidatorException  if fail to instantiate validator instance. 

-	 */

-	public PreferencesValidator getPreferencesValidator(PortletDD portletDD)

-	throws ValidatorException {

-		

-		// Try to retrieve the validator from cache.

-		PreferencesValidator validator = (PreferencesValidator)

-				cache.get(portletDD);

-		if (validator != null) {

-			return validator;

-		}

-		

-		// Try to construct the validator instance for the portlet definition.

-		String className = portletDD.getPortletPreferences()

-				.getPreferencesValidator();

-		if (className != null) {

-			if (LOG.isDebugEnabled()) {

-				LOG.debug("Creating preferences validator: " + className);

-			}

-			ClassLoader loader = Thread.currentThread().getContextClassLoader();

-			try {

-				Class clazz = loader.loadClass(className);

-			    validator = (PreferencesValidator) clazz.newInstance();

-			    cache.put(portletDD, validator);

-			} catch (InstantiationException ex) {

-				LOG.error("Error instantiating validator.", ex);

-			    throw new ValidatorException(ex, null);

-			} catch (IllegalAccessException ex) {

-				LOG.error("Error instantiating validator.", ex);

-			    throw new ValidatorException(ex, null);

-			} catch (ClassNotFoundException ex) {

-				LOG.error("Error instantiating validator.", ex);

-			    throw new ValidatorException(ex, null);

-			} catch (ClassCastException ex) {

-				LOG.error("Error casting instance to PreferencesValidator.", ex);

-				throw new ValidatorException(ex, null);

-			}

-		}

-		return validator;

-	}

-	

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/ActionRequestImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/ActionRequestImpl.java
deleted file mode 100644
index c1440ce..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/ActionRequestImpl.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import java.io.IOException;

-import java.io.InputStream;

-

-import javax.portlet.ActionRequest;

-import javax.portlet.PortletPreferences;

-import javax.servlet.http.HttpServletRequest;

-

-import org.apache.pluto.Constants;

-import org.apache.pluto.PortletContainer;

-import org.apache.pluto.internal.InternalActionRequest;

-import org.apache.pluto.internal.InternalPortletWindow;

-import org.apache.commons.logging.LogFactory;

-import org.apache.commons.logging.Log;

-

-/**

- * Implementation of the <code>javax.portlet.ActionRequest</code> interface.

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- */

-public class ActionRequestImpl extends PortletRequestImpl

-implements ActionRequest, InternalActionRequest {

-	

-	/** Logger. */

-    private static final Log LOG = LogFactory.getLog(ActionRequestImpl.class);

-    

-    

-    // Private Member Variables ------------------------------------------------

-    

-    /** FIXME: The portlet preferences. */

-    private PortletPreferences portletPreferences = null;

-    

-    

-    // Constructor -------------------------------------------------------------

-    

-    public ActionRequestImpl(PortletContainer container,

-                             InternalPortletWindow internalPortletWindow,

-                             HttpServletRequest servletRequest) {

-        super(container, internalPortletWindow, servletRequest);

-        if (LOG.isDebugEnabled()) {

-        	LOG.debug("Created action request for: " + internalPortletWindow);

-        }

-    }

-

-    // ActionRequest impl ------------------------------------------------------

-    

-    /* (non-Javadoc)

-     * FIXME: should we set the bodyAccessed flag?

-     * @see org.apache.pluto.core.InternalActionResponse#getPortletInputStream()

-     */

-    public InputStream getPortletInputStream() throws IOException {

-        HttpServletRequest servletRequest = (HttpServletRequest) getRequest();

-        if (servletRequest.getMethod().equals("POST")) {

-            String contentType = servletRequest.getContentType();

-            if (contentType == null ||

-                contentType.equals("application/x-www-form-urlencoded")) {

-                throw new IllegalStateException(

-                		"User request HTTP POST data is of type "

-                		+ "application/x-www-form-urlencoded. "

-                		+ "This data has been already processed "

-                		+ "by the portal/portlet-container and is available "

-                		+ "as request parameters.");

-            }

-        }

-        return servletRequest.getInputStream();

-    }

-

-    // PortletRequestImpl impl -------------------------------------------------

-    

-    /**

-     * FIXME: 

-     */

-    public PortletPreferences getPreferences() {

-        if (portletPreferences == null) {

-            portletPreferences = new PortletPreferencesImpl(

-            		getPortletContainer(),

-            		getInternalPortletWindow(),

-            		this,

-            		Constants.METHOD_ACTION);

-        }

-        return portletPreferences;

-    }

-    

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/ActionResponseImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/ActionResponseImpl.java
deleted file mode 100644
index 965b8dc..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/ActionResponseImpl.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import java.util.Enumeration;

-import java.util.HashMap;

-import java.util.Iterator;

-import java.util.Map;

-

-import javax.portlet.ActionResponse;

-import javax.portlet.PortalContext;

-import javax.portlet.PortletMode;

-import javax.portlet.PortletModeException;

-import javax.portlet.WindowState;

-import javax.portlet.WindowStateException;

-import javax.servlet.http.HttpServletRequest;

-import javax.servlet.http.HttpServletResponse;

-import javax.servlet.http.HttpServletResponseWrapper;

-

-import org.apache.pluto.PortletContainer;

-import org.apache.pluto.descriptors.portlet.PortletDD;

-import org.apache.pluto.descriptors.portlet.SupportsDD;

-import org.apache.pluto.internal.InternalActionResponse;

-import org.apache.pluto.internal.InternalPortletWindow;

-import org.apache.pluto.spi.ResourceURLProvider;

-import org.apache.pluto.spi.PortalCallbackService;

-import org.apache.pluto.util.StringUtils;

-

-public class ActionResponseImpl extends PortletResponseImpl

-implements ActionResponse, InternalActionResponse {

-

-    /**

-     * Is it still allowed to invoke the method sendRedirect() ?

-     */

-    boolean redirectAllowed = true;

-

-    private boolean redirected;

-    private String redirectLocation;

-

-    private Map renderParameters = new HashMap();

-    private WindowState windowState = null;

-    private PortletMode portletMode = null;

-

-    private PortalCallbackService callback;

-    private PortalContext context;

-

-

-    public ActionResponseImpl(PortletContainer container,

-                              InternalPortletWindow internalPortletWindow,

-                              HttpServletRequest servletRequest,

-                              HttpServletResponse servletResponse) {

-        super(container, internalPortletWindow, servletRequest,

-              servletResponse);

-        context = container.getRequiredContainerServices().getPortalContext();

-        callback = container.getRequiredContainerServices().getPortalCallbackService();

-    }

-

-//

-// javax.portlet.ActionResponse

-//

-    public void setWindowState(WindowState windowState)

-        throws WindowStateException {

-        if (redirected) {

-            throw new IllegalStateException(

-                "it is not allowed to invoke setWindowState after sendRedirect has been called");

-        }

-

-        if (isWindowStateAllowed(windowState)) {

-            this.windowState = windowState;

-        } else {

-            throw new WindowStateException("Can't set this WindowState",

-                                           windowState);

-        }

-        redirectAllowed = false;

-    }

-

-    public void setPortletMode(PortletMode portletMode)

-        throws PortletModeException {

-        if (redirected) {

-            throw new IllegalStateException(

-                "it is not allowed to invoke setPortletMode after sendRedirect has been called");

-        }

-

-        // check if portal supports portlet mode

-        boolean supported = isPortletModeAllowed(portletMode);

-

-

-        // if porlet mode is allowed

-        if (supported) {

-            this.portletMode = portletMode;

-        } else {

-            throw new PortletModeException("Can't set this PortletMode",

-                                           portletMode);

-        }

-

-        redirectAllowed = false;

-

-    }

-

-    public void sendRedirect(String location) throws java.io.IOException {

-        if (redirectAllowed) {

-            if (location != null) {

-                HttpServletResponse redirectResponse = getHttpServletResponse();

-                while (redirectResponse instanceof HttpServletResponseWrapper) {

-                    redirectResponse = (HttpServletResponse)

-                        ((HttpServletResponseWrapper)redirectResponse).getResponse();

-                }

-

-                ResourceURLProvider provider = callback.getResourceURLProvider(

-                                getHttpServletRequest(),

-                                getInternalPortletWindow()

-                );

-

-                if (location.indexOf("://") != -1) {

-                    provider.setAbsoluteURL(location);

-                } else {

-                    provider.setFullPath(location);

-                }

-                location =

-                redirectResponse.encodeRedirectURL(provider.toString());

-                //redirectResponse.sendRedirect(location);

-                redirectLocation = location;

-                redirected = true;

-            }

-        } else {

-            throw new java.lang.IllegalStateException(

-                "Can't invoke sendRedirect() after certain methods have been called");

-        }

-

-    }

-

-    public void setRenderParameters(Map parameters) {

-        if (redirected) {

-            throw new IllegalStateException(

-                "Can't invoke setRenderParameters() after sendRedirect() has been called");

-        }

-        if (parameters == null) {

-            throw new IllegalArgumentException(

-                "Render parameters must not be null.");

-        }

-        for (Iterator iter = parameters.entrySet().iterator(); iter.hasNext();) {

-            Map.Entry entry = (Map.Entry) iter.next();

-            if (!(entry.getKey() instanceof String)) {

-                throw new IllegalArgumentException(

-                    "Key must not be null and of type java.lang.String.");

-            }

-            if (!(entry.getValue() instanceof String[])) {

-                throw new IllegalArgumentException(

-                    "Value must not be null and of type java.lang.String[].");

-            }

-        }

-

-        renderParameters = StringUtils.copyParameters(parameters);

-

-        redirectAllowed = false;

-    }

-

-    public void setRenderParameter(String key, String value) {

-        if (redirected) {

-            throw new IllegalStateException(

-                "Can't invoke setRenderParameter() after sendRedirect() has been called");

-        }

-

-        if ((key == null) || (value == null)) {

-            throw new IllegalArgumentException(

-                "Render parameter key or value must not be null.");

-        }

-

-        renderParameters.put(key, new String[]{value});

-

-        redirectAllowed = false;

-    }

-

-    public void setRenderParameter(String key, String[] values) {

-        if (redirected) {

-            throw new IllegalStateException(

-                "Can't invoke setRenderParameter() after sendRedirect() has been called");

-        }

-

-        if (key == null || values == null || values.length == 0) {

-            throw new IllegalArgumentException(

-                "Render parameter key or value must not be null or values be an empty array.");

-        }

-

-        renderParameters.put(key, StringUtils.copy(values));

-

-        redirectAllowed = false;

-    }

-    // --------------------------------------------------------------------------------------------

-    

-    // org.apache.pluto.core.InternalActionResponse implementation --------------------------------

-    public Map getRenderParameters() {

-        return renderParameters;

-    }

-

-    public PortletMode getChangedPortletMode() {

-        return this.portletMode;

-    }

-

-    public WindowState getChangedWindowState() {

-        return this.windowState;

-    }

-

-    public String getRedirectLocation() {

-        return redirectLocation;

-    }

-

-    private boolean isPortletModeAllowed(PortletMode mode) {

-        return isPortletModeAllowedByPortlet(mode)

-               && isPortletModeAllowedByPortal(mode);

-    }

-

-    private boolean isPortletModeAllowedByPortlet(PortletMode mode) {

-        PortletDD dd = getInternalPortletWindow().getPortletEntity()

-            .getPortletDefinition();

-

-        Iterator supports = dd.getSupports().iterator();

-        while(supports.hasNext()) {

-            SupportsDD sup = (SupportsDD)supports.next();

-            Iterator modes = sup.getPortletModes().iterator();

-            while(modes.hasNext()) {

-                if (modes.next().toString().equalsIgnoreCase(mode.toString())) {

-                    return true;

-                }

-            }

-        }

-        return false;

-    }

-

-    private boolean isPortletModeAllowedByPortal(PortletMode mode) {

-        Enumeration supportedModes = context.getSupportedPortletModes();

-        while (supportedModes.hasMoreElements()) {

-            if (supportedModes.nextElement().toString().equalsIgnoreCase(

-                (mode.toString()))) {

-                return true;

-            }

-        }

-        return false;

-    }

-

-    private boolean isWindowStateAllowed(WindowState state) {

-        Enumeration supportedStates = context.getSupportedWindowStates();

-        while (supportedStates.hasMoreElements()) {

-            if (supportedStates.nextElement().toString().equalsIgnoreCase(

-                (state.toString()))) {

-                return true;

-            }

-        }

-        return false;

-    }

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/CombinedPortletResourceBundle.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/CombinedPortletResourceBundle.java
deleted file mode 100644
index 49d3aab..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/CombinedPortletResourceBundle.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import org.apache.pluto.util.StringManager;

-

-import java.util.ResourceBundle;

-import java.util.Enumeration;

-import java.util.HashMap;

-import java.util.Vector;

-

-/**

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>:

- * @version 1.0

- * @since Jan 9, 2006

- */

-class CombinedPortletResourceBundle extends ResourceBundle {

-

-    private static final StringManager EXCEPTIONS =

-        StringManager.getManager(CombinedPortletResourceBundle.class.getPackage().getName());

-

-    private HashMap contents = new HashMap();

-

-    public CombinedPortletResourceBundle(InlinePortletResourceBundle inlineBundle, ResourceBundle resourceBundle) {

-       dump(inlineBundle);

-       dump(resourceBundle);

-    }

-

-    protected Object handleGetObject(String key) {

-        if(key == null) {

-            throw new NullPointerException(EXCEPTIONS.getString("error.null"));

-        }

-        return contents.get(key);

-    }

-

-    public Enumeration getKeys() {

-       return new Vector(contents.keySet()).elements();

-    }

-

-    private void dump(ResourceBundle bundle) {

-        Enumeration e = bundle.getKeys();

-        while(e.hasMoreElements()) {

-            String value = e.nextElement().toString();

-            contents.put(value, bundle.getObject(value));

-        }

-    }

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/Environment.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/Environment.java
deleted file mode 100644
index 9e243e0..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/Environment.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import java.util.ResourceBundle;

-

-/**

- * Utility class used to retrieve environment information from the

- * <code>environment.properties</code> file packaged with pluto.

- * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

- */

-final class Environment {

-

-    /**

-     * Properties Resource Bundle containing pluto environment information.

-     */

-    public static final ResourceBundle PROPS;

-

-    static {

-        PROPS = ResourceBundle.getBundle("org.apache.pluto.environment");

-    }

-

-

-    /**

-     * Retrieve the name of the container.

-     * @return the container name.

-     */

-    public static final String getPortletContainerName() {

-        return PROPS.getString("pluto.container.name");

-    }

-

-    /**

-     * Retrieve the major version number.

-     * @return the major version number.

-     */

-    public static final String getPortletContainerMajorVersion() {

-        return PROPS.getString("pluto.container.version.major");

-    }

-

-    /**

-     * Retrieve the minor version number.

-     * @return the minor version number.

-     */

-    public static final String getPortletContainerMinorVersion() {

-        return PROPS.getString("pluto.container.version.minor");

-    }

-

-    /**

-     * Retrieve the major version number of the specification which this version

-     * of pluto supports.

-     * @return te major specification version.

-     */

-    public static final int getMajorSpecificationVersion() {

-        return Integer.parseInt(PROPS.getString("javax.portlet.version.major"));

-    }

-

-    /**

-     * Retrieve the minor version number of the specification which this version

-     * of pluto supports.

-     * @return the minor specification version.

-     */

-    public static final int getMinorSpecificationVersion() {

-        return Integer.parseInt(PROPS.getString("javax.portlet.version.minor"));

-    }

-

-    /**

-     * Retrieve the formatted server info String required to be returned by the

-     * PortletContext.

-     * @return the server info.

-     */

-    public static final String getServerInfo() {

-        StringBuffer sb = new StringBuffer(getPortletContainerName())

-            .append("/")

-            .append(getPortletContainerMajorVersion())

-            .append(".")

-            .append(getPortletContainerMinorVersion());

-        return sb.toString();

-    }

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/InlinePortletResourceBundle.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/InlinePortletResourceBundle.java
deleted file mode 100644
index e0cac43..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/InlinePortletResourceBundle.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*

- * Copyright 2006 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import org.apache.pluto.Constants;

-

-import java.util.ListResourceBundle;

-import java.util.ArrayList;

-

-/**

- * InlinePortletResourceBundle implementation which provides the

- * inline title, short-title, and keywords as properties from the

- * bundle.

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>:

- * @version 1.0

- * @since Jan 9, 2006

- */

-class InlinePortletResourceBundle extends ListResourceBundle {

-

-    private Object[][] contents;

-

-    public InlinePortletResourceBundle(Object[][] contents) {

-        this.contents = contents;

-    }

-

-    public InlinePortletResourceBundle(String title, String shortTitle, String keywords) {

-        ArrayList temp = new ArrayList();

-        if(title != null)

-            temp.add(new Object[] {Constants.TITLE_KEY, title});

-

-        if(shortTitle != null)

-            temp.add(new Object[] {Constants.SHORT_TITLE_KEY, shortTitle});

-

-        if(keywords != null)

-            temp.add(new Object[] {Constants.KEYWORDS_KEY, keywords});

-

-        contents = (Object[][])temp.toArray(new Object[temp.size()][]);

-    }

-

-    protected Object[][] getContents() {

-        return contents;

-    }

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/InternalImplConverter.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/InternalImplConverter.java
deleted file mode 100644
index eb88101..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/InternalImplConverter.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import org.apache.pluto.internal.InternalPortletRequest;

-import org.apache.pluto.internal.InternalPortletResponse;

-import org.apache.pluto.wrappers.PortletRequestWrapper;

-import org.apache.pluto.wrappers.PortletResponseWrapper;

-

-import javax.portlet.PortletRequest;

-import javax.portlet.PortletResponse;

-

-/**

- * Static class that provides utility methods to convert a generic

- * PortletRequest or PortletResponse object into an Internal respresentation

- * of the same object.

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- */

-class InternalImplConverter {

-	

-	/**

-	 * Private constructor that prevents external instantiation.

-	 */

-	private InternalImplConverter() {

-		// Do nothing.

-	}

-	

-	

-	// Public Static Utility Methods -------------------------------------------

-

-    /**

-     * The scary part about this is that there is not yet a 

-     * PortletRequestWrapper defined by the spec.  Because of this, there's a

-     * chance someone might implement their own wrapper and we won't be able to

-     * get the real internal one!

-     * @param request the portlet request to be converted.

-     * @return the internal request.

-     */

-    public static InternalPortletRequest getInternalRequest(

-    		PortletRequest request) {

-        while (!(request instanceof InternalPortletRequest)) {

-            request = ((PortletRequestWrapper) request).getPortletRequest();

-            if (request == null) {

-                throw new IllegalStateException(

-                		"The internal portlet request cannot be found.");

-            }

-        }

-        return (InternalPortletRequest) request;

-    }

-

-    /**

-     * The scary part about this is that there is not yet a

-     * PortletRequestWrapper defined by the spec.  Because of this, there's a

-     * chance someone might implement their own wrapper and we won't be able to

-     * get the real internal one!

-     * @param response the portlet response to be converted.

-     * @return the internal response.

-     */

-    public static InternalPortletResponse getInternalResponse(

-    		PortletResponse response) {

-        while (!(response instanceof InternalPortletResponse)) {

-            response = ((PortletResponseWrapper) response).getPortletResponse();

-            if (response == null) {

-                throw new IllegalStateException(

-                		"The internal portlet response cannot be found.");

-            }

-        }

-        return (InternalPortletResponse) response;

-    }

-    

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java
deleted file mode 100644
index afed1d3..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletConfigImpl.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import org.apache.pluto.internal.InternalPortletConfig;

-import org.apache.pluto.descriptors.common.InitParamDD;

-import org.apache.pluto.descriptors.portlet.PortletDD;

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-

-import javax.portlet.PortletConfig;

-import javax.portlet.PortletContext;

-import javax.servlet.ServletConfig;

-import java.util.*;

-

-public class PortletConfigImpl implements PortletConfig, InternalPortletConfig {

-

-    private static final Log LOG = LogFactory.getLog(PortletConfigImpl.class);

-

-    /**

-     * The servlet config for which we exist.

-     */

-    private ServletConfig servletConfig;

-

-    /**

-     * The Portlet Application Context within which we exist.

-     */

-    private PortletContext portletContext;

-

-    /**

-     * The portlet descriptor.

-     */

-    protected PortletDD portletDD;

-

-    private ResourceBundleFactory bundles;

-

-    public PortletConfigImpl(ServletConfig servletConfig,

-                             PortletContext portletContext,

-                             PortletDD portletDD) {

-        this.servletConfig = servletConfig;

-        this.portletContext = portletContext;

-        this.portletDD = portletDD;

-    }

-

-    public String getPortletName() {

-        return portletDD.getPortletName();

-    }

-

-    public PortletContext getPortletContext() {

-        return portletContext;

-    }

-

-    public ResourceBundle getResourceBundle(Locale locale) {

-        if(LOG.isDebugEnabled()) {

-            LOG.debug("Resource Bundle requested: "+locale);

-        }

-        if (bundles == null) {

-            bundles = new ResourceBundleFactory(portletDD);

-        }

-        return bundles.getResourceBundle(locale);

-    }

-

-    public String getInitParameter(String name) {

-        if (name == null) {

-            throw new IllegalArgumentException("Parameter name == null");

-        }

-

-        Iterator parms = portletDD.getInitParams().iterator();

-        while(parms.hasNext()) {

-            InitParamDD param = (InitParamDD)parms.next();

-            if (param.getParamName().equals(name)) {

-                return param.getParamValue();

-            }

-        }

-        return null;

-    }

-

-    public Enumeration getInitParameterNames() {

-        return new java.util.Enumeration() {

-            private Iterator iterator =

-                new ArrayList(portletDD.getInitParams()).iterator();

-

-            public boolean hasMoreElements() {

-                return iterator.hasNext();

-            }

-

-            public Object nextElement() {

-                if (iterator.hasNext()) {

-                    return ((InitParamDD) iterator.next()).getParamName();

-                } else {

-                    return null;

-                }

-            }

-        };

-    }

-

-

-    public javax.servlet.ServletConfig getServletConfig() {

-        return servletConfig;

-    }

-

-    public PortletDD getPortletDefinition() {

-        return portletDD;

-    }

-    // --------------------------------------------------------------------------------------------

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java
deleted file mode 100644
index e418ad1..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletContextImpl.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-import org.apache.pluto.descriptors.portlet.PortletAppDD;

-import org.apache.pluto.internal.InternalPortletContext;

-

-import javax.portlet.PortletContext;

-import javax.portlet.PortletRequestDispatcher;

-import javax.servlet.RequestDispatcher;

-import javax.servlet.ServletContext;

-import java.io.InputStream;

-import java.lang.reflect.Method;

-import java.net.MalformedURLException;

-

-/**

- * Pluto's Portlet Context Implementation. This class implements the

- * <code>InternalPortletContext</code> which provides container specific

- * information needed for processing.

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @version 1.1

- */

-public class PortletContextImpl

-    implements PortletContext, InternalPortletContext {

-

-    /**

-     * Logger.

-     */

-    private static final Log LOG = LogFactory.getLog(PortletContextImpl.class);

-

-    /**

-     * Attribute key used to bind the servletContext to the application.

-     */

-    private static final String CONTEXT_PATH =

-        "org.apache.pluto.PORTLET_APP_CONTEXT_PATH";

-

-

-

-    // Private Member Variables ------------------------------------------------

-

-    private String applicationId;

-    private String applicationName;

-    private PortletAppDD portletAppDD = null;

-    private ServletContext servletContext = null;

-

-    // Constructor -------------------------------------------------------------

-

-    /**

-     * Constructs an instance.

-     *

-     * @param servletContext the servlet context in which we are contained.

-     * @param portletAppDD   the portlet application descriptor.

-     */

-    public PortletContextImpl(String portletApplicationId,

-                              ServletContext servletContext,

-                              PortletAppDD portletAppDD) {

-        this.servletContext = servletContext;

-        this.portletAppDD = portletAppDD;

-        this.applicationId = portletApplicationId;

-        this.applicationName = servletContext.getServletContextName();

-        if(applicationName == null) {

-            applicationName = applicationId;

-        }

-    }

-

-    public String getApplicationId() {

-        return applicationId;

-    }

-

-    public String getApplicationName() {

-        return applicationName;

-    }

-

-    // PortletContext Impl -----------------------------------------------------

-

-    /**

-     * Retrieve the PortletContainer's server info.

-     *

-     * @return the server info in the form of <i>Server/Version</i>

-     * @see Environment#getServerInfo()

-     */

-    public String getServerInfo() {

-        return Environment.getServerInfo();

-    }

-

-    public PortletRequestDispatcher getRequestDispatcher(String path) {

-

-        if (LOG.isDebugEnabled()) {

-            LOG.debug("PortletRequestDispatcher requested: " + path);

-        }

-

-        // Check if the path name is valid. A valid path name must not be null

-        //   and must start with a slash '/' as defined by the portlet spec.

-        if (path == null || !path.startsWith("/")) {

-            if (LOG.isInfoEnabled()) {

-                LOG.info("Failed to retrieve PortletRequestDispatcher: "

-                    + "path name must begin with a slash '/'.");

-            }

-            return null;

-        }

-

-        // Extract query string which contains appended parameters.

-        String queryString = null;

-        int index = path.indexOf("?");

-        if (index > 0 && index < path.length() - 1) {

-            queryString = path.substring(index + 1);

-        }

-

-        // Construct PortletRequestDispatcher.

-        PortletRequestDispatcher portletRequestDispatcher = null;

-        try {

-            RequestDispatcher servletRequestDispatcher = servletContext

-                .getRequestDispatcher(path);

-            if (servletRequestDispatcher != null) {

-                portletRequestDispatcher = new PortletRequestDispatcherImpl(

-                    servletRequestDispatcher, queryString);

-            } else {

-                if (LOG.isInfoEnabled()) {

-                    LOG.info("No matching request dispatcher found for: " + path);

-                }

-            }

-        } catch (Exception ex) {

-            // We need to catch exception because of a Tomcat 4.x bug.

-            //   Tomcat throws an exception instead of return null if the path

-            //   was not found.

-            if (LOG.isInfoEnabled()) {

-                LOG.info("Failed to retrieve PortletRequestDispatcher: "

-                    + ex.getMessage());

-            }

-            portletRequestDispatcher = null;

-        }

-        return portletRequestDispatcher;

-    }

-

-    public PortletRequestDispatcher getNamedDispatcher(String name) {

-        RequestDispatcher dispatcher = servletContext.getNamedDispatcher(name);

-        if (dispatcher != null) {

-            return new PortletRequestDispatcherImpl(dispatcher);

-        } else {

-            if (LOG.isInfoEnabled()) {

-                LOG.info("No matching request dispatcher found for name: "

-                    + name);

-            }

-        }

-        return null;

-    }

-

-    public InputStream getResourceAsStream(String path) {

-        return servletContext.getResourceAsStream(path);

-    }

-

-    public int getMajorVersion() {

-        return Environment.getMajorSpecificationVersion();

-    }

-

-    public int getMinorVersion() {

-        return Environment.getMinorSpecificationVersion();

-    }

-

-    public String getMimeType(String file) {

-        return servletContext.getMimeType(file);

-    }

-

-    public String getRealPath(String path) {

-        return servletContext.getRealPath(path);

-    }

-

-    public java.util.Set getResourcePaths(String path) {

-        return servletContext.getResourcePaths(path);

-    }

-

-    public java.net.URL getResource(String path)

-        throws java.net.MalformedURLException {

-        if (path == null || !path.startsWith("/")) {

-            throw new MalformedURLException("path must start with a '/'");

-        }

-        return servletContext.getResource(path);

-    }

-

-    public java.lang.Object getAttribute(java.lang.String name) {

-        if (name == null) {

-            throw new IllegalArgumentException("Attribute name == null");

-        }

-

-        return servletContext.getAttribute(name);

-    }

-

-    public java.util.Enumeration getAttributeNames() {

-        return servletContext.getAttributeNames();

-    }

-

-    public java.lang.String getInitParameter(java.lang.String name) {

-        if (name == null) {

-            throw new IllegalArgumentException("Parameter name == null");

-        }

-

-        return servletContext.getInitParameter(name);

-    }

-

-    public java.util.Enumeration getInitParameterNames() {

-        return servletContext.getInitParameterNames();

-    }

-

-    public void log(java.lang.String msg) {

-        servletContext.log(msg);

-    }

-

-    public void log(java.lang.String message, java.lang.Throwable throwable) {

-        servletContext.log(message, throwable);

-    }

-

-    public void removeAttribute(java.lang.String name) {

-        if (name == null) {

-            throw new IllegalArgumentException("Attribute name == null");

-        }

-

-        servletContext.removeAttribute(name);

-    }

-

-    public void setAttribute(java.lang.String name, java.lang.Object object) {

-        if (name == null) {

-            throw new IllegalArgumentException("Attribute name == null");

-        }

-

-        servletContext.setAttribute(name, object);

-    }

-

-    public String getPortletContextName() {

-        return servletContext.getServletContextName();

-    }

-

-    // org.apache.pluto.core.InternalPortletContext Impl -----------------------

-

-    public ServletContext getServletContext() {

-        return servletContext;

-    }

-

-    public PortletAppDD getPortletApplicationDefinition() {

-        return portletAppDD;

-    }

-

-}

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletEntityImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletEntityImpl.java
deleted file mode 100644
index 38074fd..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletEntityImpl.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-import org.apache.pluto.PortletContainerException;

-import org.apache.pluto.PortletWindow;

-import org.apache.pluto.internal.InternalPortletPreference;

-import org.apache.pluto.internal.PortletDescriptorRegistry;

-import org.apache.pluto.internal.PortletEntity;

-import org.apache.pluto.internal.PreferencesValidatorRegistry;

-import org.apache.pluto.descriptors.portlet.PortletAppDD;

-import org.apache.pluto.descriptors.portlet.PortletDD;

-import org.apache.pluto.descriptors.portlet.PortletPreferenceDD;

-import org.apache.pluto.descriptors.portlet.PortletPreferencesDD;

-import org.apache.pluto.descriptors.servlet.ServletDD;

-

-import javax.portlet.PreferencesValidator;

-import javax.portlet.ValidatorException;

-import javax.servlet.ServletContext;

-

-import java.util.ArrayList;

-import java.util.Iterator;

-import java.util.List;

-

-/**

- * The PortletEntity encapsulates all data pertaining to a single portlet

- * instance.  This instance may appear zero or more times per user. The

- * PortletEntity consists of two primary peices of information, the Portlet

- * Definition as defined by the {@link PortletDD} and the Wrapping Servlet

- * information as defined by the{@link ServletDD}

- * 

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public class PortletEntityImpl implements PortletEntity {

-	

-	/** Logger. */

-    private static final Log LOG = LogFactory.getLog(PortletEntityImpl.class);

-    

-    /** URI prefix of the portlet invoker servlet. */

-    private static final String PREFIX = "/PlutoInvoker/";

-    

-    

-    // Private Member Variables ------------------------------------------------

-    

-    /** The servlet context. */

-    private ServletContext servletContext = null;

-    

-    /** The portlet window. */

-    private PortletWindow portletWindow = null;

-

-    /** The cached PortletDD retrieved from the portlet descriptor registry. */

-    private PortletDD portletDefinition = null;

-    

-    /** Default portlet preferences defined for this portlet. */

-    private InternalPortletPreference[] defaultPreferences = null;

-    

-    

-    // Constructor -------------------------------------------------------------

-    

-    PortletEntityImpl(ServletContext servletContext, PortletWindow portletWindow) {

-        this.servletContext = servletContext;

-        this.portletWindow = portletWindow;

-    }

-    

-    

-    // PortletEntity Impl ------------------------------------------------------

-    

-    /**

-     * Returns the URI to the controller servlet that wraps this portlet.

-     * @return the URI to the controller servlet that wraps this portlet.

-     */

-    public String getControllerServletUri() {

-        return PREFIX + portletWindow.getPortletName();

-    }

-    

-    /**

-     * Returns an array of default preferences of this portlet. The default

-     * preferences are retrieved from the portlet application descriptor.

-     * <p>

-     * Data retrieved from <code>portlet.xml</code> are injected into the domain

-     * object <code>PortletPreferenceDD</code>. This method converts the domain

-     * objects into <code>PortletPreference</code> objects.

-     * </p>

-     * <p>

-     * Note that if no value is bound to a given preference key,

-     * <code>PortletPreferenceDD.getValues()</code> will return an empty string

-     * list, but the value array of <code>PortletPreference</code> should be set

-     * to null (instead of an empty array).

-     * </p>

-     * <p>

-     * This method never returns null, but the values held by PortletPreference

-     * may be null.

-     * </p>

-     * @return the preference set

-     * 

-     * @see org.apache.pluto.descriptors.portlet.PortletPreferenceDD

-     */

-    public InternalPortletPreference[] getDefaultPreferences() {

-        if (defaultPreferences == null) {

-            PortletDD portletDD = getPortletDefinition();

-            PortletPreferencesDD prefsDD = portletDD.getPortletPreferences();

-            if (prefsDD != null) {

-            	List prefs = new ArrayList();

-            	for (Iterator it = prefsDD.getPortletPreferences().iterator();

-            			it.hasNext(); ) {

-            		PortletPreferenceDD prefDD = (PortletPreferenceDD) it.next();

-            		String[] values = null;

-            		if (prefDD.getValues().size() > 0) {

-            			values = (String[]) prefDD.getValues().toArray(

-            					new String[prefDD.getValues().size()]);

-            		}

-            		PortletPreferenceImpl pref = new PortletPreferenceImpl(

-            				prefDD.getName(), values, prefDD.isReadOnly());

-            		prefs.add(pref);

-            	}

-            	defaultPreferences = (InternalPortletPreference[])

-            			prefs.toArray(new InternalPortletPreference[prefs.size()]);

-            }

-        }

-        return defaultPreferences;

-    }

-

-    /**

-     * Returns the portlet description. The return value cannot be NULL.

-     * @return the portlet description.

-     */

-    public PortletDD getPortletDefinition() {

-        if (portletDefinition == null) {

-            load();

-        }

-        return portletDefinition;

-    }

-    

-    /**

-     * Returns the preferences validator instance for this portlet.

-     * One validator instance is created per portlet definition.

-     * @return the preferences validator instance for this portlet.

-     * @throws ValidatorException  if fail to instantiate the validator.

-     */

-    public PreferencesValidator getPreferencesValidator()

-    throws ValidatorException {

-    	PreferencesValidator validator = PreferencesValidatorRegistry

-    			.getRegistry()

-    			.getPreferencesValidator(getPortletDefinition());

-    	return validator;

-    }

-    

-    

-    // Private Methods ---------------------------------------------------------

-    

-    /**

-     * Loads the portlet definition.

-     */

-    private void load() {

-    	

-    	// Retrieve the cross servlet context for the portlet.

-        String contextPath = portletWindow.getContextPath();

-        if (LOG.isDebugEnabled()) {

-            LOG.debug("Loading portlet definition for context: " + contextPath);

-        }

-        ServletContext crossContext = servletContext.getContext(contextPath);

-        if (LOG.isDebugEnabled()) {

-            LOG.debug("Retrieved cross context: " + crossContext);

-        }

-        

-        // Load PortletAppDD and find out the portlet definition.

-        try {

-            PortletAppDD appDD = PortletDescriptorRegistry.getRegistry()

-            		.getPortletAppDD(crossContext);

-            for (Iterator it = appDD.getPortlets().iterator(); it.hasNext(); ) {

-                PortletDD portletDD = (PortletDD) it.next();

-                if (portletDD.getPortletName().equals(

-                		portletWindow.getPortletName())) {

-                	portletDefinition = portletDD;

-                	break;

-                }

-            }

-        } catch (PortletContainerException ex) {

-        	String message = "Unable to load Portlet App Deployment Descriptor:"

-        			+ ex.getMessage();

-        	LOG.error(message, ex);

-        	// FIXME: should this be a NullPointerException?

-            throw new NullPointerException(message);

-        }

-    }

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferenceImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferenceImpl.java
deleted file mode 100644
index fb87d51..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferenceImpl.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import org.apache.pluto.internal.InternalPortletPreference;

-

-/**

- * TODO: javadoc

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @version 1.0

- * @since Sep 20, 2004

- */

-public class PortletPreferenceImpl implements InternalPortletPreference {

-	

-	// Private Member Variables ------------------------------------------------

-	

-	/** The preference name. */

-    private String name = null;

-    

-    /** The preference values. */

-    private String[] values = null;

-    

-    /** Flag indicating if this preference is read-only. */

-    private boolean readOnly = false;

-    

-    

-    // Constructors ------------------------------------------------------------

-    

-    public PortletPreferenceImpl(String name, String[] values) {

-        this.name = name;

-        this.values = values;

-        this.readOnly = false;

-    }

-    

-    public PortletPreferenceImpl(String name,

-                                 String[] values,

-                                 boolean readOnly) {

-        this.name = name;

-        this.values = values;

-        this.readOnly = readOnly;

-    }

-    

-    /**

-     * Private constructor that is used only within the <code>clone()</code>

-     * method.

-     * @see #clone()

-     */

-    private PortletPreferenceImpl() {

-    	// Do nothing.

-    }

-    

-    

-    // PortletPreference Impl --------------------------------------------------

-    

-    public String getName() {

-        return name;

-    }

-

-    public void setName(String name) {

-        this.name = name;

-    }

-

-    public String[] getValues() {

-        return values;

-    }

-

-    public void setValues(String[] values) {

-        this.values = values;

-    }

-

-    public boolean isReadOnly() {

-        return readOnly;

-    }

-

-    public void setReadOnly(boolean readOnly) {

-        this.readOnly = readOnly;

-    }

-    

-    public Object clone() {

-    	PortletPreferenceImpl copy = new PortletPreferenceImpl();

-    	copy.name = this.name;

-    	if (this.values != null) {

-    		copy.values = (String[]) this.values.clone();

-    	}

-    	copy.readOnly = this.readOnly;

-    	return copy;

-    }

-    

-    

-    // Object Methods ----------------------------------------------------------

-    

-    /**

-     * Override of toString() that prints out name and values of fields.

-     * @see java.lang.Object#toString()

-     */

-    public String toString(){

-    	StringBuffer buffer = new StringBuffer();

-    	buffer.append(getClass().getName());

-    	buffer.append("[name=").append(name).append(";");

-    	if (values != null) {

-    		for (int i = 0; i < values.length; i++) {

-    			buffer.append("value[").append(i).append("]=")

-    					.append(values[i]).append(";");

-    		}

-    	} else {

-    		buffer.append("values=NULL;");

-    	}

-    	buffer.append("readOnly=").append(readOnly).append("]");

-    	return buffer.toString();

-    }

-    

-}

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferencesImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferencesImpl.java
deleted file mode 100644
index 11f4009..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletPreferencesImpl.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import java.io.IOException;

-import java.util.ArrayList;

-import java.util.Collections;

-import java.util.Enumeration;

-import java.util.HashMap;

-import java.util.Iterator;

-import java.util.Map;

-import java.util.Vector;

-

-import javax.portlet.PortletPreferences;

-import javax.portlet.PreferencesValidator;

-import javax.portlet.ReadOnlyException;

-import javax.portlet.ValidatorException;

-

-import org.apache.pluto.Constants;

-import org.apache.pluto.PortletContainer;

-import org.apache.pluto.PortletContainerException;

-import org.apache.pluto.util.StringManager;

-import org.apache.pluto.internal.InternalPortletPreference;

-import org.apache.pluto.internal.InternalPortletRequest;

-import org.apache.pluto.internal.InternalPortletWindow;

-import org.apache.pluto.internal.PortletEntity;

-import org.apache.pluto.spi.optional.PortletPreferencesService;

-import org.apache.commons.logging.LogFactory;

-import org.apache.commons.logging.Log;

-

-/**

- * Implementation of the <code>javax.portlet.PortletPreferences</code>

- * interface.

- * 

- * @see org.apache.pluto.core.PortletPreference

- * @see org.apache.pluto.core.impl.PortletPreferenceImpl

- * 

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public class PortletPreferencesImpl implements PortletPreferences {

-	

-	/** Logger. */

-    private static final Log LOG = LogFactory.getLog(PortletPreferencesImpl.class);

-    

-    private static final StringManager EXCEPTIONS = StringManager.getManager(

-    		PortletPreferencesImpl.class.getPackage().getName());

-    

-    

-    // Private Member Variables ------------------------------------------------

-    

-    /** The portlet preferences service provided by the portal. */

-    private PortletPreferencesService preferencesService = null;

-

-    private InternalPortletWindow window = null;

-

-    private InternalPortletRequest request = null;

-    

-    /**

-     * Default portlet preferences retrieved from portlet.xml, and used for

-     * resetting portlet preferences.

-     */

-    private InternalPortletPreference[] defaultPreferences = null;

-    

-    /**

-     * Current portlet preferences: key is the preference name as a string,

-     * value is the PortletPreference instance.

-     */

-    private Map preferences = new HashMap();

-

-    /** Current method used for managing these preferences. */

-    private Integer methodId = null;

-    

-    

-    // Constructor -------------------------------------------------------------

-    

-    /**

-     * Constructs an instance.

-     * @param container  the portlet container.

-     * @param portletWindow  the internal portlet window.

-     * @param request  the internal portlet request.

-     * @param methodId  the request method ID: render request or action request.

-     */

-    public PortletPreferencesImpl(PortletContainer container,

-                                  InternalPortletWindow window,

-                                  InternalPortletRequest request,

-                                  Integer methodId) {

-        this.window = window;

-        this.request = request;

-        this.methodId = methodId;

-        

-        // Get the portlet preferences service from container.

-        preferencesService = container.getOptionalContainerServices()

-        		.getPortletPreferencesService();

-        if (LOG.isDebugEnabled()) {

-            LOG.debug("Using PortletPreferencesService: "

-            		+ preferencesService.getClass().getName());

-        }

-        

-        // Put default portlet preferences into preferences map.

-        PortletEntity entity = window.getPortletEntity();

-        defaultPreferences = entity.getDefaultPreferences();

-        for (int i = 0; i < defaultPreferences.length; i++) {

-            preferences.put(defaultPreferences[i].getName(),

-                            (InternalPortletPreference) defaultPreferences[i].clone());

-        }

-        if (LOG.isDebugEnabled()) {

-        	LOG.debug("Loaded default preferences: " + toString());

-        }

-        

-        // Merge stored portlet preferences into preferences map.

-        try {

-        	InternalPortletPreference[] storedPreferences = preferencesService

-            		.getStoredPreferences(window, request);

-            for (int i = 0; i < storedPreferences.length; i++) {

-            	if (LOG.isDebugEnabled()) {

-            		LOG.debug("Merging stored preference: "

-            				+ storedPreferences[i].getName());

-            	}

-                preferences.put(storedPreferences[i].getName(),

-                                storedPreferences[i]);

-            }

-        	// Store the preferences retrieved from portlet.xml.

-            //   Portlet preferences are stored everytime when a

-            //   PortletPreferencesImpl instance is created.

-            //   So here we do not check the portlet request method ID.

-        	internalStore();

-        	

-        } catch (PortletContainerException ex) {

-            LOG.error("Error retrieving preferences.", ex);

-            //TODO: Rethrow up the stack????

-        } catch (IOException ex) {

-            LOG.error("Error retrieving preferences.", ex);        	

-            //TODO: Rethrow up the stack????

-        } catch (ValidatorException ex) {

-            LOG.warn("ValidatorException initializing portlet preferences. "

-            		+ "This is not illegal at this point "

-            		+ "since we are just retreiving from portlet.xml.", ex);    	

-        }

-        if (LOG.isDebugEnabled()) {

-        	LOG.debug("Merged stored preferences: " + toString());

-        }

-    }

-    

-    

-    // PortletPreferences Impl -------------------------------------------------

-    

-    public boolean isReadOnly(String key) {

-        if (key == null) {

-            throw new IllegalArgumentException(

-            		EXCEPTIONS.getString("error.null", "Preference key "));

-        }

-        InternalPortletPreference pref = (InternalPortletPreference)

-        		preferences.get(key);

-        return (pref != null && pref.isReadOnly());

-    }

-

-    public String getValue(String key, String defaultValue) {

-        String[] values = getValues(key, new String[] { defaultValue });

-        String value = null;

-        if (values != null && values.length > 0) {

-        	value = values[0];

-        }

-        if (value == null) {

-        	value = defaultValue;

-        }

-        return value;

-    }

-

-    public String[] getValues(String key, String[] defaultValues) {

-        if (key == null) {

-            throw new IllegalArgumentException(

-            		EXCEPTIONS.getString("error.null", "Preference key "));

-        }

-        String[] values = null;

-        InternalPortletPreference pref = (InternalPortletPreference)

-        		preferences.get(key);

-        if (pref != null) {

-            values = pref.getValues();

-        }

-        if (values == null) {

-            values = defaultValues;

-        }

-        return values;

-    }

-

-    public void setValue(String key, String value) throws ReadOnlyException {

-        if (isReadOnly(key)) {

-            throw new ReadOnlyException(EXCEPTIONS.getString(

-            		"error.preference.readonly", key));

-        }

-        InternalPortletPreference pref = (InternalPortletPreference)

-        		preferences.get(key);

-        if (pref != null) {

-            pref.setValues(new String[] { value });

-        } else {

-            pref = new PortletPreferenceImpl(key, new String[] { value });

-            preferences.put(key, pref);

-        }

-    }

-

-    public void setValues(String key, String[] values) throws ReadOnlyException {

-        if (isReadOnly(key)) {

-            throw new ReadOnlyException(EXCEPTIONS.getString(

-            		"error.preference.readonly"));

-        }

-        InternalPortletPreference pref = (InternalPortletPreference)

-        		preferences.get(key);

-        if (pref != null) {

-            pref.setValues(values);

-        } else {

-            pref = new PortletPreferenceImpl(key, values);

-            preferences.put(key, pref);

-        }

-    }

-

-    public Enumeration getNames() {

-        return new Vector(preferences.keySet()).elements();

-    }

-

-    public Map getMap() {

-        Map map = new HashMap();

-        Iterator it = preferences.keySet().iterator();

-        while (it.hasNext()) {

-        	InternalPortletPreference pref = (InternalPortletPreference)

-        			preferences.get(it.next());

-            map.put(pref.getName(),

-                    pref.getValues() != null ? pref.getValues().clone() : null);

-        }

-        return Collections.unmodifiableMap(map);

-    }

-    

-    public void reset(String key) throws ReadOnlyException {

-    	// Read-only preferences cannot be reset.

-        if (isReadOnly(key)) {

-            throw new ReadOnlyException(EXCEPTIONS.getString(

-            		"error.preference.readonly", "Preference key "));

-        }

-        // Try to reset preference to the default values.

-        boolean resetDone = false;

-        for (int i = 0; !resetDone && i < defaultPreferences.length; i++) {

-        	if (key.equals(defaultPreferences[i].getName())) {

-        		if (LOG.isDebugEnabled()) {

-        			LOG.debug("Resetting preference for key: " + key);

-        		}

-        		preferences.put(key,

-        				(InternalPortletPreference) defaultPreferences[i].clone());

-        		resetDone = true;

-        	}

-        }

-        // Remove preference if default values are not defined (PLT.14.1).

-        if (!resetDone) {

-        	if (LOG.isDebugEnabled()) {

-        		LOG.debug("Resetting preference to null for key: " + key);

-        	}

-        	preferences.remove(key);

-        }

-    }

-    

-    /**

-     * Stores the portlet preferences to a persistent storage. This method

-     * should only be invoked within <code>processAction()</code> method.

-     * 

-     * @see #internalStore()

-     * 

-     * @throws IllegalStateException  if this method is not invoked within

-     *         <code>processAction()</code> method.

-     * @throws ValidatorException  if the portlet preferences are not valid.

-     * @throws IOException  if an error occurs with the persistence mechanism.

-     */

-    public void store() throws IOException, ValidatorException {

-        if (!Constants.METHOD_ACTION.equals(methodId)) {

-            throw new IllegalStateException(

-                	"store is only allowed inside a processAction call.");

-        }

-        internalStore();

-    }

-    

-    

-    // Private Methods ---------------------------------------------------------

-    

-    /**

-     * Stores the portlet preferences to a persistent storage. If a preferences

-     * validator is defined for this portlet, this method firstly validates the

-     * portlet preferences.

-     * <p>

-     * This method is invoked internally, thus it does not check the portlet

-     * request method ID (METHOD_RENDER or METHOD_ACTION).

-     * </p>

-     * @throws ValidatorException  if the portlet preferences are not valid.

-     * @throws IOException  if an error occurs with the persistence mechanism.

-     */

-    private void internalStore() throws IOException, ValidatorException {

-        // Validate the preferences before storing, if a validator is defined.

-        //   If the preferences cannot pass the validation,

-        //   an ValidatorException will be thrown out.

-        PreferencesValidator validator = window.getPortletEntity()

-        		.getPreferencesValidator();

-        if (validator != null) {

-        	validator.validate(this);

-        }

-        // Store the portlet preferences.

-        InternalPortletPreference[] prefs = (InternalPortletPreference[]) 

-        		(new ArrayList(preferences.values())).toArray(

-        				new InternalPortletPreference[preferences.size()]);

-        try {

-        	preferencesService.store(window, request, prefs);

-        } catch (PortletContainerException ex) {

-            LOG.error("Error storing preferences.", ex);

-            throw new IOException("Error storing perferences: " + ex.getMessage());

-        }

-    }

-    

-    

-    // Object Methods ----------------------------------------------------------

-    

-    /**

-     * Returns the string representation of this object. Preferences are

-     * separated by ';' character, while values in one preference are separated

-     * by ',' character.

-     * @return the string representation of this object.

-     * @see java.lang.Object#toString()

-     */

-    public String toString() {

-    	StringBuffer buffer = new StringBuffer();

-    	buffer.append(getClass().getName()).append("[");

-    	for (Enumeration en = getNames(); en.hasMoreElements(); ) {

-    		String name = (String) en.nextElement();

-    		buffer.append(name);

-    		buffer.append("(readOnly:").append(isReadOnly(name)).append(")=");

-    		String[] values = getValues(name, null);

-    		if (values != null) {

-	    		for (int i = 0; i < values.length; i++) {

-	    			buffer.append(values[i]);

-	    			if (i < values.length - 1) {

-	    				buffer.append(",");

-	    			}

-				}

-    		} else {

-    			buffer.append("NULL");

-    		}

-    		buffer.append(";");

-    	}

-    	buffer.append("]");

-    	return buffer.toString();

-    }

-    

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestDispatcherImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestDispatcherImpl.java
deleted file mode 100644
index 77629d9..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestDispatcherImpl.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import org.apache.pluto.internal.InternalRenderRequest;

-import org.apache.pluto.internal.InternalRenderResponse;

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-

-import javax.portlet.PortletException;

-import javax.portlet.PortletRequestDispatcher;

-import javax.portlet.RenderRequest;

-import javax.portlet.RenderResponse;

-import javax.servlet.RequestDispatcher;

-import javax.servlet.ServletException;

-import javax.servlet.http.HttpServletRequest;

-import javax.servlet.http.HttpServletResponse;

-

-import java.io.IOException;

-

-/**

- * Implementation of the <code>PortletRequestDispatcher</code> interface.

- * The portlet request dispatcher is used to dispatch <b>RenderRequest</b> and

- * <b>RenderResponse</b> to a URI. Note that ActionRequest and ActionResponse

- * can never be dispatched.

- * 

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public class PortletRequestDispatcherImpl implements PortletRequestDispatcher {

-	

-	/** Logger. */

-    private static final Log LOG = LogFactory.getLog(PortletRequestDispatcherImpl.class);

-    

-    

-    // Private Member Variables ------------------------------------------------

-    

-    /** The nested servlet request dispatcher instance. */

-    private RequestDispatcher requestDispatcher = null;

-    

-    /** The included query string. */

-    private String queryString = null;

-    

-    

-    // Constructors ------------------------------------------------------------

-    

-    /**

-     * Creates an instance. This constructor should be called to construct a

-     * named dispatcher.

-     * @param requestDispatcher  the servlet request dispatcher.

-     * @see javax.portlet.PortletContext#getNamedDispatcher(String)

-     */

-    public PortletRequestDispatcherImpl(RequestDispatcher requestDispatcher) {

-        this.requestDispatcher = requestDispatcher;

-        if (LOG.isDebugEnabled()) {

-        	LOG.debug("Named dispatcher created.");

-        }

-    }

-    

-    /**

-     * Creates an instance. This constructor should be called to construct a

-     * portlet request dispatcher.

-     * @param requestDispatcher  the servlet request dispatcher.

-     * @param queryString  the included query string.

-     * @see javax.portlet.PortletContext#getRequestDispatcher(String)

-     */

-    public PortletRequestDispatcherImpl(RequestDispatcher requestDispatcher,

-                                        String queryString) {

-        this(requestDispatcher);

-        this.queryString = queryString;

-        if (LOG.isDebugEnabled()) {

-        	LOG.debug("Request dispatcher created.");

-        }

-    }

-    

-    

-    // PortletRequestDispatcher Impl -------------------------------------------

-    

-    public void include(RenderRequest request, RenderResponse response)

-    throws PortletException, IOException {

-

-        InternalRenderRequest internalRequest = (InternalRenderRequest)

-                InternalImplConverter.getInternalRequest(request);

-        InternalRenderResponse internalResponse = (InternalRenderResponse)

-                InternalImplConverter.getInternalResponse(response);

-        

-        boolean isIncluded = (internalRequest.isIncluded()

-        		|| internalResponse.isIncluded());

-        try {

-        	internalRequest.setIncluded(true);

-        	internalRequest.setIncludedQueryString(queryString);

-        	internalResponse.setIncluded(true);

-

-            requestDispatcher.include(

-            		(HttpServletRequest) internalRequest,

-            		(HttpServletResponse) internalResponse);

-        } catch (IOException ex) {

-            throw ex;

-        } catch (ServletException ex) {

-            if (ex.getRootCause() != null) {

-                throw new PortletException(ex.getRootCause());

-            } else {

-                throw new PortletException(ex);

-            }

-        } finally {

-        	internalRequest.setIncluded(isIncluded);

-        	internalResponse.setIncluded(isIncluded);

-        }

-    }

-    

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestImpl.java
deleted file mode 100644
index d6bf7ad..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletRequestImpl.java
+++ /dev/null
@@ -1,648 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-import org.apache.pluto.PortletContainer;

-import org.apache.pluto.descriptors.common.SecurityRoleRefDD;

-import org.apache.pluto.descriptors.portlet.PortletDD;

-import org.apache.pluto.descriptors.portlet.SupportsDD;

-import org.apache.pluto.internal.InternalPortletRequest;

-import org.apache.pluto.internal.InternalPortletWindow;

-import org.apache.pluto.internal.PortletEntity;

-import org.apache.pluto.util.ArgumentUtility;

-import org.apache.pluto.util.Enumerator;

-import org.apache.pluto.util.NamespaceMapper;

-import org.apache.pluto.util.StringManager;

-import org.apache.pluto.util.StringUtils;

-import org.apache.pluto.util.impl.NamespaceMapperImpl;

-

-import javax.portlet.PortalContext;

-import javax.portlet.PortletContext;

-import javax.portlet.PortletMode;

-import javax.portlet.PortletRequest;

-import javax.portlet.PortletSession;

-import javax.portlet.WindowState;

-import javax.servlet.RequestDispatcher;

-import javax.servlet.ServletInputStream;

-import javax.servlet.http.HttpServletRequest;

-import javax.servlet.http.HttpServletRequestWrapper;

-import javax.servlet.http.HttpSession;

-import java.io.BufferedReader;

-import java.io.UnsupportedEncodingException;

-import java.io.IOException;

-import java.util.Collections;

-import java.util.Enumeration;

-import java.util.HashSet;

-import java.util.Iterator;

-import java.util.Map;

-import java.util.Set;

-import java.util.Vector;

-import java.util.Locale;

-import java.security.Principal;

-

-/**

- * Abstract <code>javax.portlet.PortletRequest</code> implementation.

- * This class also implements InternalPortletRequest.

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public abstract class PortletRequestImpl extends HttpServletRequestWrapper

-implements PortletRequest, InternalPortletRequest {

-	

-	/** Logger. */

-    private static final Log LOG = LogFactory.getLog(PortletRequestImpl.class);

-    

-    private static final StringManager EXCEPTIONS =

-            StringManager.getManager(PortletRequestImpl.class.getPackage().getName());

-    

-    

-    // Private Member Variables ------------------------------------------------

-    

-    /** The parent container within which this request was created. */

-    private PortletContainer container = null;

-    

-    /** The portlet window which is the target of this portlet request. */

-    private InternalPortletWindow internalPortletWindow = null;

-

-    /**

-     * The PortletContext associated with this Request. This PortletContext must

-     * be initialized from within the <code>PortletServlet</code>.

-     */

-    private PortletContext portletContext = null;

-

-    /** The PortalContext within which this request is occuring. */

-    private PortalContext portalContext = null;

-

-    /** The portlet session. */

-    private PortletSession portletSession = null;

-

-    /** Response content types. */

-    private Vector contentTypes = null;

-    

-    /** TODO: javadoc */

-    private NamespaceMapper mapper = new NamespaceMapperImpl();

-

-    /** FIXME: do we really need this?

-     * Flag indicating if the HTTP-Body has been accessed. */

-    private boolean bodyAccessed = false;

-

-

-    // Constructors ------------------------------------------------------------

-

-    public PortletRequestImpl(InternalPortletRequest internalPortletRequest) {

-        this(internalPortletRequest.getPortletContainer(),

-             internalPortletRequest.getInternalPortletWindow(),

-             internalPortletRequest.getHttpServletRequest());

-    }

-

-    /**

-     * Creates a PortletRequestImpl instance.

-     * @param container  the portlet container.

-     * @param internalPortletWindow  the internal portlet window.

-     * @param servletRequest  the underlying servlet request.

-     */

-    public PortletRequestImpl(PortletContainer container,

-                              InternalPortletWindow internalPortletWindow,

-                              HttpServletRequest servletRequest) {

-        super(servletRequest);

-        this.container = container;

-        this.internalPortletWindow = internalPortletWindow;

-        this.portalContext = container.getRequiredContainerServices().getPortalContext();

-    }

-    

-    

-    // PortletRequest Impl -----------------------------------------------------

-

-    /**

-     * Determine whether or not the specified WindowState is allowed for this

-     * portlet.

-     *

-     * @param state the state in question

-     * @return true if the state is allowed.

-     */

-    public boolean isWindowStateAllowed(WindowState state) {

-    	for (Enumeration en = portalContext.getSupportedWindowStates();

-    			en.hasMoreElements(); ) {

-            if (en.nextElement().toString().equals(state.toString())) {

-                return true;

-            }

-        }

-        return false;

-    }

-    

-    public boolean isPortletModeAllowed(PortletMode mode) {

-        return (isPortletModeAllowedByPortlet(mode)

-                && isPortletModeAllowedByPortal(mode));

-    }

-    

-    public PortletMode getPortletMode() {

-        return internalPortletWindow.getPortletMode();

-    }

-    

-    public WindowState getWindowState() {

-        return internalPortletWindow.getWindowState();

-    }

-    

-    public PortletSession getPortletSession() {

-        return getPortletSession(true);

-    }

-    

-    /**

-     * Returns the portlet session.

-     * <p>

-     * Note that since portlet request instance is created everytime the portlet

-     * container receives an incoming request, the portlet session instance held

-     * by the request instance is also re-created for each incoming request.

-     * </p>

-     */

-    public PortletSession getPortletSession(boolean create) {

-        if (LOG.isDebugEnabled()) {

-            LOG.debug("Retreiving portlet session (create=" + create + ")");

-        }

-        //

-        // It is critical that we don't retrieve the portlet session until the

-        //   cross context dispatch has been completed.  If we do then we risk

-        //   having a cached version which is invalid for the context within

-        //   which it exists.

-        //

-        if (portletContext == null) {

-            throw new IllegalStateException(

-                    EXCEPTIONS.getString("error.session.illegalState"));

-        }

-        //

-        // We must make sure that if the session has been invalidated (perhaps

-        //   through setMaxIntervalTimeout()) and the underlying request

-        //   returns null that we no longer use the cached version.

-        // We have to check (ourselves) if the session has exceeded its max

-        //   inactive interval. If so, we should invalidate the underlying

-        //   HttpSession and recreate a new one (if the create flag is set to

-        //   true) -- We just cannot depend on the implementation of

-        //   javax.servlet.http.HttpSession!

-        //

-        HttpSession httpSession = getHttpServletRequest().getSession(create);

-        if (httpSession != null) {

-        	// HttpSession is not null does NOT mean that it is valid.

-//START PATCH - Jira Issue PLUTO-242 contriuted by David Garcia

-//            long maxInactiveTime = httpSession.getMaxInactiveInterval() * 1000L;

-//            long currentInactiveTime = System.currentTimeMillis()

-//            		- httpSession.getLastAccessedTime();

-//            if (currentInactiveTime > maxInactiveTime) {

-//            	if (LOG.isDebugEnabled()) {

-//            		LOG.debug("The underlying HttpSession is expired and "

-//            				+ "should be invalidated.");

-            int maxInactiveInterval = httpSession.getMaxInactiveInterval();

-            if (maxInactiveInterval >= 0) {    // < 0 => Never expires.

-            	long maxInactiveTime = httpSession.getMaxInactiveInterval() * 1000L;

-            	long currentInactiveTime = System.currentTimeMillis()

-            			- httpSession.getLastAccessedTime();

-            	if (currentInactiveTime > maxInactiveTime) {

-            		if (LOG.isDebugEnabled()) {

-            			LOG.debug("The underlying HttpSession is expired and "

-            					+ "should be invalidated.");

-            		}

-            		httpSession.invalidate();

-            		httpSession = getHttpServletRequest().getSession(create);

-            	}

-//            	httpSession.invalidate();

-//            	httpSession = getHttpServletRequest().getSession(create);

-//END PATCH 

-            }

-        }

-        if (httpSession == null) {

-            if (LOG.isDebugEnabled()) {

-                LOG.debug("The underlying HttpSession is not available: "

-                		+ "no session will be returned.");

-            }

-            return null;

-        }

-        //

-        // If we reach here, we are sure that the underlying HttpSession is

-        //   available. If we haven't created and cached a portlet session

-        //   instance, we will create and cache one now.

-        //

-        if (portletSession == null) {

-        	if (LOG.isDebugEnabled()) {

-        		LOG.debug("Creating new portlet session...");

-        	}

-            portletSession = new PortletSessionImpl(

-                    portletContext,

-                    internalPortletWindow,

-                    httpSession);

-        }

-        return portletSession;

-    }

-    

-    public String getProperty(String name) throws IllegalArgumentException {

-    	ArgumentUtility.validateNotNull("propertyName", name);

-        String property = this.getHttpServletRequest().getHeader(name);

-        if (property == null) {

-            Map propertyMap = container.getRequiredContainerServices()

-                    .getPortalCallbackService()

-                    .getRequestProperties(

-                    		getHttpServletRequest(),

-                    		internalPortletWindow);

-

-            if (propertyMap != null) {

-                String[] properties = (String[]) propertyMap.get(name);

-                if (properties != null && properties.length > 0) {

-                	property = properties[0];

-                }

-            }

-        }

-        return property;

-    }

-

-    public Enumeration getProperties(String name) {

-    	ArgumentUtility.validateNotNull("propertyName", name);

-        Set v = new HashSet();

-        Enumeration props = this.getHttpServletRequest().getHeaders(name);

-        if (props != null) {

-            while (props.hasMoreElements()) {

-                v.add(props.nextElement());

-            }

-        }

-

-        // get properties from PropertyManager

-        Map map = container.getRequiredContainerServices()

-                .getPortalCallbackService()

-                .getRequestProperties(

-                		getHttpServletRequest(),

-                		internalPortletWindow);

-

-        if (map != null) {

-            String[] properties = (String[]) map.get(name);

-

-            if (properties != null) {

-                // add properties to vector

-                for (int i = 0; i < properties.length; i++) {

-                    v.add(properties[i]);

-                }

-            }

-        }

-

-        return new Enumerator(v.iterator());

-    }

-

-    public Enumeration getPropertyNames() {

-        Set v = new HashSet();

-

-        // get properties from PropertyManager

-        Map map = container.getRequiredContainerServices()

-                .getPortalCallbackService()

-                .getRequestProperties(getHttpServletRequest(), internalPortletWindow);

-

-        if (map != null) {

-            v.addAll(map.keySet());

-        }

-

-        // get properties from request header

-        Enumeration props = this.getHttpServletRequest().getHeaderNames();

-        if (props != null) {

-            while (props.hasMoreElements()) {

-                v.add(props.nextElement());

-            }

-        }

-

-        return new Enumerator(v.iterator());

-    }

-

-    public PortalContext getPortalContext() {

-        return container.getRequiredContainerServices().getPortalContext();

-    }

-

-    public String getAuthType() {

-        return this.getHttpServletRequest().getAuthType();

-    }

-

-    public String getContextPath() {

-        return this.internalPortletWindow.getContextPath();

-        //return ((HttpServletRequest)getRequest()).getContextPath();

-    }

-

-    public String getRemoteUser() {

-        return this.getHttpServletRequest().getRemoteUser();

-    }

-

-    public Principal getUserPrincipal() {

-        return this.getHttpServletRequest().getUserPrincipal();

-    }

-

-    /**

-     * Determines whether a user is mapped to the specified role.  As specified

-     * in PLT-20-3, we must reference the &lt;security-role-ref&gt; mappings

-     * within the deployment descriptor. If no mapping is available, then, and

-     * only then, do we check use the actual role name specified against the web

-     * application deployment descriptor.

-     *

-     * @param roleName the name of the role

-     * @return true if it is determined the user has the given role.

-     */

-    public boolean isUserInRole(String roleName) {

-        PortletEntity entity = internalPortletWindow.getPortletEntity();

-        PortletDD def = entity.getPortletDefinition();

-

-        SecurityRoleRefDD ref = null;

-        Iterator refs = def.getSecurityRoleRefs().iterator();

-        while (refs.hasNext()) {

-            SecurityRoleRefDD r = (SecurityRoleRefDD) refs.next();

-            if (r.getRoleName().equals(roleName)) {

-                ref = r;

-                break;

-            }

-        }

-

-        String link;

-        if (ref != null && ref.getRoleLink() != null) {

-            link = ref.getRoleLink();

-        } else {

-            link = roleName;

-        }

-

-        return this.getHttpServletRequest().isUserInRole(link);

-    }

-

-    public Object getAttribute(String name) {

-    	ArgumentUtility.validateNotNull("attributeName", name);

-    	

-        String encodedName = isNameReserved(name) ?

-                name :

-                mapper.encode(internalPortletWindow.getId(), name);

-

-        Object attribute = getHttpServletRequest()

-                .getAttribute(encodedName);

-

-        if (attribute == null) {

-            attribute = getHttpServletRequest().getAttribute(name);

-        }

-        return attribute;

-    }

-

-    public Enumeration getAttributeNames() {

-        Enumeration attributes = this.getHttpServletRequest()

-                .getAttributeNames();

-

-        Vector portletAttributes = new Vector();

-

-        while (attributes.hasMoreElements()) {

-            String attribute = (String) attributes.nextElement();

-

-            String portletAttribute = mapper.decode(

-                    internalPortletWindow.getId(), attribute);

-

-            if (portletAttribute != null) { // it is in the portlet's namespace

-                portletAttributes.add(portletAttribute);

-            }

-        }

-

-        return portletAttributes.elements();

-    }

-

-    public String getParameter(String name) {

-    	ArgumentUtility.validateNotNull("parameterName", name);

-        String[] values = (String[]) baseGetParameterMap().get(name);

-        if (values != null && values.length > 0) {

-            return values[0];

-        } else {

-        	return null;

-        }

-    }

-

-    public Enumeration getParameterNames() {

-        return Collections.enumeration(baseGetParameterMap().keySet());

-    }

-

-    public String[] getParameterValues(String name) {

-    	ArgumentUtility.validateNotNull("parameterName", name);

-    	String[] values = (String[]) baseGetParameterMap().get(name);

-        if (values != null) {

-            values = StringUtils.copy(values);

-        }

-        return values;

-    }

-    

-    public Map getParameterMap() {

-    	return StringUtils.copyParameters(baseGetParameterMap());

-    }

-

-    public boolean isSecure() {

-        return this.getHttpServletRequest().isSecure();

-    }

-

-    public void setAttribute(String name, Object value) {

-    	ArgumentUtility.validateNotNull("attributeName", name);

-        String encodedName = isNameReserved(name) ?

-                name : mapper.encode(internalPortletWindow.getId(), name);

-        if (value == null) {

-            removeAttribute(name);

-        } else {

-            getHttpServletRequest().setAttribute(encodedName, value);

-        }

-    }

-

-    public void removeAttribute(String name) {

-    	ArgumentUtility.validateNotNull("attributeName", name);

-        String encodedName = isNameReserved(name) ?

-                name : mapper.encode(internalPortletWindow.getId(), name);

-        getHttpServletRequest().removeAttribute(encodedName);

-    }

-

-    public String getRequestedSessionId() {

-        return this.getHttpServletRequest().getRequestedSessionId();

-    }

-

-    public boolean isRequestedSessionIdValid() {

-        if (LOG.isDebugEnabled()) {

-            LOG.debug(" ***** IsRequestedSessionIdValid? "+getHttpServletRequest().isRequestedSessionIdValid());

-        }

-        return getHttpServletRequest().isRequestedSessionIdValid();

-    }

-

-    public String getResponseContentType() {

-        Enumeration enumeration = getResponseContentTypes();

-        while (enumeration.hasMoreElements()) {

-            return (String) enumeration.nextElement();

-        }

-        return "text/html";

-    }

-

-    public Enumeration getResponseContentTypes() {

-        if (contentTypes == null) {

-            contentTypes = new Vector();

-            PortletDD dd = internalPortletWindow.getPortletEntity().getPortletDefinition();

-            Iterator supports = dd.getSupports().iterator();

-            while (supports.hasNext()) {

-                SupportsDD sup = (SupportsDD) supports.next();

-                contentTypes.add(sup.getMimeType());

-            }

-            if (contentTypes.size() < 1) {

-                contentTypes.add("text/html");

-            }

-        }

-        return contentTypes.elements();

-    }

-

-    public Locale getLocale() {

-        return this.getHttpServletRequest().getLocale();

-    }

-

-    public Enumeration getLocales() {

-        return this.getHttpServletRequest().getLocales();

-    }

-

-    public String getScheme() {

-        return this.getHttpServletRequest().getScheme();

-    }

-

-    public String getServerName() {

-        return this.getHttpServletRequest().getServerName();

-    }

-

-    public int getServerPort() {

-        return this.getHttpServletRequest().getServerPort();

-    }

-    

-    

-    // Protected Methods -------------------------------------------------------

-    

-    /**

-     * The base method that returns the parameter map in this portlet request.

-     * All parameter-related methods call this base method. Subclasses may just

-     * overwrite this protected method to change behavior of all parameter-

-     * related methods.

-     * @return the base parameter map from which parameters are retrieved.

-     */

-    protected Map baseGetParameterMap() {

-        bodyAccessed = true;

-        return this.getHttpServletRequest().getParameterMap();

-    }

-

-    protected void setBodyAccessed() {

-    	bodyAccessed = true;

-    }

-    

-    

-    // InternalPortletRequest Impl ---------------------------------------------

-

-    public InternalPortletWindow getInternalPortletWindow() {

-        return internalPortletWindow;

-    }

-

-    public PortletContainer getPortletContainer() {

-        return container;

-    }

-

-    public HttpServletRequest getHttpServletRequest() {

-        return (HttpServletRequest) super.getRequest();

-    }

-    

-    public void init(PortletContext portletContext, HttpServletRequest req) {

-        this.portletContext = portletContext;

-        setRequest(req);

-    }

-

-    /**

-     * TODO: Implement this properly.  Not required now

-     */

-    public void release() {

-    	// TODO:

-    }

-    

-    

-    // TODO: Additional Methods of HttpServletRequestWrapper -------------------

-    

-    public BufferedReader getReader()

-    throws UnsupportedEncodingException, IOException {

-    	// the super class will ensure that a IllegalStateException is thrown

-    	//   if getInputStream() was called earlier

-    	BufferedReader reader = getHttpServletRequest().getReader();

-    	bodyAccessed = true;

-    	return reader;

-    }

-    

-    public ServletInputStream getInputStream() throws IOException {

-    	ServletInputStream stream = getHttpServletRequest().getInputStream();

-    	bodyAccessed = true;

-    	return stream;

-    }

-

-    public RequestDispatcher getRequestDispatcher(String path) {

-        return getHttpServletRequest().getRequestDispatcher(path);

-    }

-    

-    /**

-     * TODO: why check bodyAccessed?

-     */

-    public void setCharacterEncoding(String encoding)

-    throws UnsupportedEncodingException {

-        if (bodyAccessed) {

-        	throw new IllegalStateException("Cannot set character encoding "

-        			+ "after HTTP body is accessed.");

-        }

-        super.setCharacterEncoding(encoding);

-    }

-    

-    

-    // Private Methods ---------------------------------------------------------

-    

-    /**

-     * Is this attribute name a reserved name (by the J2EE spec)?. Reserved

-     * names begin with "java." or "javax.".

-     */

-    private boolean isNameReserved(String name) {

-        return name.startsWith("java.") || name.startsWith("javax.");

-    }

-    

-    private boolean isPortletModeAllowedByPortlet(PortletMode mode) {

-        if (isPortletModeMandatory(mode)) {

-            return true;

-        }

-

-        PortletDD dd = internalPortletWindow.getPortletEntity()

-                .getPortletDefinition();

-

-        Iterator mimes = dd.getSupports().iterator();

-        while (mimes.hasNext()) {

-            Iterator modes = ((SupportsDD) mimes.next()).getPortletModes().iterator();

-            while (modes.hasNext()) {

-                String m = (String) modes.next();

-                if (m.equals(mode.toString())) {

-                    return true;

-                }

-            }

-        }

-        return false;

-    }

-

-    private boolean isPortletModeAllowedByPortal(PortletMode mode) {

-        Enumeration supportedModes = portalContext.getSupportedPortletModes();

-        while (supportedModes.hasMoreElements()) {

-            if (supportedModes.nextElement().toString().equals(

-                    (mode.toString()))) {

-                return true;

-            }

-        }

-        return false;

-    }

-

-    private boolean isPortletModeMandatory(PortletMode mode) {

-        return PortletMode.VIEW.equals(mode) || PortletMode.EDIT.equals(mode) || PortletMode.HELP.equals(mode);

-    }

-

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletResponseImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletResponseImpl.java
deleted file mode 100644
index 44a4d8e..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletResponseImpl.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import java.io.IOException;

-import java.io.PrintWriter;

-

-import javax.portlet.PortletResponse;

-import javax.servlet.ServletOutputStream;

-import javax.servlet.http.HttpServletRequest;

-import javax.servlet.http.HttpServletResponse;

-import javax.servlet.http.HttpServletResponseWrapper;

-

-import org.apache.pluto.PortletContainer;

-import org.apache.pluto.internal.InternalPortletResponse;

-import org.apache.pluto.internal.InternalPortletWindow;

-import org.apache.pluto.spi.ResourceURLProvider;

-import org.apache.pluto.util.ArgumentUtility;

-import org.apache.pluto.util.PrintWriterServletOutputStream;

-

-/**

- * Abstract <code>javax.portlet.PortletResponse</code> implementation.

- * This class also implements InternalPortletResponse.

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public abstract class PortletResponseImpl extends HttpServletResponseWrapper

-implements PortletResponse, InternalPortletResponse {

-	

-	// Private Member Variables ------------------------------------------------

-	

-	/** The portlet container. */

-    private PortletContainer container = null;

-    

-    /** The internal portlet window. */

-    private InternalPortletWindow internalPortletWindow = null;

-

-    /** The servlet request of the target/portlet's web module. */

-    private HttpServletRequest httpServletRequest = null;

-    

-    private boolean usingWriter;

-    private boolean usingStream;

-

-    private ServletOutputStream wrappedWriter;

-    

-    

-    // Constructor -------------------------------------------------------------

-    

-    public PortletResponseImpl(PortletContainer container,

-                               InternalPortletWindow internalPortletWindow,

-                               HttpServletRequest servletRequest,

-                               HttpServletResponse servletResponse) {

-        super(servletResponse);

-        this.container = container;

-        this.httpServletRequest = servletRequest;

-        this.internalPortletWindow = internalPortletWindow;

-    }

-    

-    

-    // PortletResponse Impl ----------------------------------------------------

-    

-    public void addProperty(String name, String value) {

-    	ArgumentUtility.validateNotNull("propertyName", name);

-        container.getRequiredContainerServices()

-        		.getPortalCallbackService()

-        		.addResponseProperty(

-        				getHttpServletRequest(),

-        				internalPortletWindow,

-        				name, value);

-    }

-

-    public void setProperty(String name, String value) {

-    	ArgumentUtility.validateNotNull("propertyName", name);

-        container.getRequiredContainerServices()

-                .getPortalCallbackService()

-                .setResponseProperty(

-                        getHttpServletRequest(),

-                        internalPortletWindow,

-                        name, value);

-    }

-

-    public String encodeURL(String path) {

-        if (path.indexOf("://") == -1 && !path.startsWith("/")) {

-            throw new IllegalArgumentException(

-                "only absolute URLs or full path URIs are allowed");

-        }

-        

-        ResourceURLProvider provider = getContainer()

-        		.getRequiredContainerServices()

-        		.getPortalCallbackService()

-        		.getResourceURLProvider(

-        				httpServletRequest,

-        				internalPortletWindow);

-        if (path.indexOf("://") != -1) {

-            provider.setAbsoluteURL(path);

-        } else {

-            provider.setFullPath(path);

-        }

-        return getHttpServletResponse().encodeURL(provider.toString());

-    }

-    

-    

-    // InternalPortletResponse impl --------------------------------------------

-    

-    public InternalPortletWindow getInternalPortletWindow() {

-        return internalPortletWindow;

-    }

-    

-    

-    // Internal Methods --------------------------------------------------------

-    

-    /**

-     * Returns the portlet container.

-     * @return the portlet container.

-     */

-    protected PortletContainer getContainer() {

-        return container;

-    }

-    

-    /**

-     * Returns the nested HttpServletRequest instance.

-     * @return the nested HttpServletRequest instance.

-     */

-    protected HttpServletRequest getHttpServletRequest() {

-        return httpServletRequest;

-    }

-    

-    /**

-     * Returns the nested HttpServletResponse instance.

-     * @return the nested HttpServletResponse instance.

-     */

-    public HttpServletResponse getHttpServletResponse() {

-        return (HttpServletResponse) super.getResponse();

-    }

-    

-    

-    // HttpServletResponse Methods ---------------------------------------------

-    

-    public String encodeUrl(String url) {

-        return this.encodeURL(url);

-    }

-    

-    /**

-     * TODO: javadoc about why we are using a wrapped writer here.

-     * @see org.apache.pluto.util.PrintWriterServletOutputStream

-     */

-    public ServletOutputStream getOutputStream()

-    throws IllegalStateException, IOException {

-        if (usingWriter) {

-            throw new IllegalStateException(

-            		"getPortletOutputStream can't be used "

-            		+ "after getWriter was invoked.");

-        }

-        if (wrappedWriter == null) {

-            wrappedWriter = new PrintWriterServletOutputStream(

-            		getHttpServletResponse().getWriter());

-        }

-        usingStream = true;

-        return wrappedWriter;

-    }

-    

-    public PrintWriter getWriter()

-    throws IllegalStateException, IOException {

-        if (usingStream) {

-            throw new IllegalStateException(

-            		"getWriter can't be used "

-            		+ "after getOutputStream was invoked.");

-        }

-        usingWriter = true;

-        return getHttpServletResponse().getWriter();

-    }

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletSessionImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletSessionImpl.java
deleted file mode 100644
index 65f8c63..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletSessionImpl.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import java.util.Enumeration;

-import java.util.Vector;

-

-import javax.portlet.PortletContext;

-import javax.portlet.PortletSession;

-import javax.portlet.PortletSessionUtil;

-import javax.servlet.http.HttpSessionContext;

-import javax.servlet.http.HttpSession;

-import javax.servlet.ServletContext;

-

-import org.apache.pluto.internal.InternalPortletWindow;

-import org.apache.pluto.util.ArgumentUtility;

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-

-/**

- * Implementation of the <code>javax.portlet.PortletSession</code> interface.

- * 

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public class PortletSessionImpl implements PortletSession, HttpSession {

-	

-	/** Logger. */

-    private static final Log LOG = LogFactory.getLog(PortletSessionImpl.class);

-    

-    /** The default scope (<code>PORTLET_SCOPE</code>) for storing objects. */

-    private static final int DEFAULT_SCOPE = PortletSession.PORTLET_SCOPE;

-    

-    /** The portlet scope namespace as defined in PLT. 15.3. */

-    private static final String PORTLET_SCOPE_NAMESPACE = "javax.portlet.p.";

-    

-    /** The portlet window ID / attribute name separator as defined in PLT. 15.3. */

-    private static final char ID_NAME_SEPARATOR = '?';

-

-    

-    // Private Member Variables ------------------------------------------------

-    

-    /** The wrapped HttpSession object. */

-    private HttpSession httpSession = null;

-    

-    /** The portlet context. */

-    private PortletContext portletContext = null;

-    

-    /** The internal portlet window. */

-    private InternalPortletWindow internalPortletWindow = null;

-    

-    

-    // Constructor -------------------------------------------------------------

-    

-    /**

-     * Constructs an instance.

-     */

-    public PortletSessionImpl(PortletContext portletContext,

-                              InternalPortletWindow internalPortletWindow,

-                              HttpSession httpSession) {

-        this.portletContext = portletContext;

-        this.internalPortletWindow = internalPortletWindow;

-        this.httpSession = httpSession;

-    }

-    

-    

-    // PortletSession Impl: Attributes -----------------------------------------

-    

-    public Object getAttribute(String name) {

-        return getAttribute(name, DEFAULT_SCOPE);

-    }

-    

-    /**

-     * Returns the attribute of the specified name under the given scope.

-     * 

-     * @param name  the attribute name.

-     * @param scope  the scope under which the attribute object is stored.

-     * @return the attribute object.

-     */

-    public Object getAttribute(String name, int scope) {

-    	ArgumentUtility.validateNotNull("attributeName", name);

-    	String key = (scope == PortletSession.APPLICATION_SCOPE)

-    			? name : createPortletScopedId(name);

-    	return httpSession.getAttribute(key);

-    }

-    

-    public Enumeration getAttributeNames() {

-        return getAttributeNames(DEFAULT_SCOPE);

-    }

-    

-    public Enumeration getAttributeNames(int scope) {

-    	// Return all attribute names in the nested HttpSession object.

-        if (scope == PortletSession.APPLICATION_SCOPE) {

-            return httpSession.getAttributeNames();

-        }

-        // Return attribute names with the portlet-scoped prefix.

-        else {

-            Vector portletScopedNames = new Vector();

-            for (Enumeration en = httpSession.getAttributeNames();

-            		en.hasMoreElements(); ) {

-            	String name = (String) en.nextElement();

-                if (isInCurrentPortletScope(name)) {

-                	portletScopedNames.add(

-                			PortletSessionUtil.decodeAttributeName(name));

-                }

-           }

-            return portletScopedNames.elements();

-        }

-    }

-    

-    public void removeAttribute(String name) {

-        removeAttribute(name, DEFAULT_SCOPE);

-    }

-

-    public void removeAttribute(String name, int scope) {

-    	ArgumentUtility.validateNotNull("attributeName", name);

-    	if (scope == PortletSession.APPLICATION_SCOPE) {

-    		httpSession.removeAttribute(name);

-    	} else {

-    		httpSession.removeAttribute(createPortletScopedId(name));

-    	}

-    }

-    

-    public void setAttribute(String name, Object value) {

-        setAttribute(name, value, DEFAULT_SCOPE);

-    }

-

-    public void setAttribute(String name, Object value, int scope) {

-    	ArgumentUtility.validateNotNull("attributeName", name);

-    	if (scope == PortletSession.APPLICATION_SCOPE) {

-    		httpSession.setAttribute(name, value);

-    	} else {

-    		httpSession.setAttribute(createPortletScopedId(name),  value);

-    	}

-    }

-

-    

-    // PortletSession Impl: Other Methods --------------------------------------

-    

-    public PortletContext getPortletContext() {

-        return portletContext;

-    }

-

-    public long getCreationTime() {

-        return httpSession.getCreationTime();

-    }

-

-    public String getId() {

-        return httpSession.getId();

-    }

-

-    public long getLastAccessedTime() {

-        return httpSession.getLastAccessedTime();

-    }

-

-    public int getMaxInactiveInterval() {

-        return httpSession.getMaxInactiveInterval();

-    }

-

-    public void invalidate() throws IllegalStateException {

-        httpSession.invalidate();

-    }

-

-    public boolean isNew() throws IllegalStateException {

-        return httpSession.isNew();

-    }

-    

-    /**

-     * Specifies the time, in seconds, between client requests, before the

-     * portlet container invalidates this session. A negative time indicates

-     * the session should never timeout.

-     * <p>

-     * [Portlet Spec. PLT. 15.4.] If the PortletSession object is invalidated

-     * by a portlet, the portlet container must invalidate the associated

-     * HttpSession object.

-     * </p>

-     * @param interval  an integer specifying the number of seconds.

-     */ 

-    public void setMaxInactiveInterval(int interval) {

-        httpSession.setMaxInactiveInterval(interval);

-        if (LOG.isDebugEnabled()) {

-            LOG.debug("Session timeout set to: " + interval);

-        }

-    }

-    

-    

-    // Private Methods ---------------------------------------------------------

-    

-    /**

-     * Creates portlet-scoped ID for the specified attribute name.

-     * Portlet-scoped ID for a given attribute name has the following form:

-     * <code>javax.portlet.p.&lt;ID&gt;?&lt;name&gt;</code>

-     * where <code>ID</code> is a unique identification for the portlet window

-     * (assigned by the portal/portlet-container) that must not contain a '?'

-     * character. <code>name</code> is the attribute name.

-     * <p>

-     * Refer to Portlet Specification PLT. 15.3 for more details.

-     * </p>

-     * @param name  the attribute name.

-     * @return portlet-scoped ID for the attribute name.

-     */

-    private String createPortletScopedId(String name) {

-    	StringBuffer buffer = new StringBuffer();

-    	buffer.append(PORTLET_SCOPE_NAMESPACE);

-    	buffer.append(internalPortletWindow.getId().getStringId());

-    	buffer.append(ID_NAME_SEPARATOR);

-    	buffer.append(name);

-    	return buffer.toString();

-    }

-    

-    /**

-     * Checks if the attribute name in APPLICATION_SCOPE is in the current

-     * portlet scope. 

-     * @param name  the attribute name to check.

-     * @return true if the attribute name is in the current portlet scope.

-     * @see #createPortletScopedId(String)

-     */

-    private boolean isInCurrentPortletScope(String name) {

-    	// Portlet-scoped attribute names MUST start with "javax.portlet.p.",

-    	//   and contain the ID-name separator '?'.

-    	if (name.startsWith(PORTLET_SCOPE_NAMESPACE)

-    			&& name.indexOf(ID_NAME_SEPARATOR) > -1) {

-        	String id = name.substring(PORTLET_SCOPE_NAMESPACE.length(),

-        	                           name.indexOf(ID_NAME_SEPARATOR));

-        	return (id.equals(internalPortletWindow.getId().getStringId()));

-        }

-    	// Application-scoped attribute names are not in portlet scope.

-    	else {

-        	return false;

-        }

-    }

-    

-    

-    // HttpSession Impl --------------------------------------------------------

-    

-    public ServletContext getServletContext() {

-        return httpSession.getServletContext();

-    }

-

-    /**

-     * DEPRECATED: implemented for backwards compatability with HttpSession.

-     * @deprecated

-     */

-    public HttpSessionContext getSessionContext() {

-        return httpSession.getSessionContext();

-    }

-

-    public Object getValue(String name) {

-        return this.getAttribute(name, DEFAULT_SCOPE);

-    }

-

-    /**

-     * DEPRECATED: Implemented for backwards compatibility with HttpSession.

-     * @deprecated

-     */

-    public String[] getValueNames() {

-        return httpSession.getValueNames();

-    }

-

-    public void putValue(String name, Object value) {

-        this.setAttribute(name, value, DEFAULT_SCOPE);

-    }

-

-    public void removeValue(String name) {

-        this.removeAttribute(name, DEFAULT_SCOPE);

-    }

-    

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletURLImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletURLImpl.java
deleted file mode 100644
index 56ad017..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletURLImpl.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import java.util.Enumeration;

-import java.util.HashMap;

-import java.util.Iterator;

-import java.util.Map;

-

-import javax.portlet.PortalContext;

-import javax.portlet.PortletMode;

-import javax.portlet.PortletModeException;

-import javax.portlet.PortletSecurityException;

-import javax.portlet.PortletURL;

-import javax.portlet.WindowState;

-import javax.portlet.WindowStateException;

-

-import org.apache.pluto.PortletContainer;

-import org.apache.pluto.descriptors.portlet.PortletDD;

-import org.apache.pluto.descriptors.portlet.SupportsDD;

-import org.apache.pluto.internal.InternalPortletWindow;

-import org.apache.pluto.spi.PortletURLProvider;

-import org.apache.pluto.util.StringManager;

-import org.apache.pluto.util.StringUtils;

-

-public class PortletURLImpl implements PortletURL {

-

-    private static final StringManager EXCEPTIONS =

-        StringManager.getManager(PortletURLImpl.class.getPackage().getName());

-

-

-    private PortletContainer container;

-    protected PortletMode mode = null;

-

-    protected Map parameters = new HashMap();

-

-    protected InternalPortletWindow internalPortletWindow;

-

-    protected boolean secure;

-    protected javax.servlet.http.HttpServletRequest servletRequest;

-    protected javax.servlet.http.HttpServletResponse servletResponse;

-    protected WindowState state;

-    protected boolean isAction;

-

-    private PortalContext context;

-

-    public PortletURLImpl(PortletContainer container,

-                          InternalPortletWindow internalPortletWindow,

-                          javax.servlet.http.HttpServletRequest servletRequest,

-                          javax.servlet.http.HttpServletResponse servletResponse,

-                          boolean isAction) {

-        this.container = container;

-        this.internalPortletWindow = internalPortletWindow;

-        this.servletRequest = servletRequest;

-        this.servletResponse = servletResponse;

-        secure = servletRequest.isSecure();

-        this.isAction = isAction;

-        this.context = container.getRequiredContainerServices().getPortalContext();

-    }

-

-    // javax.portlet.PortletURL -------------------------------------------------------------------

-    public void setWindowState(WindowState windowState)

-        throws WindowStateException {

-        if (windowState != null && isWindowStateAllowed(windowState)) {

-            state = windowState;

-            return;

-        }

-

-        throw new WindowStateException(

-            "unsupported Window State used: " + windowState, windowState);

-    }

-

-    public void setPortletMode(PortletMode portletMode)

-        throws PortletModeException {

-        // Test and throw exception if not allowed.

-        isPortletModeAllowed(portletMode);

-        mode = portletMode;

-    }

-

-    public void setParameter(String name, String value) {

-        if (name == null || value == null) {

-            throw new IllegalArgumentException(

-                "name and value must not be null");

-        }

-

-        parameters.put(name, new String[]{value});

-    }

-

-    public void setParameter(String name, String[] values) {

-        if (name == null || values == null || values.length == 0) {

-            throw new IllegalArgumentException(

-                "name and values must not be null or values be an empty array");

-        }

-

-        parameters.put(name, StringUtils.copy(values));

-    }

-

-    /* (non-Javadoc)

-     * @see javax.portlet.PortletURL#setParameters(Map)

-     */

-    public void setParameters(Map parameters) {

-        if (parameters == null) {

-            throw new IllegalArgumentException("Parameters must not be null.");

-        }

-        for (Iterator it = parameters.entrySet().iterator(); it.hasNext();) {

-            Map.Entry entry = (Map.Entry) it.next();

-            if (!(entry.getKey() instanceof String)) {

-                throw new IllegalArgumentException(

-                    "Key must not be null and of type java.lang.String.");

-            }

-            if (!(entry.getValue() instanceof String[])) {

-                throw new IllegalArgumentException(

-                    "Value must not be null and of type java.lang.String[].");

-            }

-        }

-

-        this.parameters = StringUtils.copyParameters(parameters);

-    }

-

-    public void setSecure(boolean secure) throws PortletSecurityException {

-        this.secure = secure;

-    }

-

-    public String toString() {

-        StringBuffer url = new StringBuffer(200);

-

-        PortletURLProvider urlProvider = container

-        		.getRequiredContainerServices()

-        		.getPortalCallbackService()

-        		.getPortletURLProvider(servletRequest, internalPortletWindow);

-

-        if (mode != null) {

-            urlProvider.setPortletMode(mode);

-        }

-        if (state != null) {

-            urlProvider.setWindowState(state);

-        }

-        if (isAction) {

-            urlProvider.setAction(true);

-        }

-        if (secure) {

-            urlProvider.setSecure();

-        }

-        urlProvider.clearParameters();

-        urlProvider.setParameters(parameters);

-

-        url.append(urlProvider.toString());

-

-        return url.toString();

-    }

-    // --------------------------------------------------------------------------------------------

-

-

-    // additional methods -------------------------------------------------------------------------

-    public String getParameter(String name) {

-        return (String) parameters.get(name);

-    }

-

-    public String[] getParameters(String name) {

-        return (String[]) parameters.get(name);

-    }

-

-    public PortletMode getPortletMode() {

-        return mode;

-    }

-

-    public WindowState getWindowState() {

-        return state;

-    }

-    // --------------------------------------------------------------------------------------------

-

-

-    private boolean isPortletModeAllowed(PortletMode mode)

-        throws PortletModeException {

-        if (mode == null) {

-            throw new PortletModeException(

-                EXCEPTIONS.getString("javax.portlet.PortletModeException.null"),

-                null);

-        }

-

-        return isPortletModeAllowedByPortlet(mode)

-               && isPortletModeAllowedByPortal(mode);

-    }

-

-    private boolean isPortletModeAllowedByPortlet(PortletMode mode)

-        throws PortletModeException {

-        // PLT 8.1: View Portlet Mode should always be

-        // supported by a portlet, even if not defined in the descriptor

-        if (mode.equals(PortletMode.VIEW)) {

-            return true;

-        }

-

-        PortletDD dd = internalPortletWindow.getPortletEntity()

-            .getPortletDefinition();

-        Iterator supports = dd.getSupports().iterator();

-        while(supports.hasNext()) {

-            SupportsDD support = (SupportsDD)supports.next();

-            Iterator modes = support.getPortletModes().iterator();

-            while(modes.hasNext()) {

-                String md = (String)modes.next();

-                if (md.toUpperCase().equals(

-                    mode.toString().toUpperCase())) {

-                    return true;

-                }

-            }

-        }

-        String message = EXCEPTIONS.getString(

-            "javax.portlet.PortletModeException.portlet", mode.toString());

-

-        throw new PortletModeException(message, mode);

-    }

-

-    private boolean isPortletModeAllowedByPortal(PortletMode mode)

-        throws PortletModeException {

-        Enumeration supportedModes = context.getSupportedPortletModes();

-        while (supportedModes.hasMoreElements()) {

-            if (supportedModes.nextElement().toString().toUpperCase().equals(

-                (mode.toString().toUpperCase()))) {

-                return true;

-            }

-        }

-        String message = EXCEPTIONS.getString(

-            "javax.portlet.PortletModeException.portal", mode.toString());

-

-        throw new PortletModeException(message, mode);

-    }

-

-    private boolean isWindowStateAllowed(WindowState state) {

-        Enumeration supportedStates = context.getSupportedWindowStates();

-        while (supportedStates.hasMoreElements()) {

-            if (supportedStates.nextElement().toString().toUpperCase().equals(

-                (state.toString().toUpperCase()))) {

-                return true;

-            }

-        }

-        return false;

-    }

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletWindowImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletWindowImpl.java
deleted file mode 100644
index d3a7066..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/PortletWindowImpl.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import javax.portlet.PortletMode;

-import javax.portlet.WindowState;

-import javax.servlet.ServletContext;

-

-import org.apache.pluto.PortletWindow;

-import org.apache.pluto.PortletContainerRuntimeException;

-import org.apache.pluto.PortletWindowID;

-import org.apache.pluto.util.StringManager;

-import org.apache.pluto.internal.InternalPortletWindow;

-import org.apache.pluto.internal.PortletEntity;

-

-/**

- * Implementation of <code>InternalPortletWindow</code> interface.

- * 

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public class PortletWindowImpl implements InternalPortletWindow {

-

-    private static final StringManager EXCEPTIONS = StringManager.getManager(

-    		PortletWindowImpl.class.getPackage().getName());

-    

-    

-    // Private Member Variables ------------------------------------------------

-    

-    /** The underlying portlet window instance. */

-    private PortletWindow portletWindow = null;

-    

-    /** The servlet context of the portlet. */

-    private ServletContext servletContext = null;

-    

-    /** The portlet entity associated with the portlet window. */

-    private PortletEntity entity = null;

-    

-    

-    // Constructor -------------------------------------------------------------

-    

-    /**

-     * Constructs an internal portlet window that wraps a portlet window.

-     * An internal portlet window instance is created everytime when the portlet

-     * container's <code>doRender()</code> or <code>doAction()</code> method is

-     * invoked.

-     * 

-     * @param context  the servlet context from which this window is

-     *        being invoked.

-     * @param portletWindow  the underlying portlet window instance.

-     */

-    public PortletWindowImpl(ServletContext context,

-                                 PortletWindow portletWindow) {

-        this.servletContext = context.getContext(

-        		portletWindow.getContextPath());

-        if (servletContext == null) {

-            throw new PortletContainerRuntimeException(EXCEPTIONS.getString(

-            		"error.config.context.null",

-                    portletWindow.getPortletName(),

-                    portletWindow.getContextPath()));

-        }

-        this.portletWindow = portletWindow;

-    }

-    

-    

-    // PortletWindow Impl ------------------------------------------------------

-    

-    public String getContextPath() {

-        return portletWindow.getContextPath();

-    }

-

-    public String getPortletName() {

-        return portletWindow.getPortletName();

-    }

-

-    public WindowState getWindowState() {

-        return portletWindow.getWindowState();

-    }

-

-    public PortletMode getPortletMode() {

-        return portletWindow.getPortletMode();

-    }

-    

-    public PortletWindowID getId() {

-        return portletWindow.getId();

-    }

-    

-    

-    // InternalPortletWindow Impl ----------------------------------------------

-    

-    public ServletContext getServletContext() {

-        return servletContext;

-    }

-

-    public PortletEntity getPortletEntity() {

-        if (entity == null) {

-            entity = new PortletEntityImpl(servletContext, this);

-        }

-        return entity;

-    }

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/RandomStringUtils.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/RandomStringUtils.java
deleted file mode 100644
index 71d4c97..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/RandomStringUtils.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Copyright 2002-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.pluto.internal.impl;
-
-import java.util.Random;
-/**
- * <strong>Copied from commons-lang. No need for dependency.</strong>
- * 
- * <p>Operations for random <code>String</code>s.</p>
- *
- * @author GenerationJava Core library
- * @author <a href="mailto:bayard@generationjava.com">Henri Yandell</a>
- * @author <a href="mailto:steven@caswell.name">Steven Caswell</a>
- * @author Stephen Colebourne
- * @author Gary Gregory
- * @author Phil Steitz
- * @since 1.0
- * @version $Id$
- */
-public class RandomStringUtils {
-
-    /**
-     * <p>Random object used by random method. This has to be not local
-     * to the random method so as to not return the same value in the
-     * same millisecond.</p>
-     */
-    private static final Random RANDOM = new Random();
-
-    /**
-     * <p><code>RandomStringUtils</code> instances should NOT be constructed in
-     * standard programming. Instead, the class should be used as
-     * <code>RandomStringUtils.random(5);</code>.</p>
-     *
-     * <p>This constructor is public to permit tools that require a JavaBean instance
-     * to operate.</p>
-     */
-    public RandomStringUtils() {
-    }
-
-    // Random
-    //-----------------------------------------------------------------------
-    /**
-     * <p>Creates a random string whose length is the number of characters
-     * specified.</p>
-     *
-     * <p>Characters will be chosen from the set of all characters.</p>
-     *
-     * @param count  the length of random string to create
-     * @return the random string
-     */
-    public static String random(int count) {
-        return random(count, false, false);
-    }
-
-    /**
-     * <p>Creates a random string whose length is the number of characters
-     * specified.</p>
-     *
-     * <p>Characters will be chosen from the set of characters whose
-     * ASCII value is between <code>32</code> and <code>126</code> (inclusive).</p>
-     *
-     * @param count  the length of random string to create
-     * @return the random string
-     */
-    public static String randomAscii(int count) {
-        return random(count, 32, 127, false, false);
-    }
-
-    /**
-     * <p>Creates a random string whose length is the number of characters
-     * specified.</p>
-     *
-     * <p>Characters will be chosen from the set of alphabetic
-     * characters.</p>
-     *
-     * @param count  the length of random string to create
-     * @return the random string
-     */
-    public static String randomAlphabetic(int count) {
-        return random(count, true, false);
-    }
-
-    /**
-     * <p>Creates a random string whose length is the number of characters
-     * specified.</p>
-     *
-     * <p>Characters will be chosen from the set of alpha-numeric
-     * characters.</p>
-     *
-     * @param count  the length of random string to create
-     * @return the random string
-     */
-    public static String randomAlphanumeric(int count) {
-        return random(count, true, true);
-    }
-
-    /**
-     * <p>Creates a random string whose length is the number of characters
-     * specified.</p>
-     *
-     * <p>Characters will be chosen from the set of numeric
-     * characters.</p>
-     *
-     * @param count  the length of random string to create
-     * @return the random string
-     */
-    public static String randomNumeric(int count) {
-        return random(count, false, true);
-    }
-
-    /**
-     * <p>Creates a random string whose length is the number of characters
-     * specified.</p>
-     *
-     * <p>Characters will be chosen from the set of alpha-numeric
-     * characters as indicated by the arguments.</p>
-     *
-     * @param count  the length of random string to create
-     * @param letters  if <code>true</code>, generated string will include
-     *  alphabetic characters
-     * @param numbers  if <code>true</code>, generated string will include
-     *  numeric characters
-     * @return the random string
-     */
-    public static String random(int count, boolean letters, boolean numbers) {
-        return random(count, 0, 0, letters, numbers);
-    }
-
-    /**
-     * <p>Creates a random string whose length is the number of characters
-     * specified.</p>
-     *
-     * <p>Characters will be chosen from the set of alpha-numeric
-     * characters as indicated by the arguments.</p>
-     *
-     * @param count  the length of random string to create
-     * @param start  the position in set of chars to start at
-     * @param end  the position in set of chars to end before
-     * @param letters  if <code>true</code>, generated string will include
-     *  alphabetic characters
-     * @param numbers  if <code>true</code>, generated string will include
-     *  numeric characters
-     * @return the random string
-     */
-    public static String random(int count, int start, int end, boolean letters, boolean numbers) {
-        return random(count, start, end, letters, numbers, null, RANDOM);
-    }
-
-    /**
-     * <p>Creates a random string based on a variety of options, using
-     * default source of randomness.</p>
-     *
-     * <p>This method has exactly the same semantics as
-     * {@link #random(int,int,int,boolean,boolean,char[],Random)}, but
-     * instead of using an externally supplied source of randomness, it uses
-     * the internal static {@link Random} instance.</p>
-     *
-     * @param count  the length of random string to create
-     * @param start  the position in set of chars to start at
-     * @param end  the position in set of chars to end before
-     * @param letters  only allow letters?
-     * @param numbers  only allow numbers?
-     * @param chars  the set of chars to choose randoms from.
-     *  If <code>null</code>, then it will use the set of all chars.
-     * @return the random string
-     * @throws ArrayIndexOutOfBoundsException if there are not
-     *  <code>(end - start) + 1</code> characters in the set array.
-     */
-    public static String random(int count, int start, int end, boolean letters, boolean numbers, char[] chars) {
-        return random(count, start, end, letters, numbers, chars, RANDOM);
-    }
-
-    /**
-     * <p>Creates a random string based on a variety of options, using
-     * supplied source of randomness.</p>
-     *
-     * <p>If start and end are both <code>0</code>, start and end are set
-     * to <code>' '</code> and <code>'z'</code>, the ASCII printable
-     * characters, will be used, unless letters and numbers are both
-     * <code>false</code>, in which case, start and end are set to
-     * <code>0</code> and <code>Integer.MAX_VALUE</code>.
-     *
-     * <p>If set is not <code>null</code>, characters between start and
-     * end are chosen.</p>
-     *
-     * <p>This method accepts a user-supplied {@link Random}
-     * instance to use as a source of randomness. By seeding a single
-     * {@link Random} instance with a fixed seed and using it for each call,
-     * the same random sequence of strings can be generated repeatedly
-     * and predictably.</p>
-     *
-     * @param count  the length of random string to create
-     * @param start  the position in set of chars to start at
-     * @param end  the position in set of chars to end before
-     * @param letters  only allow letters?
-     * @param numbers  only allow numbers?
-     * @param chars  the set of chars to choose randoms from.
-     *  If <code>null</code>, then it will use the set of all chars.
-     * @param random  a source of randomness.
-     * @return the random string
-     * @throws ArrayIndexOutOfBoundsException if there are not
-     *  <code>(end - start) + 1</code> characters in the set array.
-     * @throws IllegalArgumentException if <code>count</code> &lt; 0.
-     * @since 2.0
-     */
-    public static String random(int count, int start, int end, boolean letters, boolean numbers,
-                                char[] chars, Random random) {
-        if (count == 0) {
-            return "";
-        } else if (count < 0) {
-            throw new IllegalArgumentException("Requested random string length " + count + " is less than 0.");
-        }
-        if ((start == 0) && (end == 0)) {
-            end = 'z' + 1;
-            start = ' ';
-            if (!letters && !numbers) {
-                start = 0;
-                end = Integer.MAX_VALUE;
-            }
-        }
-
-        StringBuffer buffer = new StringBuffer();
-        int gap = end - start;
-
-        while (count-- != 0) {
-            char ch;
-            if (chars == null) {
-                ch = (char) (random.nextInt(gap) + start);
-            } else {
-                ch = chars[random.nextInt(gap) + start];
-            }
-            if ((letters && numbers && Character.isLetterOrDigit(ch))
-                || (letters && Character.isLetter(ch))
-                || (numbers && Character.isDigit(ch))
-                || (!letters && !numbers)) {
-                buffer.append(ch);
-            } else {
-                count++;
-            }
-        }
-        return buffer.toString();
-    }
-
-    /**
-     * <p>Creates a random string whose length is the number of characters
-     * specified.</p>
-     *
-     * <p>Characters will be chosen from the set of characters
-     * specified.</p>
-     *
-     * @param count  the length of random string to create
-     * @param chars  the String containing the set of characters to use,
-     *  may be null
-     * @return the random string
-     * @throws IllegalArgumentException if <code>count</code> &lt; 0.
-     */
-    public static String random(int count, String chars) {
-        if (chars == null) {
-            return random(count, 0, 0, false, false, null, RANDOM);
-        }
-        return random(count, chars.toCharArray());
-    }
-
-    /**
-     * <p>Creates a random string whose length is the number of characters
-     * specified.</p>
-     *
-     * <p>Characters will be chosen from the set of characters specified.</p>
-     *
-     * @param count  the length of random string to create
-     * @param chars  the character array containing the set of characters to use,
-     *  may be null
-     * @return the random string
-     * @throws IllegalArgumentException if <code>count</code> &lt; 0.
-     */
-    public static String random(int count, char[] chars) {
-        if (chars == null) {
-            return random(count, 0, 0, false, false, null, RANDOM);
-        }
-        return random(count, 0, chars.length, false, false, chars, RANDOM);
-    }
-
-}
\ No newline at end of file
diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/RenderRequestImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/RenderRequestImpl.java
deleted file mode 100644
index 2d5966c..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/RenderRequestImpl.java
+++ /dev/null
@@ -1,367 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-import org.apache.pluto.Constants;

-import org.apache.pluto.PortletContainer;

-import org.apache.pluto.internal.InternalPortletWindow;

-import org.apache.pluto.internal.InternalPortletRequest;

-import org.apache.pluto.internal.InternalRenderRequest;

-

-import javax.portlet.PortletPreferences;

-import javax.portlet.RenderRequest;

-import javax.servlet.ServletInputStream;

-import javax.servlet.http.HttpServletRequest;

-

-import java.io.BufferedReader;

-import java.io.IOException;

-import java.io.UnsupportedEncodingException;

-import java.util.ArrayList;

-import java.util.HashMap;

-import java.util.Iterator;

-import java.util.List;

-import java.util.Map;

-import java.util.StringTokenizer;

-

-/**

- * Implementation of the <code>javax.portlet.RenderRequest</code> interface.

- * 

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public class RenderRequestImpl extends PortletRequestImpl

-implements RenderRequest, InternalRenderRequest {

-	

-	/** Logger. */

-    private static final Log LOG = LogFactory.getLog(RenderRequestImpl.class);

-    

-    

-    // Private Member Variables ------------------------------------------------

-    

-    /** True if we are in an include call. */

-    private boolean included = false;

-    

-    /** The parameters including parameters appended to the dispatching URI. */

-    private Map parameters = null;

-    

-    /** The portlet preferences. */

-    private PortletPreferences portletPreferences = null;

-    

-    

-    // Constructors ------------------------------------------------------------

-    

-    public RenderRequestImpl(InternalPortletRequest request) {

-        super(request);    

-    }

-

-    public RenderRequestImpl(PortletContainer container,

-                             InternalPortletWindow internalPortletWindow,

-                             HttpServletRequest servletRequest) {

-        super(container, internalPortletWindow, servletRequest);

-        if (LOG.isDebugEnabled()) {

-        	LOG.debug("Created render request for: " + internalPortletWindow);

-        }

-    }

-    

-    

-    // RenderRequest Impl ------------------------------------------------------

-    

-    public PortletPreferences getPreferences() {

-        if (portletPreferences == null) {

-            portletPreferences = new PortletPreferencesImpl(

-            		getPortletContainer(),

-            		getInternalPortletWindow(),

-            		this,

-            		Constants.METHOD_RENDER);

-        }

-        return portletPreferences;

-    }

-    

-    

-    /**

-     * Checks the included flag and returns the content type. If the included

-     * flag is set to true, this method returns null.

-     */

-    public String getContentType() {

-        return included ? null : super.getContentType();

-    }

-    

-    /**

-     * Checks the included flag and returns the content length. If the included

-     * flag is set to true, this method returns 0.

-     */

-    public int getContentLength() {

-        return included ? 0 : super.getContentLength();

-    }

-    

-    /**

-     * Checks the included flag and returns the reader to this rende response.

-     * If the included flag is set to true, this method returns null.

-     */

-    public BufferedReader getReader()

-    throws UnsupportedEncodingException, IOException {

-        return included ? null : super.getReader();

-    }

-    

-    /**

-     * Checks the included flag and returns the input stream to this render

-     * response. If the included flag is set to true, this method returns null.

-     */

-    public ServletInputStream getInputStream() throws IOException {

-        return included ? null : super.getInputStream();

-    }

-    

-    

-    // PortletRequestImpl Overwriting ------------------------------------------

-    

-    protected Map baseGetParameterMap() {

-    	if (included && parameters != null) {

-    		super.setBodyAccessed();

-    		return parameters;

-    	} else {

-    		return super.baseGetParameterMap();

-    	}

-    }

-    

-    

-    // InternalRenderRequest Impl ----------------------------------------------

-    

-    public void setIncluded(boolean included) {

-    	this.included = included;

-        if (!included) {

-        	this.parameters = null;

-        }

-        if (LOG.isDebugEnabled()) {

-        	LOG.debug("Render request's included mode: " + included);

-        }

-    }

-

-    public boolean isIncluded() {

-        return included;

-    }

-    

-    public void setIncludedQueryString(String queryString)

-    throws IllegalStateException {

-    	if (!included) {

-    		throw new IllegalStateException("Parameters cannot be appended to "

-    				+ "render request which is not included in a dispatch.");

-    	}

-    	if (queryString != null && queryString.trim().length() > 0) {

-    		// Copy all the original render parameters.

-    		parameters = new HashMap(super.getParameterMap());

-    		// Merge the appended parameters to the render parameter map.

-    		// The original render parameters should not be overwritten.

-    		mergeQueryString(parameters, queryString);

-    		// Log the new render parameter map.

-    		if (LOG.isDebugEnabled()) {

-    			LOG.debug("Merged parameters: " + parameters.toString());

-    		}

-    	} else {

-    		if (LOG.isDebugEnabled()) {

-    			LOG.debug("No query string appended to the included request.");

-    		}

-    	}

-    }

-    

-    

-    // Included HttpServletRequest (Limited) Impl ------------------------------

-    

-    /*

-     * -------------------------------------------------------------------------

-     * (non-javadoc)

-     * Portlet Spec. PLT. 16.3.3.

-     * The following methods of the HttpServletRequest must return the path and

-     * query string information used to obtain the PortletRequestDispatcher

-     * object:

-     *   getPathInfo

-     *   getPathTranslated

-     *   getQueryString

-     *   getRequestURI

-     *   getServletPath

-     * -------------------------------------------------------------------------

-     */

-    

-    public String getPathInfo() {

-    	String attr = (String) super.getAttribute(

-    			"javax.servlet.include.path_info");

-    	return (included && attr != null) ? attr : super.getPathInfo();

-    }

-

-    public String getQueryString() {

-    	String attr = (String) super.getAttribute(

-    			"javax.servlet.include.query_string");

-    	return (included && attr != null) ? attr : super.getQueryString();

-    }

-    

-    /**

-     * TODO: check PLT.16.3.3. page 67, line 10.

-     */

-    public String getPathTranslated() {

-    	// TODO:

-        return null;

-    }

-    

-    public String getRequestURI() {

-    	String attr = (String) super.getAttribute(

-    			"javax.servlet.include.request_uri");

-        return (included && attr != null) ? attr : super.getRequestURI();

-    }

-    

-    public String getServletPath() {

-        String attr = (String) super.getAttribute(

-                "javax.servlet.include.servlet_path");

-        return (included && attr != null) ? attr : super.getServletPath();

-    }

-    

-    /*

-     * -------------------------------------------------------------------------

-     * (non-Javadoc)

-     * Portlet Spec. PLT. 16.3.3.

-     * The following methods of the HttpServletRequest must return null:

-     *   getProtocol

-     *   getRemoteAddr

-     *   getRemoteHost

-     *   getRealPath

-     *   getRequestURL

-     * -------------------------------------------------------------------------

-     */

-    

-    public String getProtocol() {

-        return included ? null : super.getProtocol();

-    }

-

-    public String getRemoteAddr() {

-        return included ? null : super.getRemoteAddr();

-    }

-

-    public String getRemoteHost() {

-        return included ? null : super.getRemoteHost();

-    }

-

-    public String getRealPath(String path) {

-        return included ? null : super.getRealPath(path);

-    }

-

-    public StringBuffer getRequestURL() {

-        return included ? null : super.getRequestURL();

-    }

-    

-    /*

-     * -------------------------------------------------------------------------

-     * (non-Javadoc)

-     * Portlet Spec. PLT. 16.3.3.

-     * The following methods of the HttpServletRequest must do no operations

-     * and return null:

-     *   getCharacterEncoding

-     *   setCharacterEncoding

-     *   getContentType

-     *   getInputStream

-     *   getReader

-     * The getContentLength method of the HttpServletRequest must return 0.

-     * -------------------------------------------------------------------------

-     */

-    

-    public String getCharacterEncoding() {

-        return included ? null : super.getCharacterEncoding();

-    }

-    

-    public void setCharacterEncoding(String encoding)

-    throws UnsupportedEncodingException {

-        if (!included) {

-        	super.setCharacterEncoding(encoding);

-        }

-    }

-    

-    /*

-     * -------------------------------------------------------------------------

-     * (non-javadoc)

-     * Portlet Spec. PLT. 16.3.3.

-     * The getMethod method of the HttpServletRequest must always return 'GET'.

-     * -------------------------------------------------------------------------

-     */

-    

-    public String getMethod() {

-    	return "GET";

-    }

-    

-    

-    // Private Methods ---------------------------------------------------------

-    

-    /**

-     * Parses the appended query string and merges the appended parameters to

-     * the original parameters. Query parameters are name-value pairs separated

-     * by the '<code>&amp;</code>' character.

-     * @param parameters  the original parameters map.

-     * @param queryString  the appended query string.

-     */

-    private void mergeQueryString(Map parameters, String queryString) {

-    	

-    	// Create the appended parameters map:

-    	//   key is the parameter name as a string,

-    	//   value is a List of parameter values (List of String).

-        Map appendedParameters = new HashMap();

-        

-        // Parse the appended query string.

-    	if (LOG.isDebugEnabled()) {

-    		LOG.debug("Parsing appended query string: " + queryString);

-    	}

-        StringTokenizer st = new StringTokenizer(queryString, "&", false);

-        while (st.hasMoreTokens()) {

-            String token = st.nextToken();

-            int equalIndex = token.indexOf("=");

-            if (equalIndex > 0) {

-                String key = token.substring(0, equalIndex);

-                String value = null;

-                if (equalIndex < token.length() - 1) {

-                	value = token.substring(equalIndex + 1);

-                } else {                	value = "";

-                }

-                List values = (List) appendedParameters.get(key);

-                if (values == null) {

-                	values = new ArrayList();

-                }

-                values.add(value);

-                appendedParameters.put(key, values);

-            }

-        }

-        if (LOG.isDebugEnabled()) {

-            LOG.debug(appendedParameters.size() + " parameters appended.");

-        }

-        

-        // Merge the appended parameters and the original parameters.

-        if (LOG.isDebugEnabled()) {

-        	LOG.debug("Merging appended parameters and original parameters...");

-        }

-    	for (Iterator it = appendedParameters.keySet().iterator();

-    			it.hasNext(); ) {

-    		String key = (String) it.next();

-    		List values = (List) appendedParameters.get(key);

-    		// If the parameter name (key) exists, merge parameter values.

-    		if (parameters.containsKey(key)) {

-    			String[] originalValues = (String[]) parameters.get(key);

-    			if (originalValues != null) {

-    				for (int i = 0; i < originalValues.length; i++) {

-    					values.add(originalValues[i]);

-    				}

-    			}

-    		}

-    		parameters.put(key, (String[]) values.toArray(new String[values.size()]));

-    	}

-    }

-    

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/RenderResponseImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/RenderResponseImpl.java
deleted file mode 100644
index 983c2b7..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/RenderResponseImpl.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-import org.apache.pluto.PortletContainer;

-import org.apache.pluto.internal.InternalPortletWindow;

-import org.apache.pluto.internal.InternalRenderResponse;

-import org.apache.pluto.descriptors.portlet.PortletDD;

-import org.apache.pluto.descriptors.portlet.SupportsDD;

-import org.apache.pluto.spi.PortalCallbackService;

-import org.apache.pluto.util.ArgumentUtility;

-import org.apache.pluto.util.NamespaceMapper;

-import org.apache.pluto.util.StringManager;

-import org.apache.pluto.util.StringUtils;

-import org.apache.pluto.util.impl.NamespaceMapperImpl;

-

-import javax.portlet.PortletURL;

-import javax.portlet.RenderResponse;

-import javax.servlet.http.HttpServletRequest;

-import javax.servlet.http.HttpServletResponse;

-

-import java.io.IOException;

-import java.io.OutputStream;

-import java.io.PrintWriter;

-import java.util.Iterator;

-import java.util.Locale;

-

-/**

- * Implementation of the <code>javax.portlet.RenderResponse</code> interface.

- * 

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public class RenderResponseImpl extends PortletResponseImpl

-implements RenderResponse, InternalRenderResponse {

-    

-	/** Logger. */

-	private static final Log LOG = LogFactory.getLog(RenderResponseImpl.class);

-	

-    private static final StringManager EXCEPTIONS = StringManager.getManager(

-    		RenderResponseImpl.class.getPackage().getName());

-    

-    

-    // Private Member Variables ------------------------------------------------

-    

-    /** True if we are in an include call. */

-    private boolean included = false;

-    

-    /** The current content type. */

-    private String currentContentType = null;

-    

-    private NamespaceMapper mapper = new NamespaceMapperImpl();

-    

-    

-    // Constructor -------------------------------------------------------------

-    

-    public RenderResponseImpl(PortletContainer container,

-                              InternalPortletWindow internalPortletWindow,

-                              HttpServletRequest servletRequest,

-                              HttpServletResponse servletResponse) {

-        super(container, internalPortletWindow, servletRequest, servletResponse);

-    }

-    

-    

-    // RenderResponse Impl -----------------------------------------------------

-    

-    public String getContentType() {

-        // NOTE: in servlet 2.4 we could simply use this:

-        //   return super.getHttpServletResponse().getContentType();

-        return currentContentType;

-    }

-

-    public PortletURL createRenderURL() {

-        return createURL(false);

-    }

-

-    public PortletURL createActionURL() {

-        return createURL(true);

-    }

-

-    public String getNamespace() {

-         String namespace = mapper.encode(getInternalPortletWindow().getId(), "");

-         StringBuffer validNamespace = new StringBuffer();

-         for (int i = 0; i < namespace.length(); i++) {

-         	char ch = namespace.charAt(i);

-         	if (Character.isJavaIdentifierPart(ch)) {

-         		validNamespace.append(ch);

-         	} else {

-         		validNamespace.append('_');

-         	}

-         }

-         return validNamespace.toString();

-    }

-

-    public void setTitle(String title) {

-        PortalCallbackService callback = getContainer()

-        		.getRequiredContainerServices()

-        		.getPortalCallbackService();

-        callback.setTitle(this.getHttpServletRequest(),

-                          getInternalPortletWindow(),

-                          title);

-    }

-

-    public void setContentType(String contentType)

-    throws IllegalArgumentException {

-    	ArgumentUtility.validateNotNull("contentType", contentType);

-        String mimeType = StringUtils.getMimeTypeWithoutEncoding(contentType);

-        if (!isValidContentType(mimeType)) {

-            throw new IllegalArgumentException("Specified content type '"

-            		+ mimeType + "' is not supported.");

-        }

-        getHttpServletResponse().setContentType(mimeType);

-        this.currentContentType = mimeType;

-    }

-

-    public String getCharacterEncoding() {

-        return getHttpServletResponse().getCharacterEncoding();

-    }

-    

-    /**

-     * @see PortletResponseImpl#getOutputStream()

-     * @see #getWriter()

-     */

-    public OutputStream getPortletOutputStream()

-    throws IOException, IllegalStateException {

-        if (currentContentType == null) {

-            String message = EXCEPTIONS.getString("error.contenttype.null");

-            if (LOG.isWarnEnabled()) {

-            	LOG.warn("Current content type is not set.");

-            }

-            throw new IllegalStateException(message);

-        }

-        return super.getOutputStream();

-    }

-    

-    /**

-     * @see PortletResponseImpl#getWriter()

-     * @see #getPortletOutputStream()

-     */

-    public PrintWriter getWriter() throws IOException, IllegalStateException {

-        if (currentContentType == null) {

-            String message = EXCEPTIONS.getString("error.contenttype.null");

-            if (LOG.isWarnEnabled()) {

-            	LOG.warn("Current content type is not set.");

-            }

-            throw new IllegalStateException(message);

-        }

-        return super.getWriter();

-    }

-

-    public Locale getLocale() {

-        return getHttpServletRequest().getLocale();

-    }

-

-    // TODO: port 1.0.1 setBufferSize fix to 1.1

-    public void setBufferSize(int size) {

-        throw new IllegalStateException(

-            "portlet container does not support buffering");

-    }

-

-    public int getBufferSize() {

-        // TODO: return this.getHttpServletResponse().getBufferSize();

-        return 0;

-    }

-

-    public void flushBuffer() throws IOException {

-        getHttpServletResponse().flushBuffer();

-    }

-

-    public void resetBuffer() {

-        getHttpServletResponse().resetBuffer();

-    }

-

-    public boolean isCommitted() {

-        return getHttpServletResponse().isCommitted();

-    }

-

-    public void reset() {

-        getHttpServletResponse().reset();

-    }

-

-    

-    // InternalRenderResponse Impl ---------------------------------------------

-    

-    public void setIncluded(boolean included) {

-        this.included = included;

-    }

-

-    public boolean isIncluded() {

-        return included;

-    }

-    

-    

-    // Included HttpServletResponse (Limited) Impl -----------------------------

-    

-    /**

-     * TODO

-     */

-    public String encodeRedirectUrl(String url) {

-    	if (included) {

-    		return null;

-    	} else {

-    		return super.encodeRedirectUrl(url);

-    	}

-    }

-    

-    /**

-     * TODO

-     */

-    public String encodeRedirectURL(String url) {

-    	if (included) {

-    		return null;

-    	} else {

-    		return super.encodeRedirectURL(url);

-    	}

-    }

-    

-    

-    // Private Methods ---------------------------------------------------------

-    

-    /**

-     * Creates a portlet URL.

-     * TODO: make dynamic? as service?

-     * @param isAction  true for an action URL, false for a render URL.

-     * @return the created portlet (action/render) URL.

-     */

-    private PortletURL createURL(boolean isAction) {

-        return new PortletURLImpl(getContainer(),

-                                  getInternalPortletWindow(),

-                                  getHttpServletRequest(),

-                                  getHttpServletResponse(),

-                                  isAction);

-    }

-    

-    /**

-     * Checks if the specified content type is valid (supported by the portlet).

-     * The specified content type should be a tripped mime type without any

-     * character encoding suffix.

-     * @param contentType  the content type to check.

-     * @return true if the content type is valid, false otherwise.

-     */

-    private boolean isValidContentType(String contentType) {

-    	boolean valid = false;

-    	

-        PortletDD portletDD = getInternalPortletWindow().getPortletEntity()

-        		.getPortletDefinition();

-        for (Iterator it = portletDD.getSupports().iterator();

-        		!valid && it.hasNext(); ) {

-            

-        	SupportsDD supportsDD = (SupportsDD) it.next();

-            String supportedType = supportsDD.getMimeType();

-            

-            // Content type is supported by an exact match.

-            if (supportedType.equals(contentType)) {

-            	valid = true;

-            }

-            // The supported type contains a wildcard.

-            else if (supportedType.indexOf("*") >= 0) {

-            	

-                int index = supportedType.indexOf("/");

-                String supportedPrefix = supportedType.substring(0, index);

-                String supportedSuffix = supportedType.substring(index + 1);

-                

-                index = contentType.indexOf("/");

-                String typePrefix = contentType.substring(0, index);

-                String typeSuffix = contentType.substring(index + 1);

-                

-                // Check if the prefixes match AND the suffixes match.

-                if (supportedPrefix.equals("*") || supportedPrefix.equals(typePrefix)) {

-                    if (supportedSuffix.equals("*") || supportedSuffix.equals(typeSuffix)) {

-                        valid = true;

-                    }

-                }

-            }

-        }

-        // Return the check result.

-        return valid;

-    }

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceBundleFactory.java b/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceBundleFactory.java
deleted file mode 100644
index 5973575..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/internal/impl/ResourceBundleFactory.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import org.apache.pluto.descriptors.portlet.PortletDD;

-import org.apache.pluto.descriptors.portlet.PortletInfoDD;

-import org.apache.pluto.util.StringManager;

-import org.apache.commons.logging.LogFactory;

-import org.apache.commons.logging.Log;

-

-import java.util.*;

-

-/**

- * Factory object used to create Portlet Resource Bundles.

- *

- * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

- *

- */

-class ResourceBundleFactory {

-    

-    private static final Log LOG = 

-        LogFactory.getLog(ResourceBundleFactory.class);

-    

-    private static final StringManager EXCEPTIONS =

-        StringManager.getManager(ResourceBundleFactory.class.getPackage().getName());

-

-    /**

-     * The default (no local) resources bundle for

-     * this bundle.

-     */

-    private InlinePortletResourceBundle defaultBundle;

-

-    /**

-     * All of the previously loaded bundles.

-     */

-    private Map bundles = new HashMap();

-

-    /**

-     * The name of the bundle.

-     */

-    private String bundleName;

-

-    public ResourceBundleFactory(PortletDD dd) {

-        bundleName = dd.getResourceBundle();

-        if(LOG.isDebugEnabled()) {

-            LOG.debug("Resource Bundle Created: "+bundleName);

-        }

-

-        PortletInfoDD info = dd.getPortletInfo();

-        if(info != null) {

-            defaultBundle = new InlinePortletResourceBundle(

-                info.getTitle(), info.getShortTitle(), info.getKeywords()

-            );

-        }

-        else {

-            defaultBundle = new InlinePortletResourceBundle(new Object[][] { {"a", "b"} });

-        }

-   }

-

-    public ResourceBundle getResourceBundle(Locale locale) {

-        if(LOG.isDebugEnabled()) {

-            LOG.debug("Resource Bundle: "+bundleName+" : "+locale+" requested. ");

-        }

-

-        // If allready loaded for this local, return immediately!

-        if (bundles.containsKey(locale)) {

-            return (ResourceBundle) bundles.get(locale);

-        }

-

-        try {

-            ResourceBundle bundle = null;

-            if(bundleName != null) {

-                ClassLoader loader =

-                        Thread.currentThread().getContextClassLoader();

-                bundle = ResourceBundle.getBundle(bundleName, locale, loader);

-                bundles.put(locale, new CombinedPortletResourceBundle(defaultBundle, bundle));

-            }

-            else {

-                bundles.put(locale, defaultBundle);

-            }

-       } catch (MissingResourceException mre) {

-            if(bundleName != null && LOG.isWarnEnabled()) {

-                LOG.info(EXCEPTIONS.getString("warning.resourcebundle.notfound",bundleName, mre.getMessage()));

-            }

-            if(LOG.isDebugEnabled()) {

-                LOG.debug("Using default bundle for locale ("+locale+").");

-            }

-            bundles.put(locale, defaultBundle);

-        }

-       return (ResourceBundle)bundles.get(locale);

-    }

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/package.html b/trunk/pluto-container/src/main/java/org/apache/pluto/package.html
deleted file mode 100644
index b536bc6..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/package.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!--

-Copyright 2004 The Apache Software Foundation

-Licensed  under the  Apache License,  Version 2.0  (the "License");

-you may not use  this file  except in  compliance with the License.

-You may obtain a copy of the License at

-

-http://www.apache.org/licenses/LICENSE-2.0

-

-Unless required by applicable law or agreed to in writing, software

-distributed  under the  License is distributed on an "AS IS" BASIS,

-WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or

-implied.

-

-See the License for the specific language governing permissions and

-limitations under the License.

--->

-<HTML>

-<HEAD><TITLE>Apache Pluto</TITLE></HEAD>

-<BODY>

-<P>The root package of the Pluto Portlet Container.</P>

-

-<P>Portals embedding Pluto must implement the 

-   {@link org.apache.pluto.services.PortletContainerServices}

-   interfac and then retrieve an instance of the container from

-   the {@link org.apache.pluto.PortletContainerFactory}.</P>

-<H3>Initialization of the container</H3>   

-<P>

-<xmp>

-PortletContainerServices services = // your implementation!

-PortletContainer container =

-   PortletContainerFactory.createContainer("MyContainer", services);

-

-ServletContext context = // the servlet context within which the portal is executing

-container.init(servletContext);

-</xmp>

-</P>

-

-<H3>Processing of Requests</H3>   

-<P>

-<xmp>

-if(isActionRequest) {

-    container.doAction(request, response);

-}

-else if(isRenderRequest) {

-    container.doRender(request, response);

-}

-</xmp>

-</P>

-

-<H3>Shutting Down the Container</H3>

-<P>

-<xmp>

-container.destroy();

-</xmp>

-</P>

-

-</BODY>

-</HTML>
\ No newline at end of file
diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/ContainerService.java b/trunk/pluto-container/src/main/java/org/apache/pluto/spi/ContainerService.java
deleted file mode 100644
index 2af7249..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/ContainerService.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.spi;

-

-/**

- * Defines a service and needs to be implemented by all PortletContainerServices.

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public interface ContainerService {

-

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/PortalCallbackService.java b/trunk/pluto-container/src/main/java/org/apache/pluto/spi/PortalCallbackService.java
deleted file mode 100644
index 75ecdce..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/PortalCallbackService.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.spi;

-

-import javax.servlet.http.HttpServletRequest;

-

-import org.apache.pluto.PortletWindow;

-

-import java.util.Map;

-

-/**

- * The callback service interface defining callback methods that will be invoked

- * by the portlet container when necessary.

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @version 1.0

- * @since Sep 21, 2004

- */

-public interface PortalCallbackService extends ContainerService {

-

-    /**

-     * Set the title to be used for this portlet.

-     * @param request  the servlet request.

-     * @param portletWindow  the portlet window.

-     * @param title  the title to set.

-     */

-    public void setTitle(HttpServletRequest request,

-                         PortletWindow portletWindow,

-                         String title);

-

-    /**

-     * Returns a URL provider used to constuct a URL to the given portlet.

-     * @param request  the servlet request.

-     * @param portletWindow  the portlet window.

-     * @return the URL provider used to construct a URL to the given portlet.

-     */

-    public PortletURLProvider getPortletURLProvider(HttpServletRequest request,

-                                                    PortletWindow portletWindow);

-

-    /**

-     * Returns a URL provider used to construct a URL to a resource in the web

-     * application.

-     * @param request  the servlet request.

-     * @param portletWindow  the portlet window.

-     * @return the URL provider used to construct a URL to a resource.

-     */

-    public ResourceURLProvider getResourceURLProvider(HttpServletRequest request,

-                                                      PortletWindow portletWindow);

-

-    public Map getRequestProperties(HttpServletRequest request,

-                                    PortletWindow portletWindow);

-

-    public void setResponseProperty(HttpServletRequest request,

-                                    PortletWindow portletWindow,

-                                    String property,

-                                    String value);

-

-    public void addResponseProperty(HttpServletRequest request,

-                                    PortletWindow portletWindow,

-                                    String property,

-                                    String value);

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/PortletURLProvider.java b/trunk/pluto-container/src/main/java/org/apache/pluto/spi/PortletURLProvider.java
deleted file mode 100644
index 2fcf90e..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/PortletURLProvider.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.spi;

-

-import java.util.Map;

-

-import javax.portlet.PortletMode;

-import javax.portlet.WindowState;

-

-/**

- * Defines the interface used by the portlet container to create Portal URLs.

- * This provider must be implemented by the Portal and provided via the

- * container services upon initialization of the container.

- * 

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @version 1.0

- */

-public interface PortletURLProvider {

-

-

-    /**

-     * Sets the new portlet mode at the URL. If no mode is set at the URL the

-     * currently active mode is used.

-     * @param mode the new portlet mode

-     */

-    public void setPortletMode(PortletMode mode);

-

-    /**

-     * Sets the new window state at the URL. If no state is set at the URL the

-     * currently active state is used.

-     * @param state the new window state

-     */

-    public void setWindowState(WindowState state);

-

-    /**

-     * Specifies whether or not this request should be considered an action

-     * request. If the value specified is false, a render request will be

-     * assumed.

-     */

-    public void setAction(boolean action);

-

-    /**

-     * By calling this method the URL is defined as a secure URL.

-     */

-    public void setSecure();

-

-    /**

-     * Removes all pre-existing parameters in this URL

-     */

-    public void clearParameters();

-

-    /**

-     * Sets the given parameters as parameters into the URL, Removes all

-     * previously set parameters.

-     * @param parameters a map containing the name [java.lang.String] and value

-     *                   [java.lang.String[]] of the parameters.

-     */

-    public void setParameters(Map parameters);

-

-

-    /**

-     * Returns the URL in string format. This method should only be called

-     * once.

-     * @return the URL

-     */

-    public String toString();

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/ResourceURLProvider.java b/trunk/pluto-container/src/main/java/org/apache/pluto/spi/ResourceURLProvider.java
deleted file mode 100644
index 54b66ea..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/ResourceURLProvider.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.spi;

-

-/**

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * @version 1.0

- */

-public interface ResourceURLProvider {

-	

-    /**

-     * Sets the absolute URL to be returned by the provider. E.g.

-     * http://host/wps/portal/hello.gif

-     * @param path the new absolute url

-     */

-    public void setAbsoluteURL(String path);

-

-    /**

-     * Sets a full path URI including the context root. E.g.

-     * /wps/portal/hello.gif

-     * @param path the new absolute url

-     */

-    public void setFullPath(String path);

-

-    /**

-     * Returns a url to a resource as absolute URL starting with protocol so

-     * that it can be accessed by a browser.

-     * @return the URL as string

-     */

-    public String toString();

-    

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/P3PAttributes.java b/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/P3PAttributes.java
deleted file mode 100644
index aac0de3..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/P3PAttributes.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*

- * Copyright 2003-2006 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.spi.optional;

-

-/**

- * As defined in PLT.D of the JSR-168 specification, this class defines a set of 

- * attribute names for user information and their intended 

- * meaning. To allow portals an automated mapping of commonly used user information 

- * attributes portlet programmers should use these attribute names. These attribute names  

- * are derived from the Platform for Privacy Preferences 1.0 (P3P 1.0) Specification by the 

- * W3C (http://www.w3c.org/TR/P3P).  

- * 

- * @author <a href="cdoremus@apache.org">Craig Doremus</a>

- */

-public interface P3PAttributes {

-

-	/*	NOTE: The user.bdate must consist of a string that represents the time in milliseconds 

-	since January 1, 1970, 00:00:00 GMT. */

-	public static final String USER_BDATE = "user.bdate"; 

-	public static final String USER_GENDER = "user.gender";

-	public static final String USER_EMPLOYER = "user.employer";

-	public static final String USER_DEPARTMENT = "user.department";

-	public static final String USER_JOBTITLE = "user.jobtitle";

-	public static final String USER_NAME_PREFIX = "user.name.prefix";

-	public static final String USER_NAME_GIVEN = "user.name.given";

-	public static final String USER_NAME_FAMILY = "user.name.family";

-	public static final String USER_NAME_MIDDLE = "user.name.middle";

-	public static final String USER_NAME_SUFFIX = "user.name.suffix";

-	public static final String USER_NAME_NICKNAME = "user.name.nickName";

-	public static final String USER_HOME_INFO_POSTAL_NAME = "user.home-info.postal.name";

-	public static final String USER_HOME_INFO_POSTAL_STREET = "user.home-info.postal.street";

-	public static final String USER_HOME_INFO_POSTAL_CITY = "user.home-info.postal.city";

-	public static final String USER_HOME_INFO_POSTAL_STATEPROV = "user.home-info.postal.stateprov";

-	public static final String USER_HOME_INFO_POSTAL_POSTALCODE = "user.home-info.postal.postalcode";

-	public static final String USER_HOME_INFO_POSTAL_COUNTRY = "user.home-info.postal.country";

-	public static final String USER_HOME_INFO_POSTAL_ORGANIZATION= "user.home-info.postal.organization";

-	public static final String USER_HOME_INFO_TELECOM_TELEPHONE_INTCODE = "user.home-info.telecom.telephone.intcode";

-	public static final String USER_HOME_INFO_TELECOM_TELEPHONE_LOCCODE = "user.home-info.telecom.telephone.loccode";

-	public static final String USER_HOME_INFO_TELECOM_TELEPHONE_NUMBER = "user.home-info.telecom.telephone.number";

-	public static final String USER_HOME_INFO_TELECOM_TELEPHONE_EXT = "user.home-info.telecom.telephone.ext";

-	public static final String USER_HOME_INFO_TELECOM_TELEPHONE_COMMENT = "user.home-info.telecom.telephone.comment";

-	public static final String USER_HOME_INFO_TELECOM_FAX_INTCODE = "user.home-info.telecom.fax.intcode";

-	public static final String USER_HOME_INFO_TELECOM_FAX_LOCCODE = "user.home-info.telecom.fax.loccode";

-	public static final String USER_HOME_INFO_TELECOM_FAX_NUMBER = "user.home-info.telecom.fax.number";

-	public static final String USER_HOME_INFO_TELECOM_FAX_EXT = "user.home-info.telecom.fax.ext";

-	public static final String USER_HOME_INFO_TELECOM_FAX_COMMENT = "user.home-info.telecom.fax.comment";

-	public static final String USER_HOME_INFO_TELECOM_MOBILE_INTCODE = "user.home-info.telecom.mobile.intcode";

-	public static final String USER_HOME_INFO_TELECOM_MOBILE_LOCCODE = "user.home-info.telecom.mobile.loccode";

-	public static final String USER_HOME_INFO_TELECOM_MOBILE_NUMBER = "user.home-info.telecom.mobile.number";

-	public static final String USER_HOME_INFO_TELECOM_MOBILE_EXT = "user.home-info.telecom.mobile.ext";

-	public static final String USER_HOME_INFO_TELECOM_MOBILE_COMMENT = "user.home-info.telecom.mobile.comment";

-	public static final String USER_HOME_INFO_TELECOM_PAGER_INTCODE = "user.home-info.telecom.pager.intcode";

-	public static final String USER_HOME_INFO_TELECOM_PAGER_LOCCODE = "user.home-info.telecom.pager.loccode";

-	public static final String USER_HOME_INFO_TELECOM_PAGER_NUMBER = "user.home-info.telecom.pager.number";

-	public static final String USER_HOME_INFO_TELECOM_PAGER_EXT = "user.home-info.telecom.pager.ext";

-	public static final String USER_HOME_INFO_TELECOM_PAGER_COMMENT = "user.home-info.telecom.pager.comment";

-	public static final String USER_HOME_INFO_ONLINE_EMAIL = "user.home-info.online.email";

-	public static final String USER_HOME_INFO_ONLINE_URI = "user.home-info.online.uri";

-	public static final String USER_BUSINESS_INFO_POSTAL_NAME = "user.business-info.postal.name";

-	public static final String USER_BUSINESS_INFO_POSTAL_STREET = "user.business-info.postal.street";

-	public static final String USER_BUSINESS_INFO_POSTAL_CITY = "user.business-info.postal.city";

-	public static final String USER_BUSINESS_INFO_POSTAL_STATEPROV = "user.business-info.postal.stateprov";

-	public static final String USER_BUSINESS_INFO_POSTAL_POSTALCODE = "user.business-info.postal.postalcode";

-	public static final String USER_BUSINESS_INFO_POSTAL_COUNTRY = "user.business-info.postal.country";

-	public static final String USER_BUSINESS_INFO_POSTAL_ORGANIZATION = "user.business-info.postal.organization";

-	public static final String USER_BUSINESS_INFO_TELECOM_TELEPHONE_INTCODE = "user.business-info.telecom.telephone.intcode";

-	public static final String USER_BUSINESS_INFO_TELECOM_TELEPHONE_LOCCODE= "user.business-info.telecom.telephone.loccode";

-	public static final String USER_BUSINESS_INFO_TELECOM_TELEPHONE_NUMBER = "user.business-info.telecom.telephone.number";

-	public static final String USER_BUSINESS_INFO_TELECOM_TELEPHONE_EXT = "user.business-info.telecom.telephone.ext";

-	public static final String USER_BUSINESS_INFO_TELECOM_TELEPHONE_COMMENT = "user.business-info.telecom.telephone.comment";

-	public static final String USER_BUSINESS_INFO_TELECOM_FAX_INTCODE = "user.business-info.telecom.fax.intcode";

-	public static final String USER_BUSINESS_INFO_TELECOM_FAX_LOCCODE = "user.business-info.telecom.fax.loccode";

-	public static final String USER_BUSINESS_INFO_TELECOM_FAX_NUMBER = "user.business-info.telecom.fax.number";

-	public static final String USER_BUSINESS_INFO_TELECOM_FAX_EXT = "user.business-info.telecom.fax.ext";

-	public static final String USER_BUSINESS_INFO_TELECOM_FAX_COMMENT = "user.business-info.telecom.fax.comment";

-	public static final String USER_BUSINESS_INFO_TELECOM_MOBILE_INTCODE = "user.business-info.telecom.mobile.intcode";

-	public static final String USER_BUSINESS_INFO_TELECOM_MOBILE_LOCCODE = "user.business-info.telecom.mobile.loccode";

-	public static final String USER_BUSINESS_INFO_TELECOM_MOBILE_NUMBER = "user.business-info.telecom.mobile.number";

-	public static final String USER_BUSINESS_INFO_TELECOM_MOBILE_EXT = "user.business-info.telecom.mobile.ext";

-	public static final String USER_BUSINESS_INFO_TELECOM_MOBILE_COMMENT = "user.business-info.telecom.mobile.comment";

-	public static final String USER_BUSINESS_INFO_TELECOM_PAGER_INTCODE = "user.business-info.telecom.pager.intcode";

-	public static final String USER_BUSINESS_INFO_TELECOM_PAGER_LOCCODE = "user.business-info.telecom.pager.loccode";

-	public static final String USER_BUSINESS_INFO_TELECOM_PAGER_NUMBER = "user.business-info.telecom.pager.number";

-	public static final String USER_BUSINESS_INFO_TELECOM_PAGER_EXT = "user.business-info.telecom.pager.ext";

-	public static final String USER_BUSINESS_INFO_TELECOM_PAGER_COMMENT = "user.business-info.telecom.pager.comment";

-	public static final String USER_BUSINESS_INFO_ONLINE_EMAIL = "user.business-info.online.email";

-	public static final String USER_BUSINESS_INFO_ONLINE_URI = "user.business-info.online.uri";

-	

-	public static final String[] ATTRIBUTE_ARRAY = {

-		"user.bdate",

-		"user.gender",

-		"user.employer",

-		"user.department",

-		"user.jobtitle",

-		"user.name.prefix",

-		"user.name.given",

-		"user.name.family",

-		"user.name.middle",

-		"user.name.suffix",

-		"user.name.nickName",

-		"user.home-info.postal.name",

-		"user.home-info.postal.street",

-		"user.home-info.postal.city",

-		"user.home-info.postal.stateprov",

-		"user.home-info.postal.postalcode",

-		"user.home-info.postal.country",

-		"user.home-info.postal.organization",

-		"user.home-info.telecom.telephone.intcode",

-		"user.home-info.telecom.telephone.loccode",

-		"user.home-info.telecom.telephone.number",

-		"user.home-info.telecom.telephone.ext",

-		"user.home-info.telecom.telephone.comment",

-		"user.home-info.telecom.fax.intcode",

-		"user.home-info.telecom.fax.loccode",

-		"user.home-info.telecom.fax.number",

-		"user.home-info.telecom.fax.ext",

-		"user.home-info.telecom.fax.comment",

-		"user.home-info.telecom.mobile.intcode",

-		"user.home-info.telecom.mobile.loccode",

-		"user.home-info.telecom.mobile.number",

-		"user.home-info.telecom.mobile.ext",

-		"user.home-info.telecom.mobile.comment",

-		"user.home-info.telecom.pager.intcode",

-		"user.home-info.telecom.pager.loccode",

-		"user.home-info.telecom.pager.number",

-		"user.home-info.telecom.pager.ext",

-		"user.home-info.telecom.pager.comment",

-		"user.home-info.online.email",

-		"user.home-info.online.uri",

-		"user.business-info.postal.name",

-		"user.business-info.postal.street",

-		"user.business-info.postal.city",

-		"user.business-info.postal.stateprov",

-		"user.business-info.postal.postalcode",

-		"user.business-info.postal.country",

-		"user.business-info.postal.organization",

-		"user.business-info.telecom.telephone.intcode",

-		"user.business-info.telecom.telephone.loccode",

-		"user.business-info.telecom.telephone.number",

-		"user.business-info.telecom.telephone.ext",

-		"user.business-info.telecom.telephone.comment",

-		"user.business-info.telecom.fax.intcode",

-		"user.business-info.telecom.fax.loccode",

-		"user.business-info.telecom.fax.number",

-		"user.business-info.telecom.fax.ext",

-		"user.business-info.telecom.fax.comment",

-		"user.business-info.telecom.mobile.intcode",

-		"user.business-info.telecom.mobile.loccode",

-		"user.business-info.telecom.mobile.number",

-		"user.business-info.telecom.mobile.ext",

-		"user.business-info.telecom.mobile.comment",

-		"user.business-info.telecom.pager.intcode",

-		"user.business-info.telecom.pager.loccode",

-		"user.business-info.telecom.pager.number",

-		"user.business-info.telecom.pager.ext",

-		"user.business-info.telecom.pager.comment",

-		"user.business-info.online.email",

-		"user.business-info.online.uri"

-	};

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletEnvironmentService.java b/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletEnvironmentService.java
deleted file mode 100644
index 6183907..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletEnvironmentService.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.spi.optional;

-

-import org.apache.pluto.internal.InternalPortletWindow;

-import org.apache.pluto.internal.InternalPortletRequest;

-import org.apache.pluto.internal.InternalPortletResponse;

-import org.apache.pluto.internal.InternalActionResponse;

-

-import javax.servlet.http.HttpServletRequest;

-import javax.servlet.http.HttpServletResponse;

-

-/**

- * Factory Service for creating Portlet request and responses.

- * <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public interface PortletEnvironmentService {

-	

-	public InternalPortletRequest createActionRequest(

-			HttpServletRequest servletRequest,

-			HttpServletResponse servletResponse,

-			InternalPortletWindow internalPortletWindow);

-	

-	public InternalActionResponse createActionRespose(

-			HttpServletRequest servletRequest,

-			HttpServletResponse servletResponse,

-			InternalPortletWindow internalPortletWindow);

-	

-	public InternalPortletRequest createRenderRequest(

-			HttpServletRequest servletRequest,

-			HttpServletResponse servletResponse,

-			InternalPortletWindow internalPortletWindow);

-	

-	public InternalPortletResponse createRenderRespose(

-			HttpServletRequest servletRequest,

-			HttpServletResponse servletResponse,

-			InternalPortletWindow internalPortletWindow);

-	

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletInvokerService.java b/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletInvokerService.java
deleted file mode 100644
index 8db2dc1..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletInvokerService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.spi.optional;

-

-import org.apache.pluto.internal.InternalPortletWindow;

-

-import javax.portlet.ActionRequest;

-import javax.portlet.ActionResponse;

-import javax.portlet.RenderRequest;

-import javax.portlet.RenderResponse;

-import javax.portlet.PortletRequest;

-import javax.portlet.PortletResponse;

-

-/**

- * Service used to invoke portlets.

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public interface PortletInvokerService {

-	

-    public void action(ActionRequest req, ActionResponse res, InternalPortletWindow window);

-

-    public void render(RenderRequest req, RenderResponse res, InternalPortletWindow window);

-

-    public void load(PortletRequest req, PortletResponse res, InternalPortletWindow window);

-	

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletPreferencesService.java b/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletPreferencesService.java
deleted file mode 100644
index 7b321cb..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletPreferencesService.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.spi.optional;

-

-import javax.portlet.PortletRequest;

-

-import org.apache.pluto.PortletWindow;

-import org.apache.pluto.PortletContainerException;

-import org.apache.pluto.internal.InternalPortletPreference;

-import org.apache.pluto.spi.ContainerService;

-

-/**

- * Portlet preferences service that should be implemented by the portal.

- * This is an optional container service.

- * 

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public interface PortletPreferencesService extends ContainerService {

-	

-	/**

-	 * Returns the stored portlet preferences.

-	 * @param portletWindow  the portlet window.

-	 * @param request  the portlet request.

-	 * @return the stored portlet preferences.

-	 * @throws PortletContainerException  if fail to get stored preferences.

-	 */

-    public InternalPortletPreference[] getStoredPreferences(

-    		PortletWindow portletWindow,

-    		PortletRequest request)

-    throws PortletContainerException;

-    

-    /**

-     * Stores the portlet references to the persistent storage.

-     * @param portletWindow  the portlet window.

-     * @param request  the portlet request.

-     * @param preferences  the portlet preferences to store.

-     * @throws PortletContainerException  if fail to store preferences.

-     */

-    public void store(PortletWindow portletWindow,

-                      PortletRequest request,

-                      InternalPortletPreference[] preferences)

-    throws PortletContainerException;

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletRegistryEvent.java b/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletRegistryEvent.java
deleted file mode 100644
index 70d1903..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletRegistryEvent.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.pluto.spi.optional;
-
-import org.apache.pluto.descriptors.portlet.PortletAppDD;
-
-/**
- * Encapsulation of event information.
- *
- * @since 1.1.0
- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
- */
-public class PortletRegistryEvent {
-
-    private String applicationId;
-    private PortletAppDD portletApplicationDescriptor;
-
-
-    public String getApplicationId() {
-        return applicationId;
-    }
-
-    public void setApplicationId(String applicationId) {
-        this.applicationId = applicationId;
-    }
-
-    public PortletAppDD getPortletApplicationDescriptor() {
-        return portletApplicationDescriptor;
-    }
-
-    public void setPortletApplicationDescriptor(PortletAppDD portletApplicationDescriptor) {
-        this.portletApplicationDescriptor = portletApplicationDescriptor;
-    }
-}
diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletRegistryListener.java b/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletRegistryListener.java
deleted file mode 100644
index 2b95727..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletRegistryListener.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.pluto.spi.optional;
-
-/**
- * Listener interface implemented by observers of
- * the PortletRegistry which intend to be notified
- * of new portlet application registrations.
- *
- * @since 1.1.0
- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
- */
-public interface PortletRegistryListener {
-
-    /**
-     * Recieve notification of a newly registered application.
-     *
-     * @param event registry event information
-     */
-    void portletApplicationRegistered(PortletRegistryEvent event);
-
-    /**
-     * Recieve notification of an application which is
-     * removed from service.
-     *
-     * @param event registry event information
-     */
-    void portletApplicationRemoved(PortletRegistryEvent event);
-
-}
diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java b/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java
deleted file mode 100644
index d9a7048..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/PortletRegistryService.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.pluto.spi.optional;
-
-import org.apache.pluto.descriptors.portlet.PortletAppDD;
-import org.apache.pluto.PortletContainerException;
-
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * Interface defining the services used by the container
- * to access portlet application descriptors.  The registry
- * acts as both internally as descriptor cache and publically
- * as a mechanism for notifying the container of new applications.
- *
- * @since 1.1.0
- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
- * 
- */
-public interface PortletRegistryService {
-
-    /**
-     * Retrieve all registered applications.  This list
-     * will only contain those applications which have
-     * been registered with the container.  Others may
-     * or may not be available within the servers.
-     *
-     * @return iterator of all application descriptors.
-     */
-    Iterator getRegisteredPortletApplications()
-        throws PortletContainerException;
-
-    /**
-     * Retrieve the portlet descriptor for the specified
-     * portlet application. If the name does not match
-     * the name of a contextPath registered with the container
-     * the portlet application name must be checked.
-     *
-     * @param name the name of the portlet application.
-     * @return the named portlet application descriptor.
-     */
-    PortletAppDD getPortletApplicationDescriptor(String name)
-        throws PortletContainerException;
-
-    /**
-     * Add a listener which will recieve notifications of newly
-     * registered applications.
-     *
-     * @param listener the listener to add
-     */
-    void addPortletRegistryListener(PortletRegistryListener listener);
-
-    /**
-     * Remove a previously registered listener.
-     *
-     * @param listener the listener to remove
-     */
-    void removePortletRegistryListener(PortletRegistryListener listener);
-
-    
-}
diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/UserInfoAttributesService.java b/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/UserInfoAttributesService.java
deleted file mode 100644
index 0903a82..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/spi/optional/UserInfoAttributesService.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*

- * Copyright 2003-2006 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.spi.optional;

-

-import java.util.Map;

-

-import javax.portlet.PortletRequest;

-

-import org.apache.pluto.PortletContainerException;

-import org.apache.pluto.spi.ContainerService;

-

-/**

- * Used to access user information attributes as described in

- * PLT.17.2 of the JSR-168 specificiation. Attribute persistence is

- * not covered by the spec so it is not done here.

- * 

- * @author <a href="cdoremus@apache.org">Craig Doremus</a>

- */

-public interface UserInfoAttributesService extends ContainerService  {

-

-	/**

-	 * To access user information attributes as defined in PLT.17

-	 * of JSR-168.

-	 * 

-	 * @param request Used to extract the authenticated user name.

-	 * @return A map of names and values of user information attributes

-	 * for a particular authenticated user.

-	 */

-    Map getAttributes(PortletRequest request) 

-    	throws PortletContainerException ;

-    

-	/**

-	 * Persists user information attributes. 

-	 *  

-	 * @param attributes The attributes to persist.

-    void store(UserInfoAttribute[] attributes)

-    	throws PortletContainerException;

-	 */

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/util/ArgumentUtility.java b/trunk/pluto-container/src/main/java/org/apache/pluto/util/ArgumentUtility.java
deleted file mode 100644
index b1d1953..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/util/ArgumentUtility.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*

- * Copyright 2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.util;

-

-import org.apache.commons.logging.Log;

-import org.apache.commons.logging.LogFactory;

-

-/**

- * Static class that provides utility static methods for argument validation.

- * 

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public class ArgumentUtility {

-	

-	/** Logger. */

-    public static final Log LOG = LogFactory.getLog(ArgumentUtility.class);

-    

-    

-    // Static Utility Methods --------------------------------------------------

-    

-    /**

-     * Validates that the passed-in argument value is not null.

-     * @param argumentName  the argument name.

-     * @param argument  the argument value.

-     * @throws IllegalArgumentException  if the argument value is null.

-     */

-    public static void validateNotNull(String argumentName, Object argument)

-    throws IllegalArgumentException {

-        if (argument == null) {

-        	if (LOG.isDebugEnabled()) {

-        		LOG.debug("Validation failed for argument: " + argumentName

-        				+ ": argument should not be null.");

-        	}

-        	throw new IllegalArgumentException(

-        			"Illegal Argument: " + argumentName

-        			+ " (argument should not be null)");

-        }

-    }

-    

-    /**

-     * Validates that the passed-in string argument value is not null or empty.

-     * @param argumentName  the argument name.

-     * @param argument  the argument value.

-     * @throws IllegalArgumentException  if the argument value is null or empty.

-     */

-    public static void validateNotEmpty(String argumentName, String argument)

-    throws IllegalArgumentException {

-        if (argument == null || "".equals(argument)) {

-            if (LOG.isDebugEnabled()) {

-                LOG.debug("Validation failed for argument: " + argumentName

-                		+ ": argument should not be null or empty.");

-            }

-            throw new IllegalArgumentException(

-            		"Illegal Argument: " + argumentName

-            		+ " (argument should not be null or empty)");

-        }

-    }

-    

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/util/Enumerator.java b/trunk/pluto-container/src/main/java/org/apache/pluto/util/Enumerator.java
deleted file mode 100644
index 988f245..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/util/Enumerator.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.util;

-

-import java.util.Collection;

-import java.util.Enumeration;

-import java.util.Iterator;

-import java.util.Map;

-import java.util.NoSuchElementException;

-

-

-/**

- * Uitlity class to wraps an <code>Enumeration</code> around a Collection, i.e.

- * <code>Iterator</code> classes.

- */

-

-public final class Enumerator implements Enumeration {

-

-

-    // Iterator over which the Enumeration takes place

-    private Iterator iterator = null;

-

-

-    /**

-     * Returns an Enumeration over the specified Collection.

-     * @param collection Collection with values that should be enumerated

-     */

-    public Enumerator(Collection collection) {

-        this(collection.iterator());

-    }

-

-

-    /**

-     * Returns an Enumeration over the values of the specified Iterator.

-     * @param iterator Iterator to be wrapped

-     */

-    public Enumerator(Iterator iterator) {

-        super();

-        this.iterator = iterator;

-    }

-

-

-    /**

-     * Returns an Enumeration over the values of the specified Map.

-     * @param map Map with values that should be enumerated

-     */

-    public Enumerator(Map map) {

-        this(map.values().iterator());

-    }

-

-

-    /**

-     * Tests if this enumeration contains more elements.

-     * @return <code>true</code> if this enumeration contains at least one more

-     *         element to provide, <code>false</code> otherwise.

-     */

-    public boolean hasMoreElements() {

-        return (iterator.hasNext());

-    }

-

-

-    /**

-     * Returns the next element of this enumeration.

-     * @return the next element of this enumeration

-     * @throws NoSuchElementException if no more elements exist

-     */

-    public Object nextElement() throws NoSuchElementException {

-        return (iterator.next());

-    }

-

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/util/NamespaceMapper.java b/trunk/pluto-container/src/main/java/org/apache/pluto/util/NamespaceMapper.java
deleted file mode 100644
index 36475c0..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/util/NamespaceMapper.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.util;

-

-import org.apache.pluto.PortletWindowID;

-

-/**

- **/

-public interface NamespaceMapper {

-

-

-    public String encode(PortletWindowID namespace, String name);

-

-    public String encode(PortletWindowID ns1, PortletWindowID ns2, String name);

-

-    public String decode(PortletWindowID ns, String name);

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/util/PrintWriterServletOutputStream.java b/trunk/pluto-container/src/main/java/org/apache/pluto/util/PrintWriterServletOutputStream.java
deleted file mode 100644
index e830891..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/util/PrintWriterServletOutputStream.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.util;

-

-import java.io.IOException;

-import java.io.PrintWriter;

-

-import javax.servlet.ServletOutputStream;

-

-/**

- * This is a specialized class implementing a ServletOutputStream that works in

- * conjunction with a PrintWriter to send data to the browser. It is used when a

- * J2EE server throws an IllegalStateException when you call getOutputStream on

- * a response which someone has previously called getWriter on.

- */

-public class PrintWriterServletOutputStream extends ServletOutputStream {

-

-    /**

-     * The PrintWriter that is wrapped on top of the base input stream

-     */

-    PrintWriter mPrintWriter;

-

-    /**

-     * Construct a ServletOutputStream that coordinates output using a base

-     * ServletOutputStream and a PrintWriter that is wrapped on top of that

-     * OutputStream.

-     */

-    public PrintWriterServletOutputStream(PrintWriter pO) {

-        super();

-        mPrintWriter = pO;

-    }

-

-    /**

-     * Writes an array of bytes

-     * @param pBuf the array to be written

-     * @throws IOException if an I/O error occurred

-     */

-    public void write(byte[] pBuf) throws IOException {

-        char[] cbuf = new char[pBuf.length];

-        for (int i = 0; i < cbuf.length; i++) {

-            cbuf[i] = (char) (pBuf[i] & 0xff);

-        }

-        mPrintWriter.write(cbuf, 0, pBuf.length);

-    }

-

-    /**

-     * Writes a single byte to the output stream

-     */

-    public void write(int pVal) throws IOException {

-        mPrintWriter.write(pVal);

-    }

-

-    /**

-     * Writes a subarray of bytes

-     * @param pBuf    the array to be written

-     * @param pOffset the offset into the array

-     * @param pLength the number of bytes to write

-     * @throws IOException if an I/O error occurred

-     */

-    public void write(byte[] pBuf, int pOffset, int pLength)

-        throws IOException {

-        char[] cbuf = new char[pLength];

-        for (int i = 0; i < pLength; i++) {

-            cbuf[i] = (char) (pBuf[i + pOffset] & 0xff);

-        }

-        mPrintWriter.write(cbuf, 0, pLength);

-    }

-

-    /**

-     * Flushes the stream, writing any buffered output bytes

-     * @throws IOException if an I/O error occurred

-     */

-    public void flush() throws IOException {

-        mPrintWriter.flush();

-    }

-

-    /**

-     * Closes the stream

-     * @throws IOException if an I/O error occurred

-     */

-    public void close() throws IOException {

-        mPrintWriter.close();

-    }

-

-    /**

-     * Prints a string.

-     * @param pVal the String to be printed

-     * @throws IOException if an I/O error has occurred

-     */

-    public void print(String pVal) throws IOException {

-        mPrintWriter.print(pVal);

-    }

-

-    /**

-     * Prints an string followed by a CRLF.

-     * @param pVal the String to be printed

-     * @throws IOException if an I/O error has occurred

-     */

-    public void println(String pVal) throws IOException {

-        mPrintWriter.println(pVal);

-    }

-

-    /**

-     * Prints a CRLF

-     * @throws IOException if an I/O error has occurred

-     */

-    public void println() throws IOException {

-        mPrintWriter.println();

-    }

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/util/StringManager.java b/trunk/pluto-container/src/main/java/org/apache/pluto/util/StringManager.java
deleted file mode 100644
index 6e9546c..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/util/StringManager.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*

- * Copyright 1999,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.util;

-

-import org.apache.commons.logging.LogFactory;

-import org.apache.commons.logging.Log;

-

-import java.net.URLClassLoader;

-import java.text.MessageFormat;

-import java.util.Hashtable;

-import java.util.Locale;

-import java.util.MissingResourceException;

-import java.util.ResourceBundle;

-

-/**

- * An internationalization / localization helper class which reduces the bother

- * of handling ResourceBundles and takes care of the common cases of message

- * formating which otherwise require the creation of Object arrays and such.

- * <p/>

- * <p>The StringManager operates on a package basis. One StringManager per

- * package can be created and accessed via the getManager method call.

- * <p/>

- * <p>The StringManager will look for a ResourceBundle named by the package name

- * given plus the suffix of "LocalStrings". In practice, this means that the

- * localized information will be contained in a LocalStrings.properties file

- * located in the package directory of the classpath.

- * <p/>

- * <p>Please see the documentation for java.util.ResourceBundle for more

- * information.

- * @author James Duncan Davidson [duncan@eng.sun.com]

- * @author James Todd [gonzo@eng.sun.com]

- */

-

-public class StringManager {

-    private static final Log LOG =  LogFactory.getLog(StringManager.class);

-

-    /**

-     * The ResourceBundle for this StringManager.

-     */

-

-    private ResourceBundle bundle;

-    

-    /** 

-     * The package this StringManager belongs to.

-     */

-    private String packageName = null;

-

-    /**

-     * Creates a new StringManager for a given package. This is a private method

-     * and all access to it is arbitrated by the static getManager method call

-     * so that only one StringManager per package will be created.

-     * @param packageName Name of package to create StringManager for.

-     */

-

-    private StringManager(String packageName) {

-        if(LOG.isDebugEnabled()) {

-            LOG.debug("String Manager Created for package: "+packageName);

-        }

-        this.packageName = packageName;

-        String bundleName = packageName + ".LocalStrings";

-        try {

-            bundle = ResourceBundle.getBundle(bundleName);

-            return;

-        } catch (MissingResourceException ex) {

-            // Try from the current loader ( that's the case for trusted apps )

-            ClassLoader cl = Thread.currentThread().getContextClassLoader();

-            if (cl != null) {

-                try {

-                    bundle =

-                    ResourceBundle.getBundle(bundleName, Locale.getDefault(),

-                                             cl);

-                    return;

-                } catch (MissingResourceException ex2) {

-                }

-            }

-            if (cl == null) {

-                cl = this.getClass().getClassLoader();

-            }

-

-            System.out.println("Can't find resource " + bundleName +

-                               " " + cl);

-            if (cl instanceof URLClassLoader) {

-                System.out.println(((URLClassLoader) cl).getURLs());

-            }

-        }

-    }

-

-    /**

-     * Get a string from the underlying resource bundle.

-     * @param key The resource name

-     */

-    public String getString(String key) {

-        return MessageFormat.format(getStringInternal(key), null);

-    }

-

-

-    protected String getStringInternal(String key) {

-        if (key == null) {

-            String msg = "key is null";

-

-            throw new NullPointerException(msg);

-        }

-

-        String str = null;

-

-        if (bundle == null) {

-            return key;

-        }

-        try {

-            str = bundle.getString(key);

-        } catch (MissingResourceException mre) {

-            String name = null;

-            if (packageName == null) {

-                name = "unknown";

-            } else {

-                name = packageName;

-            }

-            str = "Cannot find message in the ResourceBundle associated with key '" + key + "' " +

-                    "(package " + name + ")";

-            LOG.warn(str, mre);

-        }

-

-        return str;

-    }

-

-    /**

-     * Get a string from the underlying resource bundle and format it with the

-     * given set of arguments.

-     * @param key  The resource name

-     * @param args Formatting directives

-     */

-

-    public String getString(String key, Object[] args) {

-        String iString = null;

-        String value = getStringInternal(key);

-

-        // this check for the runtime exception is some pre 1.1.6

-        // VM's don't do an automatic toString() on the passed in

-        // objects and barf out

-

-        try {

-            // ensure the arguments are not null so pre 1.2 VM's don't barf

-            Object nonNullArgs[] = args;

-            for (int i = 0; i < args.length; i++) {

-                if (args[i] == null) {

-                    if (nonNullArgs == args) {

-                        nonNullArgs =

-                        (Object[]) args.clone();

-                    }

-                    nonNullArgs[i] = "null";

-                }

-            }

-

-            iString = MessageFormat.format(value, nonNullArgs);

-        } catch (IllegalArgumentException iae) {

-            StringBuffer buf = new StringBuffer();

-            buf.append(value);

-            for (int i = 0; i < args.length; i++) {

-                buf.append(" arg[").append(i).append("]=").append(args[i]);

-            }

-            iString = buf.toString();

-        }

-        return iString;

-    }

-

-    /**

-     * Get a string from the underlying resource bundle and format it with the

-     * given object argument. This argument can of course be a String object.

-     * @param key The resource name

-     * @param arg Formatting directive

-     */

-

-    public String getString(String key, Object arg) {

-        Object[] args = new Object[]{arg};

-        return getString(key, args);

-    }

-

-    /**

-     * Get a string from the underlying resource bundle and format it with the

-     * given object arguments. These arguments can of course be String objects.

-     * @param key  The resource name

-     * @param arg1 Formatting directive

-     * @param arg2 Formatting directive

-     */

-

-    public String getString(String key, Object arg1, Object arg2) {

-        Object[] args = new Object[]{arg1, arg2};

-        return getString(key, args);

-    }

-

-    /**

-     * Get a string from the underlying resource bundle and format it with the

-     * given object arguments. These arguments can of course be String objects.

-     * @param key  The resource name

-     * @param arg1 Formatting directive

-     * @param arg2 Formatting directive

-     * @param arg3 Formatting directive

-     */

-

-    public String getString(String key, Object arg1, Object arg2,

-                            Object arg3) {

-        Object[] args = new Object[]{arg1, arg2, arg3};

-        return getString(key, args);

-    }

-

-    /**

-     * Get a string from the underlying resource bundle and format it with the

-     * given object arguments. These arguments can of course be String objects.

-     * @param key  The resource name

-     * @param arg1 Formatting directive

-     * @param arg2 Formatting directive

-     * @param arg3 Formatting directive

-     * @param arg4 Formatting directive

-     */

-

-    public String getString(String key, Object arg1, Object arg2,

-                            Object arg3, Object arg4) {

-        Object[] args = new Object[]{arg1, arg2, arg3, arg4};

-        return getString(key, args);

-    }

-    // --------------------------------------------------------------

-    // STATIC SUPPORT METHODS

-    // --------------------------------------------------------------

-

-    private static Hashtable managers = new Hashtable();

-

-    /**

-     * Get the StringManager for a particular package. If a manager for a

-     * package already exists, it will be reused, else a new StringManager will

-     * be created and returned.

-     * @param packageName The package name

-     */

-

-    public synchronized static StringManager getManager(String packageName) {

-        StringManager mgr = (StringManager) managers.get(packageName);

-

-        if (mgr == null) {

-            mgr = new StringManager(packageName);

-            managers.put(packageName, mgr);

-        }

-        return mgr;

-    }

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/util/StringUtils.java b/trunk/pluto-container/src/main/java/org/apache/pluto/util/StringUtils.java
deleted file mode 100644
index fb9aee8..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/util/StringUtils.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.util;

-

-import java.util.HashMap;

-import java.util.Iterator;

-import java.util.Map;

-

-/**

- * Static class hosting a couple of utility methods around strings.

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public class StringUtils {

-	

-	// Private Constructor -----------------------------------------------------

-	

-	/**

-	 * Private constructor that prevents external instantiation.

-	 */

-	private StringUtils() {

-		// Do nothing.

-	}

-	

-	

-	// Static Utility Methods --------------------------------------------------

-	

-    /**

-     * Replaces all occurrences of a pattern within a string by a replacement.

-     * @param source  the string that should be searched.

-     * @param pattern  the pattern that should be replaced.

-     * @param replace  the replacement that should be inserted instead of the

-     *        pattern.

-     * @return The updated source string.

-     */

-    public static String replace(String source, String pattern, String replace) {

-        if (source == null || source.length() == 0

-        		|| pattern == null || pattern.length() == 0) {

-            return source;

-        }

-

-        int k = source.indexOf(pattern);

-

-        if (k == -1) {

-            return source;

-        }

-

-        StringBuffer out = new StringBuffer();

-        int i = 0, l = pattern.length();

-

-        while (k != -1) {

-            out.append(source.substring(i, k));

-

-            if (replace != null) {

-                out.append(replace);

-            }

-

-            i = k + l;

-            k = source.indexOf(pattern, i);

-        }

-        out.append(source.substring(i));

-        return out.toString();

-    }

-    

-    /**

-     * TODO: can't we just use String[].clone()?

-     * @param source

-     * @return

-     */

-    public static String[] copy(String[] source) {

-        if (source == null) {

-            return null;

-        }

-        int length = source.length;

-        String[] result = new String[length];

-        System.arraycopy(source, 0, result, 0, length);

-        return result;

-    }

-    

-    /**

-     * Deep-clones a parameter map. The key is the parameter name as a String

-     * instance, while the value is a String array (String[]) instance.

-     * @param parameters  the parameter map to deep-clone.

-     * @return the deep-cloned parameter map.

-     */

-    public static Map copyParameters(Map parameters) {

-        Map result = new HashMap(parameters);

-        for (Iterator it = result.entrySet().iterator(); it.hasNext();) {

-            Map.Entry entry = (Map.Entry) it.next();

-            if (!(entry.getKey() instanceof String)) {

-                throw new IllegalArgumentException("Parameter map keys "

-                		+ "must not be null and of type java.lang.String.");

-            }

-            try {

-                entry.setValue(copy((String[]) entry.getValue()));

-            } catch (ClassCastException ex) {

-                throw new IllegalArgumentException("Parameter map values "

-                		+ "must not be null and of type java.lang.String[].");

-            }

-        }

-        return result;

-    }

-    

-    /**

-     * Strips the specified mime type by removing the character encoding

-     * specified at the end of the mime type (all characters after the ';').

-     * The stripped mime type is trimmed string which contains no white 

-     * spaces at the beginning and the end.

-     * @param mimeType  the mime type to strip.

-     * @return the stripped mime type.

-     */

-    public static String getMimeTypeWithoutEncoding(String mimeType) {

-        int index = mimeType.indexOf(';');

-        String strippedType = null;

-        if (index == -1) {

-            strippedType = mimeType;

-        } else {

-            strippedType = mimeType.substring(0, index);

-        }

-        return strippedType.trim();

-    }

-

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/util/impl/NamespaceMapperImpl.java b/trunk/pluto-container/src/main/java/org/apache/pluto/util/impl/NamespaceMapperImpl.java
deleted file mode 100644
index d96a952..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/util/impl/NamespaceMapperImpl.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.util.impl;

-

-import org.apache.pluto.PortletWindowID;

-import org.apache.pluto.util.NamespaceMapper;

-

-/**

- * Default implementation of <code>NamespaceMapper</code> interface.

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- */

-public class NamespaceMapperImpl implements NamespaceMapper {

-	

-    public NamespaceMapperImpl() {

-    	// Do nothing.

-    }

-    

-    

-    // NamespaceMapper Impl ----------------------------------------------------

-    

-    public String encode(PortletWindowID portletWindowId, String name) {

-        StringBuffer buffer = new StringBuffer(50);

-        buffer.append("Pluto_");

-        buffer.append(portletWindowId.getStringId());

-        buffer.append('_');

-        buffer.append(name);

-        return buffer.toString();

-    }

-

-    public String encode(PortletWindowID portletWindowId1,

-                         PortletWindowID portletWindowId2,

-                         String name) {

-        StringBuffer buffer = new StringBuffer(50);

-        buffer.append("Pluto_");

-        buffer.append(portletWindowId1.getStringId());

-        buffer.append('_');

-        buffer.append(portletWindowId2.getStringId());

-        buffer.append('_');

-        buffer.append(name);

-        return buffer.toString();

-    }

-

-    public String decode(PortletWindowID portletWindowId, String name) {

-        if (!name.startsWith("Pluto_")) {

-            return null;

-        }

-        StringBuffer buffer = new StringBuffer(50);

-        buffer.append("Pluto_");

-        buffer.append(portletWindowId.getStringId());

-        buffer.append('_');

-        if (!name.startsWith(buffer.toString())) {

-            return null;

-        }

-        return name.substring(buffer.length());

-    }

-    

-}

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/ActionRequestWrapper.java b/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/ActionRequestWrapper.java
deleted file mode 100644
index fc6c8e5..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/ActionRequestWrapper.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.wrappers;

-

-import javax.portlet.ActionRequest;

-

-public class ActionRequestWrapper extends PortletRequestWrapper

-    implements ActionRequest {

-

-    /**

-     * Creates a ServletRequest adaptor wrapping the given request object.

-     * @throws java.lang.IllegalArgumentException

-     *          if the request is null.

-     */

-    public ActionRequestWrapper(ActionRequest actionRequest) {

-        super(actionRequest);

-

-        if (actionRequest == null) {

-            throw new IllegalArgumentException("Request cannot be null");

-        }

-    }

-

-    // javax.portlet.ActionRequest implementation -------------------------------------------------    

-    public java.io.InputStream getPortletInputStream()

-        throws java.io.IOException {

-        return this.getActionRequest().getPortletInputStream();

-    }

-

-    public void setCharacterEncoding(String enc)

-        throws java.io.UnsupportedEncodingException {

-        this.getActionRequest().setCharacterEncoding(enc);

-    }

-

-    public java.io.BufferedReader getReader()

-        throws java.io.UnsupportedEncodingException, java.io.IOException {

-        return this.getActionRequest().getReader();

-    }

-

-    public java.lang.String getCharacterEncoding() {

-        return this.getActionRequest().getCharacterEncoding();

-    }

-

-    public java.lang.String getContentType() {

-        return this.getActionRequest().getContentType();

-    }

-

-    public int getContentLength() {

-        return this.getActionRequest().getContentLength();

-    }

-    

-    // --------------------------------------------------------------------------------------------

-    

-    // additional methods -------------------------------------------------------------------------

-    /**

-     * Return the wrapped ServletRequest object.

-     */

-    public ActionRequest getActionRequest() {

-        return (ActionRequest) getPortletRequest();

-    }

-

-    // --------------------------------------------------------------------------------------------

-}

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/ActionResponseWrapper.java b/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/ActionResponseWrapper.java
deleted file mode 100644
index 9c9e9bd..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/ActionResponseWrapper.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.wrappers;

-

-import java.util.Map;

-

-import javax.portlet.ActionResponse;

-import javax.portlet.PortletMode;

-import javax.portlet.PortletModeException;

-import javax.portlet.WindowState;

-import javax.portlet.WindowStateException;

-

-public class ActionResponseWrapper extends PortletResponseWrapper

-    implements ActionResponse {

-

-    /**

-     * Creates a ServletResponse adaptor wrapping the given response object.

-     * @throws java.lang.IllegalArgumentException

-     *          if the response is null.

-     */

-    public ActionResponseWrapper(ActionResponse actionResponse) {

-        super(actionResponse);

-

-        if (actionResponse == null) {

-            throw new IllegalArgumentException("Response cannot be null");

-        }

-    }

-

-    // javax.portlet.ActionResponse implementation ------------------------------------------------

-    public void setWindowState(WindowState windowState)

-        throws WindowStateException {

-        this.getActionResponse().setWindowState(windowState);

-    }

-

-    public void setPortletMode(PortletMode portletMode)

-        throws PortletModeException {

-        this.getActionResponse().setPortletMode(portletMode);

-    }

-

-    public void sendRedirect(String location) throws java.io.IOException {

-        this.getActionResponse().sendRedirect(location);

-    }

-

-    public void setRenderParameters(Map parameters) {

-        this.getActionResponse().setRenderParameters(parameters);

-    }

-

-    public void setRenderParameter(String key, String value) {

-        this.getActionResponse().setRenderParameter(key, value);

-    }

-

-    public void setRenderParameter(String key, String[] values) {

-        this.getActionResponse().setRenderParameter(key, values);

-    }

-

-    // --------------------------------------------------------------------------------------------

-

-    // additional methods -------------------------------------------------------------------------

-    /**

-     * Return the wrapped ServletResponse object.

-     */

-    public ActionResponse getActionResponse() {

-        return (ActionResponse) getPortletResponse();

-    }

-

-    // --------------------------------------------------------------------------------------------

-}

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/PortletRequestWrapper.java b/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/PortletRequestWrapper.java
deleted file mode 100644
index 6ab11f6..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/PortletRequestWrapper.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.wrappers;

-

-import java.util.Enumeration;

-

-import javax.portlet.PortalContext;

-import javax.portlet.PortletMode;

-import javax.portlet.PortletPreferences;

-import javax.portlet.PortletRequest;

-import javax.portlet.PortletSession;

-import javax.portlet.WindowState;

-

-public class PortletRequestWrapper

-    extends javax.servlet.http.HttpServletRequestWrapper

-    implements PortletRequest {

-

-    /**

-     * Creates a ServletRequest adaptor wrapping the given request object.

-     * @throws java.lang.IllegalArgumentException

-     *          if the request is null.

-     */

-    public PortletRequestWrapper(PortletRequest portletRequest) {

-        super((javax.servlet.http.HttpServletRequest) portletRequest);

-

-        if (portletRequest == null) {

-            throw new IllegalArgumentException("Request cannot be null");

-        }

-    }

-

-    // javax.portlet.PortletRequest implementation -------------------------------------------------

-    public boolean isWindowStateAllowed(WindowState state) {

-        return this.getPortletRequest().isWindowStateAllowed(state);

-    }

-

-    public boolean isPortletModeAllowed(PortletMode mode) {

-        return this.getPortletRequest().isPortletModeAllowed(mode);

-    }

-

-    public PortletMode getPortletMode() {

-        return this.getPortletRequest().getPortletMode();

-    }

-

-    public WindowState getWindowState() {

-        return this.getPortletRequest().getWindowState();

-    }

-

-    public PortletPreferences getPreferences() {

-        return this.getPortletRequest().getPreferences();

-    }

-

-    public PortletSession getPortletSession() {

-        return this.getPortletRequest().getPortletSession();

-    }

-

-    public PortletSession getPortletSession(boolean create) {

-        return this.getPortletRequest().getPortletSession(create);

-    }

-

-    public String getProperty(String name) {

-        return this.getPortletRequest().getProperty(name);

-    }

-

-    public Enumeration getProperties(String name) {

-        return this.getPortletRequest().getProperties(name);

-    }

-

-    public Enumeration getPropertyNames() {

-        return this.getPortletRequest().getPropertyNames();

-    }

-

-    public PortalContext getPortalContext() {

-        return this.getPortletRequest().getPortalContext();

-    }

-

-    public java.lang.String getAuthType() {

-        return this.getPortletRequest().getAuthType();

-    }

-

-    public String getContextPath() {

-        return this.getPortletRequest().getContextPath();

-    }

-

-    public java.lang.String getRemoteUser() {

-        return this.getPortletRequest().getRemoteUser();

-    }

-

-    public java.security.Principal getUserPrincipal() {

-        return this.getPortletRequest().getUserPrincipal();

-    }

-

-    public boolean isUserInRole(java.lang.String role) {

-        return this.getPortletRequest().isUserInRole(role);

-    }

-

-    public Object getAttribute(String name) {

-        return this.getPortletRequest().getAttribute(name);

-    }

-

-    public java.util.Enumeration getAttributeNames() {

-        return this.getPortletRequest().getAttributeNames();

-    }

-

-    public String getParameter(String name) {

-        return this.getPortletRequest().getParameter(name);

-    }

-

-    public java.util.Enumeration getParameterNames() {

-        return this.getPortletRequest().getParameterNames();

-    }

-

-    public String[] getParameterValues(String name) {

-        return this.getPortletRequest().getParameterValues(name);

-    }

-

-    public java.util.Map getParameterMap() {

-        return this.getPortletRequest().getParameterMap();

-    }

-

-    public boolean isSecure() {

-        return this.getPortletRequest().isSecure();

-    }

-

-    public void setAttribute(String name, Object o) {

-        this.getPortletRequest().setAttribute(name, o);

-    }

-

-    public void removeAttribute(String name) {

-        this.getPortletRequest().removeAttribute(name);

-    }

-

-    public String getRequestedSessionId() {

-        return this.getPortletRequest().getRequestedSessionId();

-    }

-

-    public boolean isRequestedSessionIdValid() {

-        return this.getPortletRequest().isRequestedSessionIdValid();

-    }

-

-    public String getResponseContentType() {

-        return this.getPortletRequest().getResponseContentType();

-    }

-

-    public java.util.Enumeration getResponseContentTypes() {

-        return this.getPortletRequest().getResponseContentTypes();

-    }

-

-    public java.util.Locale getLocale() {

-        return this.getPortletRequest().getLocale();

-    }

-

-    public java.util.Enumeration getLocales() {

-        return this.getPortletRequest().getLocales();

-    }

-

-    public String getScheme() {

-        return this.getPortletRequest().getScheme();

-    }

-

-    public String getServerName() {

-        return this.getPortletRequest().getServerName();

-    }

-

-    public int getServerPort() {

-        return this.getPortletRequest().getServerPort();

-    }

-

-    // --------------------------------------------------------------------------------------------

-    

-    // additional methods -------------------------------------------------------------------------

-    /**

-     * Return the wrapped ServletRequest object.

-     */

-    public PortletRequest getPortletRequest() {

-        return (PortletRequest) super.getRequest();

-    }

-

-    /**

-     * Sets the request being wrapped.

-     * @throws java.lang.IllegalArgumentException

-     *          if the request is null.

-     */

-    public void setRequest(PortletRequest request) {

-        if (request == null) {

-            throw new IllegalArgumentException("Request cannot be null");

-        }

-        setRequest((javax.servlet.http.HttpServletRequest) request);

-    }

-    // --------------------------------------------------------------------------------------------

-}

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/PortletResponseWrapper.java b/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/PortletResponseWrapper.java
deleted file mode 100644
index ffc8bcc..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/PortletResponseWrapper.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.wrappers;

-

-import javax.portlet.PortletResponse;

-

-public class PortletResponseWrapper

-    extends javax.servlet.http.HttpServletResponseWrapper

-    implements PortletResponse {

-

-    /**

-     * Creates a ServletResponse adaptor wrapping the given response object.

-     * @throws java.lang.IllegalArgumentException

-     *          if the response is null.

-     */

-    public PortletResponseWrapper(PortletResponse portletResponse) {

-        super((javax.servlet.http.HttpServletResponse) portletResponse);

-

-        if (portletResponse == null) {

-            throw new IllegalArgumentException("Response cannot be null");

-        }

-    }

-

-    // javax.portlet.PortletResponse implementation ------------------------------------------------

-    public void addProperty(String key, String value) {

-        this.getPortletResponse().addProperty(key, value);

-    }

-

-    public void setProperty(String key, String value) {

-        this.getPortletResponse().setProperty(key, value);

-    }

-

-    public String encodeURL(String path) {

-        return this.getPortletResponse().encodeURL(path);

-    }

-    // --------------------------------------------------------------------------------------------

-

-    // additional methods -------------------------------------------------------------------------

-    /**

-     * Return the wrapped ServletResponse object.

-     */

-    public PortletResponse getPortletResponse() {

-        return (PortletResponse) super.getResponse();

-    }

-

-    /**

-     * Sets the response being wrapped.

-     * @throws java.lang.IllegalArgumentException

-     *          if the response is null.

-     */

-    public void setResponse(PortletResponse response) {

-        if (response == null) {

-            throw new IllegalArgumentException("Response cannot be null");

-        }

-        setResponse((javax.servlet.http.HttpServletResponse) response);

-    }

-    // --------------------------------------------------------------------------------------------

-}

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/RenderRequestWrapper.java b/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/RenderRequestWrapper.java
deleted file mode 100644
index 488321c..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/RenderRequestWrapper.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.wrappers;

-

-import javax.portlet.RenderRequest;

-

-public class RenderRequestWrapper extends PortletRequestWrapper

-    implements RenderRequest {

-

-    /**

-     * Creates a ServletRequest adaptor wrapping the given request object.

-     * @throws java.lang.IllegalArgumentException

-     *          if the request is null.

-     */

-    public RenderRequestWrapper(RenderRequest renderRequest) {

-        super(renderRequest);

-

-        if (renderRequest == null) {

-            throw new IllegalArgumentException("Request cannot be null");

-        }

-    }

-

-    // javax.portlet.RenderRequest implementation -------------------------------------------------

-

-    // --------------------------------------------------------------------------------------------

-    

-    // additional methods -------------------------------------------------------------------------

-    /**

-     * Return the wrapped ServletRequest object.

-     */

-    public RenderRequest getRenderRequest() {

-        return (RenderRequest) getPortletRequest();

-    }

-

-    // --------------------------------------------------------------------------------------------

-}

-

diff --git a/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/RenderResponseWrapper.java b/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/RenderResponseWrapper.java
deleted file mode 100644
index d0a0a6a..0000000
--- a/trunk/pluto-container/src/main/java/org/apache/pluto/wrappers/RenderResponseWrapper.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- * 

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- * 

- *      http://www.apache.org/licenses/LICENSE-2.0

- * 

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.wrappers;

-

-import javax.portlet.PortletURL;

-import javax.portlet.RenderResponse;

-import java.io.IOException;

-import java.io.OutputStream;

-

-public class RenderResponseWrapper extends PortletResponseWrapper

-    implements RenderResponse {

-    /**

-     * Creates a ServletResponse adaptor wrapping the given response object.

-     * @throws java.lang.IllegalArgumentException

-     *          if the response is null.

-     */

-    public RenderResponseWrapper(RenderResponse renderResponse) {

-        super(renderResponse);

-

-        if (renderResponse == null) {

-            throw new IllegalArgumentException("Response cannot be null");

-        }

-    }

-

-    // javax.portlet.RenderResponse implementation ------------------------------------------------

-    public String getContentType() {

-        return this.getRenderResponse().getContentType();

-    }

-

-    public PortletURL createRenderURL() {

-        return this.getRenderResponse().createRenderURL();

-    }

-

-    public PortletURL createActionURL() {

-        return this.getRenderResponse().createActionURL();

-    }

-

-    public String getNamespace() {

-        return this.getRenderResponse().getNamespace();

-    }

-

-    public void setTitle(String title) {

-        this.getRenderResponse().setTitle(title);

-    }

-

-    public void setContentType(String type) {

-        this.getRenderResponse().setContentType(type);

-    }

-

-    public String getCharacterEncoding() {

-        return this.getRenderResponse().getCharacterEncoding();

-    }

-

-    public java.io.PrintWriter getWriter() throws java.io.IOException {

-        return this.getRenderResponse().getWriter();

-    }

-

-    public java.util.Locale getLocale() {

-        return this.getRenderResponse().getLocale();

-    }

-

-    public void setBufferSize(int size) {

-        this.getRenderResponse().setBufferSize(size);

-    }

-

-    public int getBufferSize() {

-        return this.getRenderResponse().getBufferSize();

-    }

-

-    public void flushBuffer() throws java.io.IOException {

-        this.getRenderResponse().flushBuffer();

-    }

-

-    public void resetBuffer() {

-        this.getRenderResponse().resetBuffer();

-    }

-

-    public boolean isCommitted() {

-        return this.getRenderResponse().isCommitted();

-    }

-

-    public void reset() {

-        this.getRenderResponse().reset();

-    }

-

-    public OutputStream getPortletOutputStream() throws IOException {

-        return this.getRenderResponse().getPortletOutputStream();

-    }

-    // --------------------------------------------------------------------------------------------

-

-    // additional methods -------------------------------------------------------------------------

-    /**

-     * Return the wrapped ServletResponse object.

-     */

-    public RenderResponse getRenderResponse() {

-        return (RenderResponse) getPortletResponse();

-    }

-    // --------------------------------------------------------------------------------------------

-

-}

-

diff --git a/trunk/pluto-container/src/main/resources/org/apache/pluto/core/LocalStrings.properties b/trunk/pluto-container/src/main/resources/org/apache/pluto/core/LocalStrings.properties
deleted file mode 100644
index cb28d6d..0000000
--- a/trunk/pluto-container/src/main/resources/org/apache/pluto/core/LocalStrings.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-#

-# Copyright 2005 The Apache Software Foundation

-# Licensed  under the  Apache License,  Version 2.0  (the "License");

-# you may not use  this file  except in  compliance with the License.

-# You may obtain a copy of the License at

-#

-#   http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed  under the  License is distributed on an "AS IS" BASIS,

-# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or

-# implied.

-#

-# See the License for the specific language governing permissions and

-# limitations under the License.

-#

-######################################################################

-

-pluto.container.init=Unable to initialize portlet container {0}

-

-error.load.portlet.xml=Unable to load portlet.xml for context {0} {1}

-

-error.context.descriptor.load=An error occured while loading the context descriptor {0}

-

-####################################

-##       Portlet Invocation       ##

-####################################

-

-error.portlet.invoker=Unable to successfully invoke portlet.  Error during processing.

-error.portlet.invoker.dispatcher=Unable to locate request dispatcher for context {0} and portlet {1}.

-error.portlet.invoker.unavailable=Unable to invoke portlet.  Resource {0} unavailable for {1} seconds.

-

-error.config.context.null=Error creating portlet invoker for portlet {0}.  Unable to locate context {1}.  Check your portlet configuration and ensure cross context dispatching is enabled.

-

diff --git a/trunk/pluto-container/src/main/resources/org/apache/pluto/core/impl/LocalStrings.properties b/trunk/pluto-container/src/main/resources/org/apache/pluto/core/impl/LocalStrings.properties
deleted file mode 100644
index 7d8e59b..0000000
--- a/trunk/pluto-container/src/main/resources/org/apache/pluto/core/impl/LocalStrings.properties
+++ /dev/null
@@ -1,50 +0,0 @@
-#

-# Copyright 2005 The Apache Software Foundation

-# Licensed  under the  Apache License,  Version 2.0  (the "License");

-# you may not use  this file  except in  compliance with the License.

-# You may obtain a copy of the License at

-#

-#   http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed  under the  License is distributed on an "AS IS" BASIS,

-# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or

-# implied.

-#

-# See the License for the specific language governing permissions and

-# limitations under the License.

-#

-######################################################################

-

-## PortletModeException caused by Portal

-javax.portlet.PortletModeException.portlet=Portlet mode '{0}' is not supported by the portal.

-

-## PortletModeException caused by Portlet

-javax.portlet.PortletModeException.portal=Portlet mode '{0}' is not supported by the portlet.

-

-## PortletModeException caused by null mode

-javax.portlet.PortletModeException.null=Portlet mode may not be null.

-

-

-############################################

-# Error Messages:

-#

-############################################

-

-error.null={0} may not be null

-## Replace the following with the above

-error.contenttype.null=Content Type Not Set

-error.attributeName.null=Attribute Name may not be null.

-error.propertyName.null=Property Name may not be null.

-

-error.session.illegalState=Session may not be retrieved before cross context portlet invocation.

-error.preference.readonly=Preference {0} may not be modified.  It is marked as read only.

-

-############################################

-# Warning Messages:

-#

-############################################

-

-warning.resourcebundle.notfound=Unable to locate Resource Bundle {0}: {1}

-

-

diff --git a/trunk/pluto-container/src/main/resources/org/apache/pluto/core/pluto-configuration.properties b/trunk/pluto-container/src/main/resources/org/apache/pluto/core/pluto-configuration.properties
deleted file mode 100644
index f21baeb..0000000
--- a/trunk/pluto-container/src/main/resources/org/apache/pluto/core/pluto-configuration.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-#

-# Copyright 2005 The Apache Software Foundation

-# Licensed  under the  Apache License,  Version 2.0  (the "License");

-# you may not use  this file  except in  compliance with the License.

-# You may obtain a copy of the License at

-#

-#   http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed  under the  License is distributed on an "AS IS" BASIS,

-# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or

-# implied.

-#

-# See the License for the specific language governing permissions and

-# limitations under the License.

-#

-######################################################################

-org.apache.pluto.descriptors.services.PortletAppDescriptorService=org.apache.pluto.descriptors.services.castor.PortletAppDescriptorServiceImpl
\ No newline at end of file
diff --git a/trunk/pluto-container/src/main/resources/org/apache/pluto/environment.properties b/trunk/pluto-container/src/main/resources/org/apache/pluto/environment.properties
deleted file mode 100644
index 1a129f5..0000000
--- a/trunk/pluto-container/src/main/resources/org/apache/pluto/environment.properties
+++ /dev/null
@@ -1,25 +0,0 @@
-#

-# Copyright 2005 The Apache Software Foundation

-# Licensed  under the  Apache License,  Version 2.0  (the "License");

-# you may not use  this file  except in  compliance with the License.

-# You may obtain a copy of the License at

-#

-#   http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed  under the  License is distributed on an "AS IS" BASIS,

-# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or

-# implied.

-#

-# See the License for the specific language governing permissions and

-# limitations under the License.

-#

-######################################################################

-

-pluto.container.name=Pluto

-pluto.container.version.major=1

-pluto.container.version.minor=1.0-SNAPSHOT

-

-javax.portlet.version.major=1

-javax.portlet.version.minor=0

-

diff --git a/trunk/pluto-container/src/main/resources/org/apache/pluto/internal/LocalStrings.properties b/trunk/pluto-container/src/main/resources/org/apache/pluto/internal/LocalStrings.properties
deleted file mode 100644
index d523e28..0000000
--- a/trunk/pluto-container/src/main/resources/org/apache/pluto/internal/LocalStrings.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-#

-# Copyright 2006 The Apache Software Foundation

-# Licensed  under the  Apache License,  Version 2.0  (the "License");

-# you may not use  this file  except in  compliance with the License.

-# You may obtain a copy of the License at

-#

-#   http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed  under the  License is distributed on an "AS IS" BASIS,

-# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or

-# implied.

-#

-# See the License for the specific language governing permissions and

-# limitations under the License.

-#

-######################################################################

-

-error.context.descriptor.load=Error loading context: {0}

-

diff --git a/trunk/pluto-container/src/main/resources/org/apache/pluto/internal/impl/LocalStrings.properties b/trunk/pluto-container/src/main/resources/org/apache/pluto/internal/impl/LocalStrings.properties
deleted file mode 100644
index b6499f0..0000000
--- a/trunk/pluto-container/src/main/resources/org/apache/pluto/internal/impl/LocalStrings.properties
+++ /dev/null
@@ -1,34 +0,0 @@
-#

-# Copyright 2006 The Apache Software Foundation

-# Licensed  under the  Apache License,  Version 2.0  (the "License");

-# you may not use  this file  except in  compliance with the License.

-# You may obtain a copy of the License at

-#

-#   http://www.apache.org/licenses/LICENSE-2.0

-#

-# Unless required by applicable law or agreed to in writing, software

-# distributed  under the  License is distributed on an "AS IS" BASIS,

-# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or

-# implied.

-#

-# See the License for the specific language governing permissions and

-# limitations under the License.

-#

-######################################################################

-javax.portlet.PortletModeException.null=PortletMode is null

-

-javax.portlet.PortletModeException.portlet=PortletMode is not allowed by portlet: {0}

-

-javax.portlet.PortletModeException.portal=PortletMode not supported by portal: {0}

-

-warning.resourcebundle.notfound=Resource not found: {0}

-

-error.null=Null object: {0} 

-

-error.session.illegalState=Session is in an illegal state

-

-error.config.context.null=Error creating portlet invoker for portlet {0}.  Unable to locate context {1}.  Check your portlet configuration and ensure cross context dispatching is enabled.

-

-error.contenttype.null=Null content-type

-

-error.preference.readonly=Read-only preference: {0}

diff --git a/trunk/pluto-container/src/site/site.xml b/trunk/pluto-container/src/site/site.xml
deleted file mode 100644
index 0885652..0000000
--- a/trunk/pluto-container/src/site/site.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<!--

-Copyright 2004 The Apache Software Foundation

-Licensed  under the  Apache License,  Version 2.0  (the "License");

-you may not use  this file  except in  compliance with the License.

-You may obtain a copy of the License at

-

-http://www.apache.org/licenses/LICENSE-2.0

-

-Unless required by applicable law or agreed to in writing, software

-distributed  under the  License is distributed on an "AS IS" BASIS,

-WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or

-implied.

-

-See the License for the specific language governing permissions and

-limitations under the License.

--->

-

-<project name="Pluto Portlet Container">

-  

-  <bannerLeft>

-    <name>Pluto</name>

-    <src>http://portals.apache.org/pluto/images/pluto.png</src>

-    <href>http://portals.apache.org/pluto</href>

-  </bannerLeft>

-  <bannerRight>

-    <src>http://portals.apache.org/pluto/images/banner.png</src>

-  </bannerRight>

-  

-  <body>

-    

-    <links>

-      <item name="Pluto Home" href="http://portals.apache.org/pluto/"/>

-      <item name="JSR 168" href="http://jcp.org/en/jsr/detail?id=168"/>

-      <item name="JSR 286" href="http://jcp.org/en/jsr/detail?id=286"/>

-      <item name="Chinese Translation" href="http://people.apache.org/~zheng/pluto/chinese/"/>

-    </links>

-    

-    <menu name="Portlet Container">

-      <item name="Getting Started" href="/getting-started.html"/>

-      <item name="Embedding Pluto" href="/embed.html"/>

-    </menu>

-    

-    ${reports}

-    

-  </body>

-  

-</project>

-

diff --git a/trunk/pluto-container/src/site/xdoc/embed.xml b/trunk/pluto-container/src/site/xdoc/embed.xml
deleted file mode 100644
index 0df57fd..0000000
--- a/trunk/pluto-container/src/site/xdoc/embed.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<!--

-Copyright 2004 The Apache Software Foundation

-Licensed  under the  Apache License,  Version 2.0  (the "License");

-you may not use  this file  except in  compliance with the License.

-You may obtain a copy of the License at

-

-http://www.apache.org/licenses/LICENSE-2.0

-

-Unless required by applicable law or agreed to in writing, software

-distributed  under the  License is distributed on an "AS IS" BASIS,

-WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or

-implied.

-

-See the License for the specific language governing permissions and

-limitations under the License.

--->

-

-<document>

-  

-  <properties>

-    <title>Embedding the Pluto Container</title>

-    <author email="ddewolf@apache.org">David DeWolf</author>

-  </properties>

-  

-  <body>

-    

-    <section name="Embedding the Pluto Container">

-      

-      <p>

-        This document is currently <b>very</b> breif. Please feel free to submit

-        patches.

-      </p>

-      

-      <subsection name="Steps for Embedding Pluto">

-        <p>

-          <b>Step 1:</b> Implement <code>org.apache.pluto.PortletContainerServices</code>

-        </p>

-        <p>

-          <b>Step 2:</b> Manage the Portlet Container Lifecycle:

-          <ul>

-            <li>

-              Create an instance of the container:

-              <source><![CDATA[

-//

-// Step 1) Create and instance of the PortletContainerService

-//

-PortletContainerServices impl = . . .

-

-//

-// Step 2) Request a new container from the container factory

-//

-PortletContainerFactory factory =

-    PortletContainerFactory.getInstance();

-

-PortletContainer container = factory.createContainer(

-    "My Container Name", impl

-);

-

-//

-// Step 3) Initialize the Container with the embedding 

-//         application's ServletContext

-//

-container.init(ctx);

-              ]]></source>

-            </li>

-            <li>Destroy the Container during Shutdown.</li>

-          </ul>

-        </p>

-        <p>

-          <b>Step 3:</b> Invoke the Container as necessary:

-          <source><![CDATA[

-// Load a portlet

-container.doLoad(portletWindow, request, response);

-// Process a Portlet Action

-container.doAction(portletWindow, request, response);

-// Render a portlet

-container.doRender(portletWindow, request, response);

-          ]]></source>

-        </p>

-        

-      </subsection>

-      

-    </section>

-    

-  </body>

-  

-</document>

-

diff --git a/trunk/pluto-container/src/site/xdoc/getting-started.xml b/trunk/pluto-container/src/site/xdoc/getting-started.xml
deleted file mode 100644
index 8a25ce5..0000000
--- a/trunk/pluto-container/src/site/xdoc/getting-started.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>

-<!--

-Copyright 2004 The Apache Software Foundation

-Licensed  under the  Apache License,  Version 2.0  (the "License");

-you may not use  this file  except in  compliance with the License.

-You may obtain a copy of the License at

-

-http://www.apache.org/licenses/LICENSE-2.0

-

-Unless required by applicable law or agreed to in writing, software

-distributed  under the  License is distributed on an "AS IS" BASIS,

-WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or

-implied.

-

-See the License for the specific language governing permissions and

-limitations under the License.

--->

-

-<document>

-  

-  <properties>

-    <title>Getting Started</title>

-    <author email="ddewolf@apache.org">David DeWolf</author>

-  </properties>

-  

-  <body>

-    

-    <section name="Getting Started">

-      <p>

-        The Pluto Portlet Container is not designed for use by end users. The

-        container is meant to be embeded within portal and web applications to

-        provide Java Portlet Specification compliance. If you are a user looking

-        to develop, test, or deploy portlets, please see the

-        <a href="../pluto-portal-driver/index.html">Pluto Portal Driver</a>.

-      </p>

-      <p>

-        If you are looking for information on how to embed pluto in your portal

-        or web application, please see the <a href="embed.html">embedding pluto</a>

-        documentation for Pluto 1.1.

-      </p>

-    </section>

-    

-  </body>

-  

-</document>

-

diff --git a/trunk/pluto-container/src/test/java/org/apache/pluto/core/PortletContextManagerTest.java b/trunk/pluto-container/src/test/java/org/apache/pluto/core/PortletContextManagerTest.java
deleted file mode 100644
index a1a1425..0000000
--- a/trunk/pluto-container/src/test/java/org/apache/pluto/core/PortletContextManagerTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.apache.pluto.core;
-
-import junit.framework.TestCase;
-
-import javax.servlet.ServletContext;
-
-//import org.easymock.EasyMock;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-
-public class PortletContextManagerTest extends TestCase {
-
-    private PortletContextManager manager;
-    private ServletContext context;
-
-    public void setUp() {
-        /* Java5 Required!
-        context = EasyMock.createMock(ServletContext.class);
-        */
-        manager = PortletContextManager.getManager();
-    }
-
-    public void testComputeContextPath() throws MalformedURLException {
-        /* Java5 Required!
-            URL url = new URL("file://usr/local/apache-tomcat-5.1.19/webapps/my-test-context/WEB-INF/web.xml");
-            EasyMock.expect(context.getResource("/WEB-INF/web.xml")).andReturn(url);
-            EasyMock.replay(context);
-            assertEquals("/my-test-context", manager.computeContextPath(context));
-            EasyMock.verify(context);
-
-
-            EasyMock.reset(context);
-            url = new URL("file://usr/local/apache-tomcat-5.1.19/webapps/my-test-context.war!/WEB-INF/web.xml");
-            EasyMock.expect(context.getResource("/WEB-INF/web.xml")).andReturn(url);
-            EasyMock.replay(context);
-            assertEquals("/my-test-context", manager.computeContextPath(context));
-        */
-        }
-}
diff --git a/trunk/pluto-container/src/test/java/org/apache/pluto/internal/impl/EnvironmentTest.java b/trunk/pluto-container/src/test/java/org/apache/pluto/internal/impl/EnvironmentTest.java
deleted file mode 100644
index 14cea2c..0000000
--- a/trunk/pluto-container/src/test/java/org/apache/pluto/internal/impl/EnvironmentTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*

- * Copyright 2005 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import java.util.Properties;

-

-import org.apache.pluto.util.PlutoTestCase;

-

-/**

- * Test Class

- *

- * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

- * @version 1.0

- * @since June 1, 2005

- */

-public class EnvironmentTest extends PlutoTestCase {

-

-    private Properties props;

-

-    public void setUp() throws Exception {

-        props = new Properties();

-        props.load(Environment.class.getResourceAsStream("/org/apache/pluto/environment.properties"));

-    }

-

-    public void testContainerMajorVersion() {

-        assertEquals(props.getProperty("pluto.container.version.major"), Environment.getPortletContainerMajorVersion());

-    }

-

-    public void testContainerMinorVersion() {

-        assertEquals(props.getProperty("pluto.container.version.minor"), Environment.getPortletContainerMinorVersion());

-    }

-

-    public void testContainerName() {

-        assertEquals(props.getProperty("pluto.container.name"), Environment.getPortletContainerName());

-    }

-

-    public void testSpecVersion() {

-        assertEquals(Integer.parseInt(props.getProperty("javax.portlet.version.major")), Environment.getMajorSpecificationVersion());

-    }

-

-    public void testSpecMinorVersion() {

-        assertEquals(Integer.parseInt(props.getProperty("javax.portlet.version.minor")), Environment.getMinorSpecificationVersion());

-    }

-

-    public void testServerInfo() {

-        assertContains("Server Info does not contain container name.", props.getProperty("pluto.container.name"), Environment.getServerInfo());

-        assertContains("Server Info does not contain container name.", props.getProperty("pluto.container.version.major"), Environment.getServerInfo());

-        assertContains("Server Info does not contain container name.", props.getProperty("pluto.container.version.minor"), Environment.getServerInfo());

-    }

-}

diff --git a/trunk/pluto-container/src/test/java/org/apache/pluto/internal/impl/ResourceBundleFactoryTest.java b/trunk/pluto-container/src/test/java/org/apache/pluto/internal/impl/ResourceBundleFactoryTest.java
deleted file mode 100644
index 23bf9eb..0000000
--- a/trunk/pluto-container/src/test/java/org/apache/pluto/internal/impl/ResourceBundleFactoryTest.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.internal.impl;

-

-import org.apache.pluto.util.PlutoTestCase;

-import org.apache.pluto.descriptors.portlet.PortletDD;

-import org.apache.pluto.descriptors.portlet.PortletInfoDD;

-

-import java.util.ListResourceBundle;

-import java.util.Locale;

-import java.util.ResourceBundle;

-

-import junit.framework.Assert;

-

-/**

- * Unit test for the resource bundle factory.

- * @author ddewolf@apache.org

- * @since Jul 30, 2005

- */

-public class ResourceBundleFactoryTest extends PlutoTestCase {

-

-    private PortletDD validDD;

-

-    public void setUp() throws Exception {

-        super.setUp();

-

-        validDD = new PortletDD();

-

-        PortletInfoDD info = new PortletInfoDD();

-        info.setTitle("Info Title");

-        info.setShortTitle("Info Short Title");

-        info.setKeywords("Info Keywords");

-        validDD.setPortletInfo(info);

-        

-        validDD.setResourceBundle(TestResourceBundle.class.getName());

-    }

-

-    public void tearDown() throws Exception {

-        super.setUp();

-        validDD = null;

-    }

-

-    public void testGetBundleAllSpecified() {

-        ResourceBundleFactory factory = new ResourceBundleFactory(validDD);

-        ResourceBundle bundle = factory.getResourceBundle(Locale.getDefault());

-

-        Assert.assertEquals("Bundle Title", bundle.getString("javax.portlet.title"));

-        Assert.assertEquals("Bundle Short Title", bundle.getString("javax.portlet.short-title"));

-        Assert.assertEquals("Bundle Keywords", bundle.getString("javax.portlet.keywords"));

-    }

-

-    public void testGetResourceBundleNoBundle() {

-        validDD.setResourceBundle(null);

-        ResourceBundleFactory factory = new ResourceBundleFactory(validDD);

-        ResourceBundle bundle = factory.getResourceBundle(Locale.getDefault());

-

-        Assert.assertEquals("Info Title", bundle.getString("javax.portlet.title"));

-        Assert.assertEquals("Info Short Title", bundle.getString("javax.portlet.short-title"));

-        Assert.assertEquals("Info Keywords", bundle.getString("javax.portlet.keywords"));

-    }

-

-    public void testGetResourceBundleNoInfo() {

-        validDD.setPortletInfo(null);

-        ResourceBundleFactory factory = new ResourceBundleFactory(validDD);

-        ResourceBundle bundle = factory.getResourceBundle(Locale.getDefault());

-

-        Assert.assertEquals("Bundle Title", bundle.getString("javax.portlet.title"));

-        Assert.assertEquals("Bundle Short Title", bundle.getString("javax.portlet.short-title"));

-        Assert.assertEquals("Bundle Keywords", bundle.getString("javax.portlet.keywords"));

-    }

-

-    public void testGetResourceBundleNoBundleNullValues() {

-        validDD.setResourceBundle(null);

-        validDD.getPortletInfo().setTitle(null);

-        validDD.getPortletInfo().setShortTitle(null);

-        validDD.getPortletInfo().setKeywords(null);

-        ResourceBundleFactory factory = new ResourceBundleFactory(validDD);

-        ResourceBundle bundle = factory.getResourceBundle(Locale.getDefault());

-

-        try {

-            Assert.assertEquals(null, bundle.getString("javax.portlet.title"));

-            fail("Exception should have been thrown.");

-        }

-        catch(Throwable t) {

-

-        }

-

-        try {

-            Assert.assertEquals(null, bundle.getString("javax.portlet.short-title"));

-            fail("Exception should have been throw.");

-        }

-        catch(Throwable t) {

-

-        }

-

-        try {

-            Assert.assertEquals(null, bundle.getString("javax.portlet.keywords"));

-            fail("Exception should have been thrown.");

-        }

-        catch(Throwable t) {

-

-        }

-    }

-

-

-    public static class TestResourceBundle extends ListResourceBundle {

-        

-        private Object[][] contents = {

-            {"javax.portlet.title", "Bundle Title"},

-            {"javax.portlet.short-title", "Bundle Short Title"},

-            {"javax.portlet.keywords", "Bundle Keywords"}

-        };

-

-        protected Object[][] getContents() {

-            return contents;

-        }

-    }

-

-

-

-}

diff --git a/trunk/pluto-container/src/test/java/org/apache/pluto/util/ArgumentUtilityTest.java b/trunk/pluto-container/src/test/java/org/apache/pluto/util/ArgumentUtilityTest.java
deleted file mode 100644
index 42a5ed6..0000000
--- a/trunk/pluto-container/src/test/java/org/apache/pluto/util/ArgumentUtilityTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*

- * Copyright 2005 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.util;

-

-

-

-/**

- * Test Class

- *

- * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

- * @version 1.0

- * @since June 1, 2005

- */

-public class ArgumentUtilityTest extends PlutoTestCase {

-

-    public void testValidateNotNullWhenNull()

-    throws Exception {

-        Object[] parameters = new Object[] {"arg", null};

-        assertException(new ArgumentUtility(), "validateNotNull",

-                        parameters, IllegalArgumentException.class);

-    }

-

-    public void testValidateNotNullWhenNotNull() {

-        ArgumentUtility.validateNotNull("arg", "notnull");

-    }

-

-    public void testValidateNotNullOrEmptyWhenNull() {

-

-        Object[] parameters = new Object[] {"arg", null};

-        Class[] parameterTypes = new Class[] { String.class, String.class };

-        assertException(new ArgumentUtility(), "validateNotEmpty",

-                        parameterTypes,

-                        parameters, IllegalArgumentException.class);

-    }

-

-    public void testValidateNotNullOrEmptyWhenEmpty() {

-

-        Object[] parameters = new Object[] {"arg", ""};

-        assertException(new ArgumentUtility(), "validateNotEmpty",

-                        parameters, IllegalArgumentException.class);

-    }

-

-    public void testValidateNotNullOrEmptyWhenValid() {

-        ArgumentUtility.validateNotEmpty("arg", "notempty");

-    }

-

-}

diff --git a/trunk/pluto-container/src/test/java/org/apache/pluto/util/PlutoTestCase.java b/trunk/pluto-container/src/test/java/org/apache/pluto/util/PlutoTestCase.java
deleted file mode 100644
index 45e02f3..0000000
--- a/trunk/pluto-container/src/test/java/org/apache/pluto/util/PlutoTestCase.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*

- * Copyright 2005 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.util;

-

-import java.lang.reflect.Method;

-import java.lang.reflect.InvocationTargetException;

-

-import org.jmock.MockObjectTestCase;

-

-/**

- * Test Class

- *

- * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

- * @version 1.0

- * @since June 1, 2005

- */

-public abstract class PlutoTestCase extends MockObjectTestCase {

-

-    public void setUp() throws Exception {

-        System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");

-        System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "ERROR");

-    }

-

-    protected void assertException(Object target, String methodName,

-                                 Object[] parameters, Class exceptionType) {

-            Class[] parameterClasses = new Class[parameters.length];

-            for(int i=0;i<parameters.length;i++) {

-                parameterClasses[i] = parameters[i]==null?Object.class:parameters[i].getClass();

-            }

-        assertException(target, methodName, parameterClasses, parameters, exceptionType);

-    }

-

-    protected void assertException(Object target, String methodName,

-                                 Class[] parameterClasses,

-                                 Object[] parameters, Class exceptionType) {

-        try {

-            Class targetClass = target.getClass();

-            Method method = targetClass.getMethod(methodName, parameterClasses);

-            method.invoke(target, parameters);

-        }

-        catch(InvocationTargetException ite) {

-            Throwable t = ite.getTargetException();

-            if(!t.getClass().equals(exceptionType)) {

-                fail("Incorrect Exception thrown.  Expected: "+exceptionType.getName()+", recieved "+t.getClass().getName());

-            }

-        }

-        catch(Throwable t) {

-            fail("Invalid Test.  Reflection invocation and setup failed.");

-        }

-    }

-

-    protected void assertContains(String message, String expectedSubstring,

-                                  String testString) {

-        if (testString.indexOf(expectedSubstring) < 0) {

-            fail(message);

-        } 

-    }

-}

diff --git a/trunk/pluto-container/src/test/java/org/apache/pluto/util/StringUtilsTest.java b/trunk/pluto-container/src/test/java/org/apache/pluto/util/StringUtilsTest.java
deleted file mode 100644
index be476c7..0000000
--- a/trunk/pluto-container/src/test/java/org/apache/pluto/util/StringUtilsTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*

- * Copyright 2005 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.util;

-

-import java.util.Map;

-import java.util.Iterator;

-

-/**

- * Test Class

- *

- * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

- * @version 1.0

- * @since June 1, 2005

- */

-public class StringUtilsTest extends PlutoTestCase {

-

-    public void testReplaceAtBegin() {

-        assertEquals("ReplacedValue", StringUtils.replace("___lacedValue", "___", "Rep"));

-    }

-

-    public void testReplaceAtEnd() {

-        assertEquals("ReplacedValue", StringUtils.replace("ReplacedVa***", "***", "lue"));

-    }

-

-    public void testReplaceInMiddle() {

-        assertEquals("ReplacedValue", StringUtils.replace("Rep(###)Value", "(###)", "laced"));

-    }

-

-    public void testReplaceMultiples() {

-        assertEquals("ReplacedValueReplacedValue", StringUtils.replace("Rep(###)ValueRep(###)Value", "(###)", "laced"));

-    }

-

-    public void testCopy() {

-        String[] original  = new String[] {"one", "two", "three", "four", "five"};

-        String[] results = StringUtils.copy(original);

-        for(int i=0;i<original.length;i++) {

-            assertEquals(original[i], results[i]);

-        }

-    }

-

-    public void testCopyMap() {

-        Map original = new java.util.HashMap();

-        original.put("one", new String[] { "two"});

-        original.put("three", new String[] { "four"});

-        original.put("five", new String[] { "six"});

-        original.put("seven", new String[] { String.valueOf(8), String.valueOf(9) } );

-

-        Map results = StringUtils.copyParameters(original);

-        assertEquals("Map sizes are inconsistent", original.size(), results.size());

-        Iterator it = original.keySet().iterator();

-        while(it.hasNext()) {

-            Object key = it.next();

-            String[] originalValue = (String[])original.get(key);

-            String[] newValue = (String[])results.get(key);

-

-            assertNotNull(originalValue);

-            assertNotNull(newValue);

-            assertEquals(originalValue.length, newValue.length);

-            for(int i=0;i<i++;i++) {

-                assertEquals(originalValue[i], newValue[i]);

-            }

-        }

-    }

-}

diff --git a/trunk/pluto-container/src/test/java/org/apache/pluto/util/impl/NamespaceMapperImplTest.java b/trunk/pluto-container/src/test/java/org/apache/pluto/util/impl/NamespaceMapperImplTest.java
deleted file mode 100644
index 5d104fa..0000000
--- a/trunk/pluto-container/src/test/java/org/apache/pluto/util/impl/NamespaceMapperImplTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*

- * Copyright 2003,2004 The Apache Software Foundation.

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.util.impl;

-

-import org.apache.pluto.PortletWindowID;

-import org.apache.pluto.util.PlutoTestCase;

-import org.apache.pluto.util.NamespaceMapper;

-

-/**

- * Test Class

- *

- * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

- * @version 1.0

- * @since June 1, 2005

- */

-public class NamespaceMapperImplTest extends PlutoTestCase {

-

-    private NamespaceMapper mapper = new NamespaceMapperImpl();

-    private PortletWindowID id1;

-    private PortletWindowID id2;

-

-    public void setUp() throws Exception {

-        super.setUp();

-        id1 = new InternalPortletWindowID();

-        id2 = new InternalPortletWindowID();

-    }

-

-    public void testEncodeUniquenessWithSameName() {

-        String mappedA = mapper.encode(id1, "testNumber1");

-        String mappedB = mapper.encode(id2, "testNumber1");

-        assertFalse(mappedA.equals(mappedB));

-    }

-

-    public void testEncodeUniquenessWithSameObjectID() {

-        String mappedA = mapper.encode(id1, "testNumber1");

-        String mappedB = mapper.encode(id1, "testNumber2");

-        assertFalse(mappedA.equals(mappedB));

-    }

-

-    public void testDecode() {

-        String original = "original";

-        String mappedA = mapper.encode(id1, original);

-        assertEquals(original, mapper.decode(id1, mappedA));

-    }

-

-    public void testDecodeInvalidId() {

-        assertNull(mapper.decode(id1, mapper.encode(id2, "test")));

-    }

-

-    private static int objectIDCounter = 1;

-    

-    

-    private class InternalPortletWindowID implements PortletWindowID {

-    	

-        private int id;

-

-        public InternalPortletWindowID() {

-            id = objectIDCounter++;

-        }

-

-        public String getStringId() {

-            return "uniqueId"+id;

-        }

-    }

-}

diff --git a/trunk/pluto-descriptor-api/pom.xml b/trunk/pluto-descriptor-api/pom.xml
deleted file mode 100644
index 228b79e..0000000
--- a/trunk/pluto-descriptor-api/pom.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright 2005-2006 The Apache Software Foundation
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  
-  <parent>
-    <groupId>org.apache.pluto</groupId>
-    <artifactId>pluto</artifactId>
-    <version>1.1.0-SNAPSHOT</version>
-  </parent>
-  
-  <modelVersion>4.0.0</modelVersion>
-  <artifactId>pluto-descriptor-api</artifactId>
-  <packaging>jar</packaging>
-  <name>Pluto Descriptor Service API</name>
-  
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>${junit.version}</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-  
-  <build>
-    <plugins>
-      <plugin>
-        <artifactId>maven-site-plugin</artifactId>
-        <configuration>
-          <resourcesDirectory>${basedir}/../pluto-site/src/site/resources</resourcesDirectory>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/trunk/pluto-descriptor-api/src/assemble/bin.xml b/trunk/pluto-descriptor-api/src/assemble/bin.xml
deleted file mode 100644
index ae17e12..0000000
--- a/trunk/pluto-descriptor-api/src/assemble/bin.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<!--

-  Copyright 2005-2006 The Apache Software Foundation

-

-  Licensed under the Apache License, Version 2.0 (the "License");

-  you may not use this file except in compliance with the License.

-  You may obtain a copy of the License at

-

-      http://www.apache.org/licenses/LICENSE-2.0

-

-  Unless required by applicable law or agreed to in writing, software

-  distributed under the License is distributed on an "AS IS" BASIS,

-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

-  See the License for the specific language governing permissions and

-  limitations under the License.

--->

-<assembly>

-  <id>bin</id>

-  <formats>

-    <format>tar.gz</format>

-    <format>tar.bz2</format>

-    <format>zip</format>

-  </formats>

-  <fileSets>

-    <fileSet>

-      <includes>

-        <include>README*</include>

-        <include>LICENSE*</include>

-        <include>NOTICE*</include>

-      </includes>

-    </fileSet>

-    <fileSet>

-      <directory>target</directory>

-      <outputDirectory></outputDirectory>

-      <includes>

-        <include>*.jar</include>

-      </includes>

-    </fileSet>

-  </fileSets>

-  <dependencySets>

-

-  </dependencySets>

-</assembly>

-

diff --git a/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/IconDD.java b/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/IconDD.java
deleted file mode 100644
index d8f2293..0000000
--- a/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/IconDD.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*

- * Copyright 2005 The Apache Software Foundation

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.descriptors.common;

-

-/**

- * Resource Icon configuration.

- *

- * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

- * @version $Id: IconDD.java 157038 2005-03-11 03:44:40Z ddewolf $

- * @since Feb 28, 2005

- */

-public class IconDD{

-

-    /** The large icon uri. */

-    private String largeIcon;

-

-    /** The small icon uri. */

-    private String smallIcon;

-

-    /**

-     * Default Constructor.

-     */

-    public IconDD() {

-

-    }

-

-    /**

-     * Retrieve the large icon uri.

-     * @return the uri to the large icon (relative to the context path).

-     */

-    public String getLargeIcon() {

-        return largeIcon;

-    }

-

-    /**

-     * Set the large icon uri.

-     * @param largeIcon the relative path to the icon resource.

-     */

-    public void setLargeIcon(String largeIcon) {

-        this.largeIcon = largeIcon;

-    }

-

-    /**

-     * Retrieve the small icon uri.

-     * @return the uri to the small icon (relative to the context path).

-     */

-    public String getSmallIcon() {

-        return smallIcon;

-    }

-

-    /**

-     * Set the small Icon uri.

-     * @param smallIcon the relative path to the icon resource.

-     */

-    public void setSmallIcon(String smallIcon) {

-        this.smallIcon = smallIcon;

-    }

-

-}

-

diff --git a/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/InitParamDD.java b/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/InitParamDD.java
deleted file mode 100644
index 1b3ec7c..0000000
--- a/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/InitParamDD.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*

- * Copyright 2005 The Apache Software Foundation

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.descriptors.common;

-

-/**

- * Initialization Parameter configuration.

- *

- * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

- * @version $Id: InitParamDD.java 157038 2005-03-11 03:44:40Z ddewolf $

- * @since Feb 28, 2005

- */

-public class InitParamDD {

-

-    /** The name of the parameter. */

-    private String paramName;

-

-    /** The value of the parameter. */

-    private String paramValue;

-

-    /** The description of the parameter. */

-    private String description;

-

-    /**

-     * Default Constructor.

-     */

-    public InitParamDD() {

-

-    }

-

-    /**

-     * Retrieve the name of the parameter.

-     * @return

-     */

-    public String getParamName() {

-        return paramName;

-    }

-

-    /**

-     * Set the name of the parameter.

-     * @param paramName

-     */

-    public void setParamName(String paramName) {

-        this.paramName = paramName;

-    }

-

-    /**

-     * Get the name of the parameter.

-     * @return

-     */

-    public String getParamValue() {

-        return paramValue;

-    }

-

-    /**

-     * Set the value of the parameter.

-     * @param paramValue

-     */

-    public void setParamValue(String paramValue) {

-        this.paramValue = paramValue;

-    }

-

-    /**

-     * Retrieve the description.

-     * @return

-     */

-    public String getDescription() {

-        return description;

-    }

-

-    /**

-     * Set the description of the parameter.

-     * @param description

-     */

-    public void setDescription(String description) {

-        this.description = description;

-    }

-

-}

-

diff --git a/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/SecurityRoleRefDD.java b/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/SecurityRoleRefDD.java
deleted file mode 100644
index 29f2ec3..0000000
--- a/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/SecurityRoleRefDD.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*

- * Copyright 2005 The Apache Software Foundation

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.descriptors.common;

-

-/**

- * Security Role Reference Configuration.

- *

- * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

- * @version $Id: SecurityRoleRefDD.java 157038 2005-03-11 03:44:40Z ddewolf $

- * @since Feb 28, 2005

- */

-public class SecurityRoleRefDD {

-

-    /** The name of the role reference. */

-    private String roleName;

-

-    /** The role to which the reference is linked. */

-    private String roleLink;

-

-    /** The description of what the role is utilized for. */

-    private String description;

-

-    /**

-     * Default Constructor.

-     */

-    public SecurityRoleRefDD() {

-

-    }

-

-    /**

-     * Retrieve the name of the role reference.

-     * @return

-     */

-    public String getRoleName() {

-        return roleName;

-    }

-

-    /**

-     * Set the name of the role reference.

-     * @param roleName

-     */

-    public void setRoleName(String roleName) {

-        this.roleName = roleName;

-    }

-

-    /**

-     * Retrieve then role to which the reference is linked.

-     * @return

-     */

-    public String getRoleLink() {

-        return roleLink;

-    }

-

-    /**

-     * Set the role to which the reference is linked.

-     * @param roleLink

-     */

-    public void setRoleLink(String roleLink) {

-        this.roleLink = roleLink;

-    }

-

-    /**

-     * Retrieve the description of the role reference.

-     * @return

-     */

-    public String getDescription() {

-        return description;

-    }

-

-    /**

-     * Set the description of the role reference.

-     * @param description

-     */

-    public void setDescription(String description) {

-        this.description = description;

-    }

-}

-

diff --git a/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/package.html b/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/package.html
deleted file mode 100644
index b73328b..0000000
--- a/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/package.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!--

-Copyright 2004 The Apache Software Foundation

-Licensed  under the  Apache License,  Version 2.0  (the "License");

-you may not use  this file  except in  compliance with the License.

-You may obtain a copy of the License at

-

-http://www.apache.org/licenses/LICENSE-2.0

-

-Unless required by applicable law or agreed to in writing, software

-distributed  under the  License is distributed on an "AS IS" BASIS,

-WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or

-implied.

-

-See the License for the specific language governing permissions and

-limitations under the License.

--->

-<HTML>

-<BODY>

-Common deployment descriptor elements used in many descriptors.

-</BODY>

-</HTML>
\ No newline at end of file
diff --git a/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/package.html b/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/package.html
deleted file mode 100644
index 1cdc80d..0000000
--- a/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/package.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!--

-Copyright 2004 The Apache Software Foundation

-Licensed  under the  Apache License,  Version 2.0  (the "License");

-you may not use  this file  except in  compliance with the License.

-You may obtain a copy of the License at

-

-http://www.apache.org/licenses/LICENSE-2.0

-

-Unless required by applicable law or agreed to in writing, software

-distributed  under the  License is distributed on an "AS IS" BASIS,

-WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or

-implied.

-

-See the License for the specific language governing permissions and

-limitations under the License.

--->

-<HTML>

-<BODY>

-Object Model and Read/Write Services for deployment descriptors.

-Specifically used to represent web.xml and portlet.xml files.

-</BODY>

-</HTML>
\ No newline at end of file
diff --git a/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletAppDD.java b/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletAppDD.java
deleted file mode 100644
index c885ff9..0000000
--- a/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletAppDD.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*

- * Copyright 2005 The Apache Software Foundation

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.descriptors.portlet;

-

-import java.util.ArrayList;

-import java.util.List;

-

-/**

- * Portlet Application Configuration.

- *

- * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

- * @version $Id: PortletAppDD.java 157475 2005-03-14 22:13:18Z ddewolf $

- * @since Mar 6, 2005

- */

-public class PortletAppDD {

-

-    /** The defined portlets within the system. */

-    private List portlets = new ArrayList();

-

-    /**

-     * Default Constructor.

-     */

-    public PortletAppDD() {

-    }

-

-    /**

-     * Retrieve the portlets which exist within this application.

-     * @return

-     */

-    public List getPortlets() {

-        return portlets;

-    }

-

-    /**

-     * Set the portlets that exist within this application.

-     * @param portlets

-     */

-    public void setPortlets(List portlets) {

-        this.portlets = portlets;

-    }

-

-

-}

-

diff --git a/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletDD.java b/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletDD.java
deleted file mode 100644
index 16a07ef..0000000
--- a/trunk/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet/PortletDD.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*

- * Copyright 2005 The Apache Software Foundation

- *

- * Licensed under the Apache License, Version 2.0 (the "License");

- * you may not use this file except in compliance with the License.

- * You may obtain a copy of the License at

- *

- *      http://www.apache.org/licenses/LICENSE-2.0

- *

- * Unless required by applicable law or agreed to in writing, software

- * distributed under the License is distributed on an "AS IS" BASIS,

- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

- * See the License for the specific language governing permissions and

- * limitations under the License.

- */

-package org.apache.pluto.descriptors.portlet;

-

-import java.util.List;

-import java.util.ArrayList;

-

-/**

- * Bare bones implementation of the Portlet descriptor.

- * 

- * FIXME: Hmmm... What do you mean, David?  --ZHENG Zhong

- * 

- * Eventually this should be flushed out :), but for the sake of timing I'll be lazy for now.

- *

- * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>

- * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a>

- * 

- * @since Mar 6, 2005

- */

-public class PortletDD {

-	

-	// Private Member Variables ------------------------------------------------

-	

-    /** The unique name of the portlet. */

-    private String portletName = null;

-

-    /** The class which implements the portlet interface. */

-    private String portletClass = null;

-

-    private String resourceBundle = null;

-

-    private PortletInfoDD portletInfo = null;

-

-    private PortletPreferencesDD portletPreferences = new PortletPreferencesDD();

-

-    private List initParams = new ArrayList();

-

-    private List supports = new ArrayList();

-

-    /** All security role references. */

-    private List securityRoleRefs = new ArrayList();

-    

-    

-    // Constructor -------------------------------------------------------------

-    

-    /**

-     * Default no-arg constructor.

-     */

-    public PortletDD() {

-    	// Do nothing.

-    }

-    

-    

-    // Public Methods ----------------------------------------------------------

-    

-    /**

-     * Retrieve the unique name of the portlet.

-     * @return

-     */

-    public String getPortletName() {

-        return portletName;

-    }

-

-    /**

-     * Set the unique name of the portlet.

-     * @param portletName Value of the portlet-name element for this portlet in portlet.xml.

-     * @throws IllegalArgumentException if the name has a period since it is used

-     * to create the portlet ID in <code>PortletWindowConfig.createPortletId()</code>

-     * using a dot to separate the context path from the portlet name.

-     * @see PortletWindowConfig#createPortletId(String, String)

-     */

-    public void setPortletName(String portletName) {

-    	if (portletName.indexOf('.') != -1) {

-    		throw new IllegalArgumentException("Portlet name must not have a dot(period). Please remove the dot from the value of the portlet-name element ("+ portletName + ") in portlet.xml");

-    	}

-        this.portletName = portletName;

-    }

-

-    /**

-     * Retrieve the name of the portlet class.

-     * @return the fully qualified portlet class name.

-     */

-    public String g