You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(39) |
Dec
(10) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(19) |
Feb
(150) |
Mar
(10) |
Apr
|
May
(8) |
Jun
(11) |
Jul
(27) |
Aug
(52) |
Sep
(35) |
Oct
(30) |
Nov
(18) |
Dec
(4) |
2008 |
Jan
(76) |
Feb
(121) |
Mar
(39) |
Apr
(55) |
May
(18) |
Jun
(49) |
Jul
(32) |
Aug
(4) |
Sep
(10) |
Oct
|
Nov
(3) |
Dec
(33) |
2009 |
Jan
(19) |
Feb
(87) |
Mar
(69) |
Apr
(38) |
May
(47) |
Jun
(20) |
Jul
(5) |
Aug
(76) |
Sep
(145) |
Oct
(34) |
Nov
(8) |
Dec
(68) |
2010 |
Jan
(150) |
Feb
(379) |
Mar
(191) |
Apr
(100) |
May
(525) |
Jun
(269) |
Jul
(127) |
Aug
(190) |
Sep
(190) |
Oct
(29) |
Nov
(147) |
Dec
(83) |
2011 |
Jan
(188) |
Feb
(81) |
Mar
(43) |
Apr
(97) |
May
(63) |
Jun
(129) |
Jul
(17) |
Aug
(124) |
Sep
(6) |
Oct
(20) |
Nov
(67) |
Dec
(23) |
2012 |
Jan
(6) |
Feb
(14) |
Mar
(181) |
Apr
(64) |
May
(102) |
Jun
(47) |
Jul
(26) |
Aug
(3) |
Sep
(1) |
Oct
(14) |
Nov
(13) |
Dec
(23) |
2013 |
Jan
(4) |
Feb
(14) |
Mar
(18) |
Apr
(14) |
May
(27) |
Jun
(27) |
Jul
(5) |
Aug
(2) |
Sep
(74) |
Oct
(79) |
Nov
(21) |
Dec
(97) |
2014 |
Jan
(6) |
Feb
(3) |
Mar
(8) |
Apr
|
May
(5) |
Jun
|
Jul
(9) |
Aug
(6) |
Sep
(3) |
Oct
(10) |
Nov
(6) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
(25) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <fg...@us...> - 2008-05-07 12:56:46
|
Revision: 823 http://openutils.svn.sourceforge.net/openutils/?rev=823&view=rev Author: fgiust Date: 2008-05-07 05:56:53 -0700 (Wed, 07 May 2008) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnlspring-3.5 Added Paths: ----------- tags/openutils-mgnlspring-3.5/ tags/openutils-mgnlspring-3.5/LICENSE.txt tags/openutils-mgnlspring-3.5/pom.xml tags/openutils-mgnlspring-3.5/src/ tags/openutils-mgnlspring-3.5/src/test/java/it/openutils/mgnlspring/ContentBridgeTagTest.java tags/openutils-mgnlspring-3.5/src/test/resources/ Removed Paths: ------------- tags/openutils-mgnlspring-3.5/LICENSE.txt tags/openutils-mgnlspring-3.5/pom.xml tags/openutils-mgnlspring-3.5/src/ tags/openutils-mgnlspring-3.5/src/test/java/it/openutils/mgnlspring/ContentBridgeTagTest.java Copied: tags/openutils-mgnlspring-3.5 (from rev 821, trunk/openutils-mgnlspring) Deleted: tags/openutils-mgnlspring-3.5/LICENSE.txt =================================================================== --- trunk/openutils-mgnlspring/LICENSE.txt 2008-05-07 12:56:00 UTC (rev 821) +++ tags/openutils-mgnlspring-3.5/LICENSE.txt 2008-05-07 12:56:53 UTC (rev 823) @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) <year> <name of author> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - <program> Copyright (C) <year> <name of author> - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -<http://www.gnu.org/licenses/>. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -<http://www.gnu.org/philosophy/why-not-lgpl.html>. Copied: tags/openutils-mgnlspring-3.5/LICENSE.txt (from rev 820, trunk/openutils-mgnlspring/LICENSE.txt) =================================================================== --- tags/openutils-mgnlspring-3.5/LICENSE.txt (rev 0) +++ tags/openutils-mgnlspring-3.5/LICENSE.txt 2008-05-07 12:56:53 UTC (rev 823) @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License... [truncated message content] |
From: <fg...@us...> - 2008-05-07 12:56:01
|
Revision: 821 http://openutils.svn.sourceforge.net/openutils/?rev=821&view=rev Author: fgiust Date: 2008-05-07 05:56:00 -0700 (Wed, 07 May 2008) Log Message: ----------- test are fixed now Modified Paths: -------------- trunk/openutils-mgnlspring/pom.xml trunk/openutils-mgnlspring/src/test/java/it/openutils/mgnlspring/ContentBridgeTagTest.java Added Paths: ----------- trunk/openutils-mgnlspring/src/test/resources/ trunk/openutils-mgnlspring/src/test/resources/log4j.dtd trunk/openutils-mgnlspring/src/test/resources/log4j.xml Property Changed: ---------------- trunk/openutils-mgnlspring/ Property changes on: trunk/openutils-mgnlspring ___________________________________________________________________ Name: svn:ignore - target .checkstyle .classpath .project .settings + target .checkstyle .classpath .project .settings test-output temp-testng-customsuite.xml Modified: trunk/openutils-mgnlspring/pom.xml =================================================================== --- trunk/openutils-mgnlspring/pom.xml 2008-05-07 12:40:14 UTC (rev 820) +++ trunk/openutils-mgnlspring/pom.xml 2008-05-07 12:56:00 UTC (rev 821) @@ -112,6 +112,26 @@ </exclusion> </exclusions> </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-test</artifactId> + <version>${spring.version}</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + <exclusion> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + </exclusion> + </exclusions> + </dependency> </dependencies> <repositories> <repository> Modified: trunk/openutils-mgnlspring/src/test/java/it/openutils/mgnlspring/ContentBridgeTagTest.java =================================================================== --- trunk/openutils-mgnlspring/src/test/java/it/openutils/mgnlspring/ContentBridgeTagTest.java 2008-05-07 12:40:14 UTC (rev 820) +++ trunk/openutils-mgnlspring/src/test/java/it/openutils/mgnlspring/ContentBridgeTagTest.java 2008-05-07 12:56:00 UTC (rev 821) @@ -1,43 +1,54 @@ -/* - * Copyright 2007 Fabrizio Giustina. +/** + * Copyright Openmind http://www.openmindonline.it * - * 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 + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * http://www.apache.org/licenses/LICENSE-2.0 + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * 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. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * */ package it.openutils.mgnlspring; import info.magnolia.context.MgnlContext; -import info.magnolia.context.SystemContextImpl; -import it.openutils.mgnlspring.ContentBridgeTag; -import it.openutils.mgnlspring.RewriteVarsThreadLocal; -import it.openutils.mgnlspring.UrlFunctions; +import info.magnolia.context.WebContextImpl; +import org.springframework.mock.web.MockHttpServletRequest; import org.testng.Assert; +import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; /** * @author fgiust - * @version $Id$ + * @version $Id:ContentBridgeTagTest.java 344 2007-06-30 15:31:28Z fgiust $ */ public class ContentBridgeTagTest { private ContentBridgeTag tag = new ContentBridgeTag(); + @BeforeClass + public void setUp() + { + MockHttpServletRequest mockServletRequest = new MockHttpServletRequest(); + mockServletRequest.setContextPath("context"); + WebContextImpl webContext = new WebContextImpl(); + webContext.init(mockServletRequest, null, null); + MgnlContext.setInstance(webContext); + + } + @Test public void testRewriteSimple() { - MgnlContext.setInstance(new SystemContextImpl()); String action = tag.makeUrl("", "/test/it.html", "/spring/myaction.do", "/spring/start.do"); Assert.assertEquals(action, "/spring/myaction.do"); // <!-- include this @@ -52,7 +63,6 @@ @Test public void testRewriteNoPath() { - MgnlContext.setInstance(new SystemContextImpl()); String action = tag.makeUrl("", "/test/it.html", "myaction.do", "/spring/start.do"); Assert.assertEquals(action, "/spring/myaction.do"); // <!-- include this @@ -67,7 +77,6 @@ @Test public void testRewriteParams() { - MgnlContext.setInstance(new SystemContextImpl()); String action = tag.makeUrl("", "/test/it.html", "myaction.do", "/spring/start.do"); Assert.assertEquals(action, "/spring/myaction.do"); // <!-- include this @@ -82,7 +91,6 @@ @Test public void testRewriteActionParams() { - MgnlContext.setInstance(new SystemContextImpl()); String action = tag.makeUrl("", "/mac/it/index.html", "iscrizioneEvento.do?idEvento=2", "/spring/start.do"); Assert.assertEquals(action, "/spring/iscrizioneEvento.do?idEvento=2"); // <!-- include this Added: trunk/openutils-mgnlspring/src/test/resources/log4j.dtd =================================================================== --- trunk/openutils-mgnlspring/src/test/resources/log4j.dtd (rev 0) +++ trunk/openutils-mgnlspring/src/test/resources/log4j.dtd 2008-05-07 12:56:00 UTC (rev 821) @@ -0,0 +1,166 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<!-- Authors: Chris Taylor, Ceki Gulcu. --> + +<!-- Version: 1.2 --> + +<!-- A configuration element consists of optional renderer +elements,appender elements, categories and an optional root +element. --> + +<!ELEMENT log4j:configuration (renderer*, appender*,(category|logger)*,root?, + categoryFactory?)> + +<!-- The "threshold" attribute takes a level value such that all --> +<!-- logging statements with a level equal or below this value are --> +<!-- disabled. --> + +<!-- Setting the "debug" enable the printing of internal log4j logging --> +<!-- statements. --> + +<!-- By default, debug attribute is "null", meaning that we not do touch --> +<!-- internal log4j logging settings. The "null" value for the threshold --> +<!-- attribute can be misleading. The threshold field of a repository --> +<!-- cannot be set to null. The "null" value for the threshold attribute --> +<!-- simply means don't touch the threshold field, the threshold field --> +<!-- keeps its old value. --> + +<!ATTLIST log4j:configuration + xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/" + threshold (all|debug|info|warn|error|fatal|off|null) "null" + debug (true|false|null) "null" +> + +<!-- renderer elements allow the user to customize the conversion of --> +<!-- message objects to String. --> + +<!ELEMENT renderer EMPTY> +<!ATTLIST renderer + renderedClass CDATA #REQUIRED + renderingClass CDATA #REQUIRED +> + +<!-- Appenders must have a name and a class. --> +<!-- Appenders may contain an error handler, a layout, optional parameters --> +<!-- and filters. They may also reference (or include) other appenders. --> +<!ELEMENT appender (errorHandler?, param*, layout?, filter*, appender-ref*)> +<!ATTLIST appender + name ID #REQUIRED + class CDATA #REQUIRED +> + +<!ELEMENT layout (param*)> +<!ATTLIST layout + class CDATA #REQUIRED +> + +<!ELEMENT filter (param*)> +<!ATTLIST filter + class CDATA #REQUIRED +> + +<!-- ErrorHandlers can be of any class. They can admit any number of --> +<!-- parameters. --> + +<!ELEMENT errorHandler (param*, root-ref?, logger-ref*, appender-ref?)> +<!ATTLIST errorHandler + class CDATA #REQUIRED +> + +<!ELEMENT root-ref EMPTY> + +<!ELEMENT logger-ref EMPTY> +<!ATTLIST logger-ref + ref IDREF #REQUIRED +> + +<!ELEMENT param EMPTY> +<!ATTLIST param + name CDATA #REQUIRED + value CDATA #REQUIRED +> + + +<!-- The priority class is org.apache.log4j.Level by default --> +<!ELEMENT priority (param*)> +<!ATTLIST priority + class CDATA #IMPLIED + value CDATA #REQUIRED +> + +<!-- The level class is org.apache.log4j.Level by default --> +<!ELEMENT level (param*)> +<!ATTLIST level + class CDATA #IMPLIED + value CDATA #REQUIRED +> + + +<!-- If no level element is specified, then the configurator MUST not --> +<!-- touch the level of the named category. --> +<!ELEMENT category (param*,(priority|level)?,appender-ref*)> +<!ATTLIST category + class CDATA #IMPLIED + name CDATA #REQUIRED + additivity (true|false) "true" +> + +<!-- If no level element is specified, then the configurator MUST not --> +<!-- touch the level of the named logger. --> +<!ELEMENT logger (level?,appender-ref*)> +<!ATTLIST logger + name ID #REQUIRED + additivity (true|false) "true" +> + + +<!ELEMENT categoryFactory (param*)> +<!ATTLIST categoryFactory + class CDATA #REQUIRED> + +<!ELEMENT appender-ref EMPTY> +<!ATTLIST appender-ref + ref IDREF #REQUIRED +> + +<!-- If no priority element is specified, then the configurator MUST not --> +<!-- touch the priority of root. --> +<!-- The root category always exists and cannot be subclassed. --> +<!ELEMENT root (param*, (priority|level)?, appender-ref*)> + + +<!-- ==================================================================== --> +<!-- A logging event --> +<!-- ==================================================================== --> +<!ELEMENT log4j:eventSet (log4j:event*)> +<!ATTLIST log4j:eventSet + xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/" + version (1.1|1.2) "1.2" + includesLocationInfo (true|false) "true" +> + + + +<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?, + log4j:locationInfo?) > + +<!-- The timestamp format is application dependent. --> +<!ATTLIST log4j:event + logger CDATA #REQUIRED + level CDATA #REQUIRED + thread CDATA #REQUIRED + timestamp CDATA #REQUIRED +> + +<!ELEMENT log4j:message (#PCDATA)> +<!ELEMENT log4j:NDC (#PCDATA)> + +<!ELEMENT log4j:throwable (#PCDATA)> + +<!ELEMENT log4j:locationInfo EMPTY> +<!ATTLIST log4j:locationInfo + class CDATA #REQUIRED + method CDATA #REQUIRED + file CDATA #REQUIRED + line CDATA #REQUIRED +> Property changes on: trunk/openutils-mgnlspring/src/test/resources/log4j.dtd ___________________________________________________________________ Name: svn:mime-type + text/xml Name: svn:eol-style + native Added: trunk/openutils-mgnlspring/src/test/resources/log4j.xml =================================================================== --- trunk/openutils-mgnlspring/src/test/resources/log4j.xml (rev 0) +++ trunk/openutils-mgnlspring/src/test/resources/log4j.xml 2008-05-07 12:56:00 UTC (rev 821) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> +<log4j:configuration> + <!-- log4j test configuration --> + <appender name="test-appender" class="org.apache.log4j.ConsoleAppender"> + <layout class="org.apache.log4j.PatternLayout"> + <param name="ConversionPattern" value="%-5p %c.%M(%C{1}.java:%L) %m%n" /> + </layout> + </appender> + <category name="org"> + <priority value="WARN" /> + </category> + <category name="com"> + <priority value="WARN" /> + </category> + <category name="net"> + <priority value="WARN" /> + </category> + <category name="info"> + <priority value="WARN" /> + </category> + <category name="it"> + <priority value="WARN" /> + </category> + <root> + <priority value="debug" /> + <appender-ref ref="test-appender" /> + </root> +</log4j:configuration> \ No newline at end of file Property changes on: trunk/openutils-mgnlspring/src/test/resources/log4j.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-05-07 12:40:10
|
Revision: 820 http://openutils.svn.sourceforge.net/openutils/?rev=820&view=rev Author: fgiust Date: 2008-05-07 05:40:14 -0700 (Wed, 07 May 2008) Log Message: ----------- ready for a release Modified Paths: -------------- trunk/openutils-mgnlspring/src/main/java/it/openutils/mgnlspring/ContentBridgeTag.java Added Paths: ----------- trunk/openutils-mgnlspring/src/site/apt/ trunk/openutils-mgnlspring/src/site/apt/index.apt trunk/openutils-mgnlspring/src/site/changes/ trunk/openutils-mgnlspring/src/site/changes/changes.xml Modified: trunk/openutils-mgnlspring/src/main/java/it/openutils/mgnlspring/ContentBridgeTag.java =================================================================== --- trunk/openutils-mgnlspring/src/main/java/it/openutils/mgnlspring/ContentBridgeTag.java 2008-05-07 09:08:58 UTC (rev 819) +++ trunk/openutils-mgnlspring/src/main/java/it/openutils/mgnlspring/ContentBridgeTag.java 2008-05-07 12:40:14 UTC (rev 820) @@ -19,9 +19,7 @@ import info.magnolia.cms.beans.config.ContentRepository; import info.magnolia.cms.security.AccessManager; -import info.magnolia.cms.security.Authenticator; import info.magnolia.cms.security.Permission; -import info.magnolia.cms.security.SecureURI; import info.magnolia.context.MgnlContext; import java.io.IOException; @@ -40,7 +38,8 @@ import org.slf4j.LoggerFactory; import com.opensymphony.module.sitemesh.Page; -import com.opensymphony.module.sitemesh.parser.FastPageParser; +import com.opensymphony.module.sitemesh.PageParser; +import com.opensymphony.module.sitemesh.parser.HTMLPageParser; /** @@ -139,14 +138,11 @@ actionUrl = StringUtils.replaceOnce(actionUrl, "&", "?"); } - if (SecureURI.isProtected(actionUrl)) + AccessManager am = MgnlContext.getAccessManager(ContentRepository.WEBSITE); + if (!am.isGranted(actionUrl, Permission.READ)) { - AccessManager am = MgnlContext.getAccessManager(ContentRepository.WEBSITE); - if (!Authenticator.isAuthenticated(request) || !am.isGranted(actionUrl, Permission.READ)) - { - log.info("User not allowed to read path {}", actionUrl); - return super.doStartTag(); - } + log.info("User not allowed to read path {}", actionUrl); + return super.doStartTag(); } RequestDispatcher rd = pageContext.getServletConfig().getServletContext().getRequestDispatcher(actionUrl); @@ -177,7 +173,7 @@ if (content != null && content.length > 0) { - FastPageParser parser = new FastPageParser(); + PageParser parser = new HTMLPageParser(); try { Page page = parser.parse(content); Added: trunk/openutils-mgnlspring/src/site/apt/index.apt =================================================================== --- trunk/openutils-mgnlspring/src/site/apt/index.apt (rev 0) +++ trunk/openutils-mgnlspring/src/site/apt/index.apt 2008-05-07 12:40:14 UTC (rev 820) @@ -0,0 +1,32 @@ + -------------------------- + openutils-mgnlspring + -------------------------- + Fabrizio Giustina + -------------------------- + +About openutils-mgnlspring + + openutils-mgnlspring is a custom {{{http://www.magnolia.info}magnolia}} module which integrates the + {{{http://mc4j.org/confluence/display/stripes/Home}Spring}} MVC framework. + + This module will allow you to use Spring controllers as a Magnolia paragraph. + + <<This module requires magnolia 3.5.x, and will not work on any earlier version!>> + +Configuration + + <<todo>> + + The mgnlspring integration requires setting up a "bridge paragraph" using the supplied tag (content bridge tag) which + will forward any request to the specified controller. + + This module have been developed initially on magnolia 2 and spring 1.x, and updated to work on the latest magnolia/spring revision. + We are aware this integration is not so well designed and up-to-date as the most recent {{{http://openutils.sourceforge.net/openutils-mgnlstripes/index.html}magnolia-stripes}} + integration, so of you are looking for a way to integrate a mvc framework into a magnolia application we suggest to look + at mgnlstripes-instead. + +Released versions + + {{{http://www.mvnrepository.com/artifact/net.sourceforge.openutils/openutils-mgnlspring}http://www.mvnrepository.com/artifact/net.sourceforge.openutils/openutils-mgnlspring}} + + Property changes on: trunk/openutils-mgnlspring/src/site/apt/index.apt ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-mgnlspring/src/site/changes/changes.xml =================================================================== --- trunk/openutils-mgnlspring/src/site/changes/changes.xml (rev 0) +++ trunk/openutils-mgnlspring/src/site/changes/changes.xml 2008-05-07 12:40:14 UTC (rev 820) @@ -0,0 +1,15 @@ +<?xml version="1.0"?> +<!-- + "type" attribute can be: add, remove, update or fix. +--> +<document> + <properties> + <title>Changes</title> + <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> + </properties> + <body> + <release version="3.5" date="2008-05-06" description="3.5"> + <action type="update" dev="fgiust">updated for magnolia 3.5.x</action> + </release> + </body> +</document> \ No newline at end of file Property changes on: trunk/openutils-mgnlspring/src/site/changes/changes.xml ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-05-07 09:08:54
|
Revision: 819 http://openutils.svn.sourceforge.net/openutils/?rev=819&view=rev Author: molaschi Date: 2008-05-07 02:08:58 -0700 (Wed, 07 May 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-mgnlbootstrapsync/pom.xml Modified: trunk/openutils-mgnlbootstrapsync/pom.xml =================================================================== --- trunk/openutils-mgnlbootstrapsync/pom.xml 2008-05-07 09:08:45 UTC (rev 818) +++ trunk/openutils-mgnlbootstrapsync/pom.xml 2008-05-07 09:08:58 UTC (rev 819) @@ -10,7 +10,7 @@ <packaging>jar</packaging> <artifactId>openutils-mgnlbootstrapsync</artifactId> <name>openutils-mgnlbootstrapsync</name> - <version>0.1.1</version> + <version>0.2-SNAPSHOT</version> <licenses> <license> <name>GPLv3</name> @@ -73,10 +73,4 @@ </snapshots> </repository> </repositories> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlbootstrapsync-0.1.1</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlbootstrapsync-0.1.1</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlbootstrapsync-0.1.1</url> - </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-05-07 09:08:40
|
Revision: 818 http://openutils.svn.sourceforge.net/openutils/?rev=818&view=rev Author: molaschi Date: 2008-05-07 02:08:45 -0700 (Wed, 07 May 2008) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnlbootstrapsync-0.1.1 Added Paths: ----------- tags/openutils-mgnlbootstrapsync-0.1.1/ tags/openutils-mgnlbootstrapsync-0.1.1/pom.xml tags/openutils-mgnlbootstrapsync-0.1.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java tags/openutils-mgnlbootstrapsync-0.1.1/src/site/ tags/openutils-mgnlbootstrapsync-0.1.1/src/site/site.xml Removed Paths: ------------- tags/openutils-mgnlbootstrapsync-0.1.1/pom.xml tags/openutils-mgnlbootstrapsync-0.1.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java tags/openutils-mgnlbootstrapsync-0.1.1/src/site/site.xml Copied: tags/openutils-mgnlbootstrapsync-0.1.1 (from rev 806, trunk/openutils-mgnlbootstrapsync) Deleted: tags/openutils-mgnlbootstrapsync-0.1.1/pom.xml =================================================================== --- trunk/openutils-mgnlbootstrapsync/pom.xml 2008-04-29 12:54:36 UTC (rev 806) +++ tags/openutils-mgnlbootstrapsync-0.1.1/pom.xml 2008-05-07 09:08:45 UTC (rev 818) @@ -1,76 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>8</version> - <relativePath>..</relativePath> - </parent> - <modelVersion>4.0.0</modelVersion> - <packaging>jar</packaging> - <artifactId>openutils-mgnlbootstrapsync</artifactId> - <name>openutils-mgnlbootstrapsync</name> - <version>0.1-SNAPSHOT</version> - <licenses> - <license> - <name>GPLv3</name> - <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> - </license> - </licenses> - <build> - <resources> - <resource> - <filtering>false</filtering> - <directory>src/main/resources</directory> - <includes> - <include>**/*</include> - </includes> - </resource> - <resource> - <filtering>true</filtering> - <directory>src/main/resources</directory> - <includes> - <include>META-INF/magnolia/*</include> - </includes> - </resource> - </resources> - </build> - <dependencies> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-core</artifactId> - <version>3.5-rc2</version> - </dependency> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-module-admininterface</artifactId> - <version>3.5.2</version> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.1</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - <repositories> - <repository> - <id>repository.magnolia.info</id> - <name>magnolia repository</name> - <url>http://svn.magnolia.info/maven/m2</url> - <releases> - <enabled>true</enabled> - </releases> - <snapshots> - <enabled>false</enabled> - </snapshots> - </repository> - </repositories> -</project> Copied: tags/openutils-mgnlbootstrapsync-0.1.1/pom.xml (from rev 817, trunk/openutils-mgnlbootstrapsync/pom.xml) =================================================================== --- tags/openutils-mgnlbootstrapsync-0.1.1/pom.xml (rev 0) +++ tags/openutils-mgnlbootstrapsync-0.1.1/pom.xml 2008-05-07 09:08:45 UTC (rev 818) @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>8</version> + <relativePath>..</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <packaging>jar</packaging> + <artifactId>openutils-mgnlbootstrapsync</artifactId> + <name>openutils-mgnlbootstrapsync</name> + <version>0.1.1</version> + <licenses> + <license> + <name>GPLv3</name> + <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> + </license> + </licenses> + <build> + <resources> + <resource> + <filtering>false</filtering> + <directory>src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + <resource> + <filtering>true</filtering> + <directory>src/main/resources</directory> + <includes> + <include>META-INF/magnolia/*</include> + </includes> + </resource> + </resources> + </build> + <dependencies> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-core</artifactId> + <version>3.5-rc2</version> + </dependency> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-module-admininterface</artifactId> + <version>3.5.2</version> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.1</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + <repositories> + <repository> + <id>repository.magnolia.info</id> + <name>magnolia repository</name> + <url>http://svn.magnolia.info/maven/m2</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlbootstrapsync-0.1.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlbootstrapsync-0.1.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlbootstrapsync-0.1.1</url> + </scm> +</project> Deleted: tags/openutils-mgnlbootstrapsync-0.1.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java 2008-04-29 12:54:36 UTC (rev 806) +++ tags/openutils-mgnlbootstrapsync-0.1.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java 2008-05-07 09:08:45 UTC (rev 818) @@ -1,160 +0,0 @@ -package it.openutils.mgnlbootstrapsync.listener; - -import it.openutils.mgnlbootstrapsync.watch.BootstrapSyncRepositoryWatch; - -import java.util.ArrayList; -import java.util.List; - -import javax.jcr.RepositoryException; -import javax.jcr.observation.Event; -import javax.jcr.observation.EventIterator; - -import org.apache.commons.lang.StringUtils; -import org.apache.jackrabbit.core.observation.EventImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * @author luca boati mmolaschi - * @version $Id: $ - */ -public class BootstrapSyncListener extends AbstractBootstrapSyncListener -{ - - /** - * Store operation - * @author mmolaschi - * @version $Id: $ - */ - public class JcrOperation - { - - private String path; - - private boolean remove; - - /** - * @param path path of operation - * @param remove is a remove op? - */ - public JcrOperation(String path, boolean remove) - { - this.path = path; - this.remove = remove; - } - } - - private static Logger log = LoggerFactory.getLogger(BootstrapSyncListener.class); - - /** - * Configure listener on watch - * @param watch watch - */ - public BootstrapSyncListener(BootstrapSyncRepositoryWatch watch) - { - super(watch); - } - - /** - * {@inheritDoc} - */ - @Override - public void onEvent(EventIterator events) - { - List<JcrOperation> operations = new ArrayList<JcrOperation>(); - while (events.hasNext()) - { - // Event event - EventImpl event = (EventImpl) events.nextEvent(); - String eventPath = null; - try - { - eventPath = event.getPath(); - } - catch (RepositoryException ex) - { - log.error(ex.getMessage(), ex); - continue; - } - if (eventPath.startsWith("/jcr:")) - { - return; - } - - switch (event.getType()) - { - case Event.NODE_ADDED : - log.debug(eventPath + " added"); - break; - case Event.NODE_REMOVED : - log.debug(eventPath + " removed"); - break; - case Event.PROPERTY_ADDED : - log.debug(eventPath + " added"); - break; - case Event.PROPERTY_CHANGED : - log.debug(eventPath + " changed"); - break; - case Event.PROPERTY_REMOVED : - log.debug(eventPath + " removed"); - break; - default : - break; - } - - if (event.getType() == Event.NODE_REMOVED) - { - operations.add(new JcrOperation(eventPath, true)); - } - else - { - operations.add(new JcrOperation(eventPath, false)); - } - } - - // calculate minimum path and remove operation - String basePath = null; - JcrOperation remove = null; - for (JcrOperation operation : operations) - { - if (operation.remove) - { - remove = operation; - continue; - } - - int basePathSl = StringUtils.countMatches(basePath, "/"); - int pathSl = StringUtils.countMatches(operation.path, "/"); - - if (basePath == null || pathSl < basePathSl) - { - basePath = operation.path; - } - } - - if (remove != null) - { - if (log.isDebugEnabled()) - { - log.debug("Removed PATH: " + remove.path); - } - - removeNode(remove.path); - } - - if (basePath != null) - { - // remove metadata if present - basePath = StringUtils.substringBefore(basePath, "/MetaData"); - - if (log.isDebugEnabled()) - { - log.debug("Changed PATH: " + basePath); - } - - exportNode(basePath); - } - } - -} Copied: tags/openutils-mgnlbootstrapsync-0.1.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java (from rev 811, trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java) =================================================================== --- tags/openutils-mgnlbootstrapsync-0.1.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java (rev 0) +++ tags/openutils-mgnlbootstrapsync-0.1.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java 2008-05-07 09:08:45 UTC (rev 818) @@ -0,0 +1,166 @@ +package it.openutils.mgnlbootstrapsync.listener; + +import info.magnolia.cms.beans.config.ConfigLoader; +import it.openutils.mgnlbootstrapsync.watch.BootstrapSyncRepositoryWatch; + +import java.util.ArrayList; +import java.util.List; + +import javax.jcr.RepositoryException; +import javax.jcr.observation.Event; +import javax.jcr.observation.EventIterator; + +import org.apache.commons.lang.StringUtils; +import org.apache.jackrabbit.core.observation.EventImpl; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * @author luca boati mmolaschi + * @version $Id: $ + */ +public class BootstrapSyncListener extends AbstractBootstrapSyncListener +{ + + /** + * Store operation + * @author mmolaschi + * @version $Id: $ + */ + public class JcrOperation + { + + private String path; + + private boolean remove; + + /** + * @param path path of operation + * @param remove is a remove op? + */ + public JcrOperation(String path, boolean remove) + { + this.path = path; + this.remove = remove; + } + } + + private static Logger log = LoggerFactory.getLogger(BootstrapSyncListener.class); + + /** + * Configure listener on watch + * @param watch watch + */ + public BootstrapSyncListener(BootstrapSyncRepositoryWatch watch) + { + super(watch); + } + + /** + * {@inheritDoc} + */ + @Override + public void onEvent(EventIterator events) + { + if (!ConfigLoader.isConfigured() || ConfigLoader.isBootstrapping()) + { + return; + } + + List<JcrOperation> operations = new ArrayList<JcrOperation>(); + while (events.hasNext()) + { + // Event event + EventImpl event = (EventImpl) events.nextEvent(); + String eventPath = null; + try + { + eventPath = event.getPath(); + } + catch (RepositoryException ex) + { + log.error(ex.getMessage(), ex); + continue; + } + if (eventPath.startsWith("/jcr:")) + { + return; + } + + switch (event.getType()) + { + case Event.NODE_ADDED : + log.debug(eventPath + " added"); + break; + case Event.NODE_REMOVED : + log.debug(eventPath + " removed"); + break; + case Event.PROPERTY_ADDED : + log.debug(eventPath + " added"); + break; + case Event.PROPERTY_CHANGED : + log.debug(eventPath + " changed"); + break; + case Event.PROPERTY_REMOVED : + log.debug(eventPath + " removed"); + break; + default : + break; + } + + if (event.getType() == Event.NODE_REMOVED) + { + operations.add(new JcrOperation(eventPath, true)); + } + else + { + operations.add(new JcrOperation(eventPath, false)); + } + } + + // calculate minimum path and remove operation + String basePath = null; + JcrOperation remove = null; + for (JcrOperation operation : operations) + { + if (operation.remove) + { + remove = operation; + continue; + } + + int basePathSl = StringUtils.countMatches(basePath, "/"); + int pathSl = StringUtils.countMatches(operation.path, "/"); + + if (basePath == null || pathSl < basePathSl) + { + basePath = operation.path; + } + } + + if (remove != null) + { + if (log.isDebugEnabled()) + { + log.debug("Removed PATH: " + remove.path); + } + + removeNode(remove.path); + } + + if (basePath != null) + { + // remove metadata if present + basePath = StringUtils.substringBefore(basePath, "/MetaData"); + + if (log.isDebugEnabled()) + { + log.debug("Changed PATH: " + basePath); + } + + exportNode(basePath); + } + } + +} Copied: tags/openutils-mgnlbootstrapsync-0.1.1/src/site (from rev 812, trunk/openutils-mgnlbootstrapsync/src/site) Deleted: tags/openutils-mgnlbootstrapsync-0.1.1/src/site/site.xml =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/site/site.xml 2008-05-06 16:37:17 UTC (rev 812) +++ tags/openutils-mgnlbootstrapsync-0.1.1/src/site/site.xml 2008-05-07 09:08:45 UTC (rev 818) @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project name="Openutils mgnlstripes"> - <publishDate position="navigation-bottom" format="yyyy-MM-dd" /> - <version position="navigation-bottom" /> - <bannerRight> - <name>Openutils</name> - <src>http://openutils.sourceforge.net/images/openutils-logo.png - </src> - <href>http://openutils.sourceforge.net</href> - </bannerRight> - <bannerLeft> - <name>Sourceforge</name> - <src>http://sourceforge.net/sflogo.php?group_id=150467&amp;type=2</src> - <href>http://www.sourceforge.net/projects/openutils</href> - </bannerLeft> - <body> - <head> - <link rel="icon" href="images/favicon.ico" /> - </head> - <breadcrumbs> - <item name="openutils" href="http://openutils.sourceforge.net/" /> - <item name="openutils-mgnlbootstrapsync" href="http://openutils.sourceforge.net/openutils-mgnlbootstrapsync" /> - </breadcrumbs> - <menu name="openutils mgnlstripes"> - <item name="Usage" href="index.html"></item> - </menu> - <menu ref="modules" inherit="bottom" /> - <menu ref="reports" inherit="bottom" /> - </body> - <skin> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-maven-skin</artifactId> - <version>1.1</version> - </skin> -</project> Copied: tags/openutils-mgnlbootstrapsync-0.1.1/src/site/site.xml (from rev 816, trunk/openutils-mgnlbootstrapsync/src/site/site.xml) =================================================================== --- tags/openutils-mgnlbootstrapsync-0.1.1/src/site/site.xml (rev 0) +++ tags/openutils-mgnlbootstrapsync-0.1.1/src/site/site.xml 2008-05-07 09:08:45 UTC (rev 818) @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="Openutils mgnlbootstrapsync"> + <publishDate position="navigation-bottom" format="yyyy-MM-dd" /> + <version position="navigation-bottom" /> + <bannerRight> + <name>Openutils</name> + <src>http://openutils.sourceforge.net/images/openutils-logo.png + </src> + <href>http://openutils.sourceforge.net</href> + </bannerRight> + <bannerLeft> + <name>Sourceforge</name> + <src>http://sourceforge.net/sflogo.php?group_id=150467&amp;type=2</src> + <href>http://www.sourceforge.net/projects/openutils</href> + </bannerLeft> + <body> + <head> + <link rel="icon" href="images/favicon.ico" /> + </head> + <breadcrumbs> + <item name="openutils" href="http://openutils.sourceforge.net/" /> + <item name="openutils-mgnlbootstrapsync" href="http://openutils.sourceforge.net/openutils-mgnlbootstrapsync" /> + </breadcrumbs> + <menu name="openutils mgnlstripes"> + <item name="Usage" href="index.html"></item> + </menu> + <menu ref="modules" inherit="bottom" /> + <menu ref="reports" inherit="bottom" /> + </body> + <skin> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-maven-skin</artifactId> + <version>1.1</version> + </skin> +</project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-05-07 09:08:26
|
Revision: 817 http://openutils.svn.sourceforge.net/openutils/?rev=817&view=rev Author: molaschi Date: 2008-05-07 02:08:31 -0700 (Wed, 07 May 2008) Log Message: ----------- [maven-release-plugin] prepare release openutils-mgnlbootstrapsync-0.1.1 Modified Paths: -------------- trunk/openutils-mgnlbootstrapsync/pom.xml Modified: trunk/openutils-mgnlbootstrapsync/pom.xml =================================================================== --- trunk/openutils-mgnlbootstrapsync/pom.xml 2008-05-07 09:07:49 UTC (rev 816) +++ trunk/openutils-mgnlbootstrapsync/pom.xml 2008-05-07 09:08:31 UTC (rev 817) @@ -10,7 +10,7 @@ <packaging>jar</packaging> <artifactId>openutils-mgnlbootstrapsync</artifactId> <name>openutils-mgnlbootstrapsync</name> - <version>0.2-SNAPSHOT</version> + <version>0.1.1</version> <licenses> <license> <name>GPLv3</name> @@ -73,4 +73,10 @@ </snapshots> </repository> </repositories> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlbootstrapsync-0.1.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlbootstrapsync-0.1.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlbootstrapsync-0.1.1</url> + </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-05-07 09:07:43
|
Revision: 816 http://openutils.svn.sourceforge.net/openutils/?rev=816&view=rev Author: molaschi Date: 2008-05-07 02:07:49 -0700 (Wed, 07 May 2008) Log Message: ----------- fix project name Modified Paths: -------------- trunk/openutils-mgnlbootstrapsync/src/site/site.xml Modified: trunk/openutils-mgnlbootstrapsync/src/site/site.xml =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/site/site.xml 2008-05-07 09:00:48 UTC (rev 815) +++ trunk/openutils-mgnlbootstrapsync/src/site/site.xml 2008-05-07 09:07:49 UTC (rev 816) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<project name="Openutils mgnlstripes"> +<project name="Openutils mgnlbootstrapsync"> <publishDate position="navigation-bottom" format="yyyy-MM-dd" /> <version position="navigation-bottom" /> <bannerRight> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-05-07 09:00:47
|
Revision: 815 http://openutils.svn.sourceforge.net/openutils/?rev=815&view=rev Author: molaschi Date: 2008-05-07 02:00:48 -0700 (Wed, 07 May 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-mgnlbootstrapsync/pom.xml Modified: trunk/openutils-mgnlbootstrapsync/pom.xml =================================================================== --- trunk/openutils-mgnlbootstrapsync/pom.xml 2008-05-07 09:00:41 UTC (rev 814) +++ trunk/openutils-mgnlbootstrapsync/pom.xml 2008-05-07 09:00:48 UTC (rev 815) @@ -10,7 +10,7 @@ <packaging>jar</packaging> <artifactId>openutils-mgnlbootstrapsync</artifactId> <name>openutils-mgnlbootstrapsync</name> - <version>0.1</version> + <version>0.2-SNAPSHOT</version> <licenses> <license> <name>GPLv3</name> @@ -73,10 +73,4 @@ </snapshots> </repository> </repositories> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlbootstrapsync-0.1</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlbootstrapsync-0.1</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlbootstrapsync-0.1</url> - </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-05-07 09:00:35
|
Revision: 814 http://openutils.svn.sourceforge.net/openutils/?rev=814&view=rev Author: molaschi Date: 2008-05-07 02:00:41 -0700 (Wed, 07 May 2008) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnlbootstrapsync-0.1 Added Paths: ----------- tags/openutils-mgnlbootstrapsync-0.1/ tags/openutils-mgnlbootstrapsync-0.1/pom.xml tags/openutils-mgnlbootstrapsync-0.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java tags/openutils-mgnlbootstrapsync-0.1/src/site/ Removed Paths: ------------- tags/openutils-mgnlbootstrapsync-0.1/pom.xml tags/openutils-mgnlbootstrapsync-0.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java Copied: tags/openutils-mgnlbootstrapsync-0.1 (from rev 806, trunk/openutils-mgnlbootstrapsync) Deleted: tags/openutils-mgnlbootstrapsync-0.1/pom.xml =================================================================== --- trunk/openutils-mgnlbootstrapsync/pom.xml 2008-04-29 12:54:36 UTC (rev 806) +++ tags/openutils-mgnlbootstrapsync-0.1/pom.xml 2008-05-07 09:00:41 UTC (rev 814) @@ -1,76 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>8</version> - <relativePath>..</relativePath> - </parent> - <modelVersion>4.0.0</modelVersion> - <packaging>jar</packaging> - <artifactId>openutils-mgnlbootstrapsync</artifactId> - <name>openutils-mgnlbootstrapsync</name> - <version>0.1-SNAPSHOT</version> - <licenses> - <license> - <name>GPLv3</name> - <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> - </license> - </licenses> - <build> - <resources> - <resource> - <filtering>false</filtering> - <directory>src/main/resources</directory> - <includes> - <include>**/*</include> - </includes> - </resource> - <resource> - <filtering>true</filtering> - <directory>src/main/resources</directory> - <includes> - <include>META-INF/magnolia/*</include> - </includes> - </resource> - </resources> - </build> - <dependencies> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-core</artifactId> - <version>3.5-rc2</version> - </dependency> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-module-admininterface</artifactId> - <version>3.5.2</version> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.1</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - <repositories> - <repository> - <id>repository.magnolia.info</id> - <name>magnolia repository</name> - <url>http://svn.magnolia.info/maven/m2</url> - <releases> - <enabled>true</enabled> - </releases> - <snapshots> - <enabled>false</enabled> - </snapshots> - </repository> - </repositories> -</project> Copied: tags/openutils-mgnlbootstrapsync-0.1/pom.xml (from rev 813, trunk/openutils-mgnlbootstrapsync/pom.xml) =================================================================== --- tags/openutils-mgnlbootstrapsync-0.1/pom.xml (rev 0) +++ tags/openutils-mgnlbootstrapsync-0.1/pom.xml 2008-05-07 09:00:41 UTC (rev 814) @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>8</version> + <relativePath>..</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <packaging>jar</packaging> + <artifactId>openutils-mgnlbootstrapsync</artifactId> + <name>openutils-mgnlbootstrapsync</name> + <version>0.1</version> + <licenses> + <license> + <name>GPLv3</name> + <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> + </license> + </licenses> + <build> + <resources> + <resource> + <filtering>false</filtering> + <directory>src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + <resource> + <filtering>true</filtering> + <directory>src/main/resources</directory> + <includes> + <include>META-INF/magnolia/*</include> + </includes> + </resource> + </resources> + </build> + <dependencies> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-core</artifactId> + <version>3.5-rc2</version> + </dependency> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-module-admininterface</artifactId> + <version>3.5.2</version> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.1</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + <repositories> + <repository> + <id>repository.magnolia.info</id> + <name>magnolia repository</name> + <url>http://svn.magnolia.info/maven/m2</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlbootstrapsync-0.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlbootstrapsync-0.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlbootstrapsync-0.1</url> + </scm> +</project> Deleted: tags/openutils-mgnlbootstrapsync-0.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java 2008-04-29 12:54:36 UTC (rev 806) +++ tags/openutils-mgnlbootstrapsync-0.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java 2008-05-07 09:00:41 UTC (rev 814) @@ -1,160 +0,0 @@ -package it.openutils.mgnlbootstrapsync.listener; - -import it.openutils.mgnlbootstrapsync.watch.BootstrapSyncRepositoryWatch; - -import java.util.ArrayList; -import java.util.List; - -import javax.jcr.RepositoryException; -import javax.jcr.observation.Event; -import javax.jcr.observation.EventIterator; - -import org.apache.commons.lang.StringUtils; -import org.apache.jackrabbit.core.observation.EventImpl; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * @author luca boati mmolaschi - * @version $Id: $ - */ -public class BootstrapSyncListener extends AbstractBootstrapSyncListener -{ - - /** - * Store operation - * @author mmolaschi - * @version $Id: $ - */ - public class JcrOperation - { - - private String path; - - private boolean remove; - - /** - * @param path path of operation - * @param remove is a remove op? - */ - public JcrOperation(String path, boolean remove) - { - this.path = path; - this.remove = remove; - } - } - - private static Logger log = LoggerFactory.getLogger(BootstrapSyncListener.class); - - /** - * Configure listener on watch - * @param watch watch - */ - public BootstrapSyncListener(BootstrapSyncRepositoryWatch watch) - { - super(watch); - } - - /** - * {@inheritDoc} - */ - @Override - public void onEvent(EventIterator events) - { - List<JcrOperation> operations = new ArrayList<JcrOperation>(); - while (events.hasNext()) - { - // Event event - EventImpl event = (EventImpl) events.nextEvent(); - String eventPath = null; - try - { - eventPath = event.getPath(); - } - catch (RepositoryException ex) - { - log.error(ex.getMessage(), ex); - continue; - } - if (eventPath.startsWith("/jcr:")) - { - return; - } - - switch (event.getType()) - { - case Event.NODE_ADDED : - log.debug(eventPath + " added"); - break; - case Event.NODE_REMOVED : - log.debug(eventPath + " removed"); - break; - case Event.PROPERTY_ADDED : - log.debug(eventPath + " added"); - break; - case Event.PROPERTY_CHANGED : - log.debug(eventPath + " changed"); - break; - case Event.PROPERTY_REMOVED : - log.debug(eventPath + " removed"); - break; - default : - break; - } - - if (event.getType() == Event.NODE_REMOVED) - { - operations.add(new JcrOperation(eventPath, true)); - } - else - { - operations.add(new JcrOperation(eventPath, false)); - } - } - - // calculate minimum path and remove operation - String basePath = null; - JcrOperation remove = null; - for (JcrOperation operation : operations) - { - if (operation.remove) - { - remove = operation; - continue; - } - - int basePathSl = StringUtils.countMatches(basePath, "/"); - int pathSl = StringUtils.countMatches(operation.path, "/"); - - if (basePath == null || pathSl < basePathSl) - { - basePath = operation.path; - } - } - - if (remove != null) - { - if (log.isDebugEnabled()) - { - log.debug("Removed PATH: " + remove.path); - } - - removeNode(remove.path); - } - - if (basePath != null) - { - // remove metadata if present - basePath = StringUtils.substringBefore(basePath, "/MetaData"); - - if (log.isDebugEnabled()) - { - log.debug("Changed PATH: " + basePath); - } - - exportNode(basePath); - } - } - -} Copied: tags/openutils-mgnlbootstrapsync-0.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java (from rev 811, trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java) =================================================================== --- tags/openutils-mgnlbootstrapsync-0.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java (rev 0) +++ tags/openutils-mgnlbootstrapsync-0.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java 2008-05-07 09:00:41 UTC (rev 814) @@ -0,0 +1,166 @@ +package it.openutils.mgnlbootstrapsync.listener; + +import info.magnolia.cms.beans.config.ConfigLoader; +import it.openutils.mgnlbootstrapsync.watch.BootstrapSyncRepositoryWatch; + +import java.util.ArrayList; +import java.util.List; + +import javax.jcr.RepositoryException; +import javax.jcr.observation.Event; +import javax.jcr.observation.EventIterator; + +import org.apache.commons.lang.StringUtils; +import org.apache.jackrabbit.core.observation.EventImpl; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * @author luca boati mmolaschi + * @version $Id: $ + */ +public class BootstrapSyncListener extends AbstractBootstrapSyncListener +{ + + /** + * Store operation + * @author mmolaschi + * @version $Id: $ + */ + public class JcrOperation + { + + private String path; + + private boolean remove; + + /** + * @param path path of operation + * @param remove is a remove op? + */ + public JcrOperation(String path, boolean remove) + { + this.path = path; + this.remove = remove; + } + } + + private static Logger log = LoggerFactory.getLogger(BootstrapSyncListener.class); + + /** + * Configure listener on watch + * @param watch watch + */ + public BootstrapSyncListener(BootstrapSyncRepositoryWatch watch) + { + super(watch); + } + + /** + * {@inheritDoc} + */ + @Override + public void onEvent(EventIterator events) + { + if (!ConfigLoader.isConfigured() || ConfigLoader.isBootstrapping()) + { + return; + } + + List<JcrOperation> operations = new ArrayList<JcrOperation>(); + while (events.hasNext()) + { + // Event event + EventImpl event = (EventImpl) events.nextEvent(); + String eventPath = null; + try + { + eventPath = event.getPath(); + } + catch (RepositoryException ex) + { + log.error(ex.getMessage(), ex); + continue; + } + if (eventPath.startsWith("/jcr:")) + { + return; + } + + switch (event.getType()) + { + case Event.NODE_ADDED : + log.debug(eventPath + " added"); + break; + case Event.NODE_REMOVED : + log.debug(eventPath + " removed"); + break; + case Event.PROPERTY_ADDED : + log.debug(eventPath + " added"); + break; + case Event.PROPERTY_CHANGED : + log.debug(eventPath + " changed"); + break; + case Event.PROPERTY_REMOVED : + log.debug(eventPath + " removed"); + break; + default : + break; + } + + if (event.getType() == Event.NODE_REMOVED) + { + operations.add(new JcrOperation(eventPath, true)); + } + else + { + operations.add(new JcrOperation(eventPath, false)); + } + } + + // calculate minimum path and remove operation + String basePath = null; + JcrOperation remove = null; + for (JcrOperation operation : operations) + { + if (operation.remove) + { + remove = operation; + continue; + } + + int basePathSl = StringUtils.countMatches(basePath, "/"); + int pathSl = StringUtils.countMatches(operation.path, "/"); + + if (basePath == null || pathSl < basePathSl) + { + basePath = operation.path; + } + } + + if (remove != null) + { + if (log.isDebugEnabled()) + { + log.debug("Removed PATH: " + remove.path); + } + + removeNode(remove.path); + } + + if (basePath != null) + { + // remove metadata if present + basePath = StringUtils.substringBefore(basePath, "/MetaData"); + + if (log.isDebugEnabled()) + { + log.debug("Changed PATH: " + basePath); + } + + exportNode(basePath); + } + } + +} Copied: tags/openutils-mgnlbootstrapsync-0.1/src/site (from rev 812, trunk/openutils-mgnlbootstrapsync/src/site) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-05-07 09:00:19
|
Revision: 813 http://openutils.svn.sourceforge.net/openutils/?rev=813&view=rev Author: molaschi Date: 2008-05-07 02:00:15 -0700 (Wed, 07 May 2008) Log Message: ----------- [maven-release-plugin] prepare release openutils-mgnlbootstrapsync-0.1 Modified Paths: -------------- trunk/openutils-mgnlbootstrapsync/pom.xml Modified: trunk/openutils-mgnlbootstrapsync/pom.xml =================================================================== --- trunk/openutils-mgnlbootstrapsync/pom.xml 2008-05-06 16:37:17 UTC (rev 812) +++ trunk/openutils-mgnlbootstrapsync/pom.xml 2008-05-07 09:00:15 UTC (rev 813) @@ -10,7 +10,7 @@ <packaging>jar</packaging> <artifactId>openutils-mgnlbootstrapsync</artifactId> <name>openutils-mgnlbootstrapsync</name> - <version>0.1-SNAPSHOT</version> + <version>0.1</version> <licenses> <license> <name>GPLv3</name> @@ -73,4 +73,10 @@ </snapshots> </repository> </repositories> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlbootstrapsync-0.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlbootstrapsync-0.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlbootstrapsync-0.1</url> + </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-05-06 16:38:20
|
Revision: 812 http://openutils.svn.sourceforge.net/openutils/?rev=812&view=rev Author: molaschi Date: 2008-05-06 09:37:17 -0700 (Tue, 06 May 2008) Log Message: ----------- Site informations Added Paths: ----------- trunk/openutils-mgnlbootstrapsync/src/site/ trunk/openutils-mgnlbootstrapsync/src/site/apt/ trunk/openutils-mgnlbootstrapsync/src/site/apt/index.apt trunk/openutils-mgnlbootstrapsync/src/site/site.xml Added: trunk/openutils-mgnlbootstrapsync/src/site/apt/index.apt =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/site/apt/index.apt (rev 0) +++ trunk/openutils-mgnlbootstrapsync/src/site/apt/index.apt 2008-05-06 16:37:17 UTC (rev 812) @@ -0,0 +1,62 @@ + -------------------------- + openutils-mgnlbootstrapsync + -------------------------- + Manuel Molaschi + -------------------------- + +About openutils-mgnlbootstrapsync + + openutils-mgnlbootstrapsync is a custom {{{http://www.magnolia.info}magnolia}} module. + + After installed into magnolia, this module will allow you to automatically export to filesystem your changes in magnolia repositories. + + <<This module requires magnolia 3.1-m3, and will not work on any earlier version!>> + +Configuration + + First of all drop the openutils-mgnlbootstrapsync jar into WEB-INF/lib, or (better) if you are using maven + just declare the following dependency: + ++----------------------------------------------+ + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-mgnlbootstrapsync</artifactId> + <version>0.1</version> + </dependency> ++----------------------------------------------+ + + Then configure the magnolia environment.properties files (usually in WEB-INF/config/default folder) as follows: + + #activate bootstrap synchornization + magnolia.bootstrapSync=true + + #list repositories you want to configure + magnolia.bootstrapSync.repositories=config,website + + #set path of folder export to + magnolia.bootstrapSync.config.exportPath=....path of folder to export to.... + magnolia.bootstrapSync.website.exportPath=....path of folder to export to.... + + #set root nodes to export: every change in this and subnodes will export [repository].[path.to.node].xml + #you can use * wildcards + magnolia.bootstrapSync.config.exportRoots=/server/filters/servlets/*,\ + /server/filters/cms/*,\ + /server/filters/*,\ + /server/MIMEMapping/*,\ + /modules/templating/*/*/*,\ + /modules/* + magnolia.bootstrapSync.website.exportRoots=/homepage,/help,/newsletter + +Todo/improvements + + Warning! This is a preliminary technology-preview release! + + This is a list of know todo/improvements: + + * Export single node (node position problem) + + * In exporting single node, specify which nodetype to export + + + + \ No newline at end of file Added: trunk/openutils-mgnlbootstrapsync/src/site/site.xml =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/site/site.xml (rev 0) +++ trunk/openutils-mgnlbootstrapsync/src/site/site.xml 2008-05-06 16:37:17 UTC (rev 812) @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="Openutils mgnlstripes"> + <publishDate position="navigation-bottom" format="yyyy-MM-dd" /> + <version position="navigation-bottom" /> + <bannerRight> + <name>Openutils</name> + <src>http://openutils.sourceforge.net/images/openutils-logo.png + </src> + <href>http://openutils.sourceforge.net</href> + </bannerRight> + <bannerLeft> + <name>Sourceforge</name> + <src>http://sourceforge.net/sflogo.php?group_id=150467&amp;type=2</src> + <href>http://www.sourceforge.net/projects/openutils</href> + </bannerLeft> + <body> + <head> + <link rel="icon" href="images/favicon.ico" /> + </head> + <breadcrumbs> + <item name="openutils" href="http://openutils.sourceforge.net/" /> + <item name="openutils-mgnlbootstrapsync" href="http://openutils.sourceforge.net/openutils-mgnlbootstrapsync" /> + </breadcrumbs> + <menu name="openutils mgnlstripes"> + <item name="Usage" href="index.html"></item> + </menu> + <menu ref="modules" inherit="bottom" /> + <menu ref="reports" inherit="bottom" /> + </body> + <skin> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-maven-skin</artifactId> + <version>1.1</version> + </skin> +</project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-05-06 10:55:38
|
Revision: 811 http://openutils.svn.sourceforge.net/openutils/?rev=811&view=rev Author: molaschi Date: 2008-05-06 03:55:44 -0700 (Tue, 06 May 2008) Log Message: ----------- Catch events when webapp is fully configured and bootstrapped Modified Paths: -------------- trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java Modified: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java 2008-05-05 23:12:30 UTC (rev 810) +++ trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java 2008-05-06 10:55:44 UTC (rev 811) @@ -1,5 +1,6 @@ package it.openutils.mgnlbootstrapsync.listener; +import info.magnolia.cms.beans.config.ConfigLoader; import it.openutils.mgnlbootstrapsync.watch.BootstrapSyncRepositoryWatch; import java.util.ArrayList; @@ -62,6 +63,11 @@ @Override public void onEvent(EventIterator events) { + if (!ConfigLoader.isConfigured() || ConfigLoader.isBootstrapping()) + { + return; + } + List<JcrOperation> operations = new ArrayList<JcrOperation>(); while (events.hasNext()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-05-05 23:13:36
|
Revision: 810 http://openutils.svn.sourceforge.net/openutils/?rev=810&view=rev Author: fgiust Date: 2008-05-05 16:12:30 -0700 (Mon, 05 May 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-mgnlstripes/pom.xml Modified: trunk/openutils-mgnlstripes/pom.xml =================================================================== --- trunk/openutils-mgnlstripes/pom.xml 2008-05-05 23:11:37 UTC (rev 809) +++ trunk/openutils-mgnlstripes/pom.xml 2008-05-05 23:12:30 UTC (rev 810) @@ -10,7 +10,7 @@ <packaging>jar</packaging> <artifactId>openutils-mgnlstripes</artifactId> <name>openutils-mgnlstripes</name> - <version>3.5</version> + <version>3.5.1-SNAPSHOT</version> <licenses> <license> <name>GPLv3</name> @@ -96,10 +96,4 @@ </snapshots> </repository> </repositories> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-3.5</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-3.5</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlstripes-3.5</url> - </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-05-05 23:13:35
|
Revision: 809 http://openutils.svn.sourceforge.net/openutils/?rev=809&view=rev Author: fgiust Date: 2008-05-05 16:11:37 -0700 (Mon, 05 May 2008) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnlstripes-3.5 Added Paths: ----------- tags/openutils-mgnlstripes-3.5/ tags/openutils-mgnlstripes-3.5/pom.xml tags/openutils-mgnlstripes-3.5/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java tags/openutils-mgnlstripes-3.5/src/main/resources/META-INF/mgnlstripes.tld tags/openutils-mgnlstripes-3.5/src/site/apt/index.apt tags/openutils-mgnlstripes-3.5/src/site/changes/changes.xml Removed Paths: ------------- tags/openutils-mgnlstripes-3.5/pom.xml tags/openutils-mgnlstripes-3.5/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java tags/openutils-mgnlstripes-3.5/src/main/java/it/openutils/magnoliastripes/tag/ExtendedLabelTag.java tags/openutils-mgnlstripes-3.5/src/main/java/it/openutils/magnoliastripes/tag/ExtendedMessagesTag.java tags/openutils-mgnlstripes-3.5/src/site/apt/index.apt tags/openutils-mgnlstripes-3.5/src/site/changes/changes.xml Copied: tags/openutils-mgnlstripes-3.5 (from rev 806, trunk/openutils-mgnlstripes) Deleted: tags/openutils-mgnlstripes-3.5/pom.xml =================================================================== --- trunk/openutils-mgnlstripes/pom.xml 2008-04-29 12:54:36 UTC (rev 806) +++ tags/openutils-mgnlstripes-3.5/pom.xml 2008-05-05 23:11:37 UTC (rev 809) @@ -1,100 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>8</version> - <relativePath>..</relativePath> - </parent> - <modelVersion>4.0.0</modelVersion> - <packaging>jar</packaging> - <artifactId>openutils-mgnlstripes</artifactId> - <name>openutils-mgnlstripes</name> - <version>3.5-SNAPSHOT</version> - <licenses> - <license> - <name>GPLv3</name> - <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> - </license> - </licenses> - <build> - <resources> - <resource> - <filtering>false</filtering> - <directory>src/main/resources</directory> - <includes> - <include>**/*</include> - </includes> - </resource> - <resource> - <filtering>true</filtering> - <directory>src/main/resources</directory> - <includes> - <include>META-INF/magnolia/*</include> - </includes> - </resource> - </resources> - </build> - <dependencies> - <dependency> - <groupId>net.sourceforge.stripes</groupId> - <artifactId>stripes</artifactId> - <version>1.4.3</version> - <exclusions> - <exclusion> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-core</artifactId> - <version>3.5.4</version> - </dependency> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-module-admininterface</artifactId> - <version>3.5.4</version> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.4</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>jsp-api</artifactId> - <version>2.0</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.7</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - <repositories> - <repository> - <id>repository.magnolia.info</id> - <name>magnolia repository</name> - <url>http://repo.magnolia.info/m2</url> - <releases> - <enabled>true</enabled> - </releases> - <snapshots> - <enabled>false</enabled> - </snapshots> - </repository> - </repositories> -</project> Copied: tags/openutils-mgnlstripes-3.5/pom.xml (from rev 808, trunk/openutils-mgnlstripes/pom.xml) =================================================================== --- tags/openutils-mgnlstripes-3.5/pom.xml (rev 0) +++ tags/openutils-mgnlstripes-3.5/pom.xml 2008-05-05 23:11:37 UTC (rev 809) @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>8</version> + <relativePath>..</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <packaging>jar</packaging> + <artifactId>openutils-mgnlstripes</artifactId> + <name>openutils-mgnlstripes</name> + <version>3.5</version> + <licenses> + <license> + <name>GPLv3</name> + <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> + </license> + </licenses> + <build> + <resources> + <resource> + <filtering>false</filtering> + <directory>src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + <resource> + <filtering>true</filtering> + <directory>src/main/resources</directory> + <includes> + <include>META-INF/magnolia/*</include> + </includes> + </resource> + </resources> + </build> + <dependencies> + <dependency> + <groupId>net.sourceforge.stripes</groupId> + <artifactId>stripes</artifactId> + <version>1.4.3</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-core</artifactId> + <version>3.5.4</version> + </dependency> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-module-admininterface</artifactId> + <version>3.5.4</version> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.4</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jsp-api</artifactId> + <version>2.0</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.7</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + <repositories> + <repository> + <id>repository.magnolia.info</id> + <name>magnolia repository</name> + <url>http://repo.magnolia.info/m2</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-3.5</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-3.5</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlstripes-3.5</url> + </scm> +</project> Deleted: tags/openutils-mgnlstripes-3.5/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java 2008-04-29 12:54:36 UTC (rev 806) +++ tags/openutils-mgnlstripes-3.5/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java 2008-05-05 23:11:37 UTC (rev 809) @@ -1,63 +0,0 @@ -/** - * Copyright Openmind http://www.openmindonline.it - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -package it.openutils.magnoliastripes.tag; - -import net.sourceforge.stripes.exception.StripesJspException; -import net.sourceforge.stripes.tag.FormTag; - - -/** - * @author fgiust - * @version $Id: $ - */ -public class ExtendedFormTag extends FormTag -{ - - /** - * Sets the 'action' attribute by inspecting the bean class provided and asking the current ActionResolver what the - * appropriate URL is. - * @param beanclass the Strin FQN of the class, or a Class representing the class - * @throws StripesJspException if the URL cannot be determined for any reason, most likely because of a mis-spelled - * class name, or a class that's not an ActionBean - */ - @Override - public void setBeanclass(Object beanclass) throws StripesJspException - { - String url = getActionBeanUrl(beanclass); - if (url == null) - { - throw new StripesJspException("Could not determine action from 'beanclass' supplied. " - + "The value supplied was '" - + beanclass - + "'. Please ensure that this bean type " - + "exists and is in the classpath. If you are developing a page and the ActionBean " - + "does not yet exist, consider using the 'action' attribute instead for now."); - } - else - { - String currentAction = get("action"); - - setAction(url); - - if (currentAction != null) - { - set("action", currentAction); - } - } - } -} Copied: tags/openutils-mgnlstripes-3.5/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java (from rev 807, trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java) =================================================================== --- tags/openutils-mgnlstripes-3.5/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java (rev 0) +++ tags/openutils-mgnlstripes-3.5/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java 2008-05-05 23:11:37 UTC (rev 809) @@ -0,0 +1,67 @@ +/** + * Copyright Openmind http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package it.openutils.magnoliastripes.tag; + +import net.sourceforge.stripes.exception.StripesJspException; +import net.sourceforge.stripes.tag.FormTag; + + +/** + * <p> + * workaround needed to create a form tag with an "url" attribute different from the actionbean mapped uri. Could be + * solved more cleanly by http://mc4j.org/jira/browse/STS-349, which will be available in stripes 1.5 + * </p> + * @author fgiust + * @version $Id: $ + */ +public class ExtendedFormTag extends FormTag +{ + + /** + * Sets the 'action' attribute by inspecting the bean class provided and asking the current ActionResolver what the + * appropriate URL is. + * @param beanclass the Strin FQN of the class, or a Class representing the class + * @throws StripesJspException if the URL cannot be determined for any reason, most likely because of a mis-spelled + * class name, or a class that's not an ActionBean + */ + @Override + public void setBeanclass(Object beanclass) throws StripesJspException + { + String url = getActionBeanUrl(beanclass); + if (url == null) + { + throw new StripesJspException("Could not determine action from 'beanclass' supplied. " + + "The value supplied was '" + + beanclass + + "'. Please ensure that this bean type " + + "exists and is in the classpath. If you are developing a page and the ActionBean " + + "does not yet exist, consider using the 'action' attribute instead for now."); + } + else + { + String currentAction = get("action"); + + setAction(url); + + if (currentAction != null) + { + set("action", currentAction); + } + } + } +} Deleted: tags/openutils-mgnlstripes-3.5/src/main/java/it/openutils/magnoliastripes/tag/ExtendedLabelTag.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedLabelTag.java 2008-04-29 12:54:36 UTC (rev 806) +++ tags/openutils-mgnlstripes-3.5/src/main/java/it/openutils/magnoliastripes/tag/ExtendedLabelTag.java 2008-05-05 23:11:37 UTC (rev 809) @@ -1,276 +0,0 @@ -/** - * Copyright Openmind http://www.openmindonline.it - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -package it.openutils.magnoliastripes.tag; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.HashMap; -import java.util.Map; - -import javax.servlet.jsp.JspException; - -import net.sourceforge.stripes.action.ActionBean; -import net.sourceforge.stripes.controller.ParameterName; -import net.sourceforge.stripes.exception.StripesJspException; -import net.sourceforge.stripes.tag.InputLabelTag; -import net.sourceforge.stripes.validation.Validate; -import net.sourceforge.stripes.validation.ValidateNestedProperties; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * @author molaschi - * @version $Id: $ - */ -public class ExtendedLabelTag extends InputLabelTag -{ - - /** - * Logger. - */ - private Logger log = LoggerFactory.getLogger(ExtendedLabelTag.class); - - boolean nameSet = false; - - /** - * {@inheritDoc} - */ - @Override - public void setName(String name) - { - // TODO Auto-generated method stub - super.setName(name); - this.nameSet = true; - } - - /** - * {@inheritDoc} - */ - @Override - public int doEndInputTag() throws JspException - { - try - { - String label = getLocalizedFieldName(); - String fieldName = getAttributes().remove("name"); - - if (label == null) - { - label = getBodyContentAsString(); - } - - if (label == null) - { - label = "Label could not find localized field name and had no body."; - } - - if (isRequiredField(this.getActionBean(), fieldName)) - { - String cssClass = get("class"); - if (cssClass != null) - { - set("class", cssClass + " required"); - } - else - { - set("class","required"); - } - } - - // Write out the tag - writeOpenTag(getPageContext().getOut(), "label"); - getPageContext().getOut().write(label); - writeCloseTag(getPageContext().getOut(), "label"); - - // Reset the field name so as to not screw up tag pooling - if (this.nameSet) - { - super.setName(fieldName); - } - - set("class", null); - - return EVAL_PAGE; - } - catch (IOException ioe) - { - throw new StripesJspException("Encountered an exception while trying to write to " - + "the output from the stripes:label tag handler class, InputLabelTag.", ioe); - } - } - - protected boolean isRequiredField(ActionBean bean, String name) - { - - ParameterName param = new ParameterName(name); - boolean isIndexed = param.isIndexed(); - - Map<String, Validate> validationInfos = getValidations(bean.getClass()); - - if (validationInfos != null) - { - - for (Map.Entry<String, Validate> entry : validationInfos.entrySet()) - { - String propertyName = entry.getKey(); - Validate validationInfo = entry.getValue(); - - if (name.equals(propertyName) && validationInfo.required() && !isIndexed) - { - return true; - } - } - } - - if (isIndexed) - { - - Validate validationInfo = validationInfos.get(param.getStrippedName()); - - if (validationInfo != null && validationInfo.required()) - { - return true; - } - } - return false; - } - - @SuppressWarnings("unchecked") - protected Map<String, Validate> getValidations(Class< ? extends ActionBean> clazz) - { - if (this.pageContext.getAttribute("validationInfos") != null) - { - Map<String, Map<String, Validate>> validationInfos = (Map<String, Map<String, Validate>>) this.pageContext - .getAttribute("validationInfos"); - if (validationInfos.containsKey(clazz.getName())) - { - return validationInfos.get(clazz.getName()); - } - else - { - Map<String, Validate> fieldValidations = new HashMap<String, Validate>(); - processClassAnnotations(clazz, fieldValidations); - validationInfos.put(clazz.getName(), fieldValidations); - return fieldValidations; - } - } - else - { - Map<String, Map<String, Validate>> validationInfos = new HashMap<String, Map<String, Validate>>(); - Map<String, Validate> fieldValidations = new HashMap<String, Validate>(); - processClassAnnotations(clazz, fieldValidations); - validationInfos.put(clazz.getName(), fieldValidations); - this.pageContext.setAttribute("validationInfos", validationInfos); - return fieldValidations; - } - } - - @SuppressWarnings("unchecked") - protected void processClassAnnotations(Class clazz, Map<String, Validate> fieldValidations) - { - Class superclass = clazz.getSuperclass(); - if (superclass != null) - { - processClassAnnotations(superclass, fieldValidations); - } - - // Process the methods on the class - Method[] methods = clazz.getDeclaredMethods(); - for (Method method : methods) - { - if (!Modifier.isPublic(method.getModifiers())) - { - continue; // only public methods! - } - - Validate validation = method.getAnnotation(Validate.class); - if (validation != null && validation.required()) - { - String fieldName = getPropertyName(method.getName()); - fieldValidations.put(fieldName, validation); - } - - ValidateNestedProperties nested = method.getAnnotation(ValidateNestedProperties.class); - if (nested != null) - { - String fieldName = getPropertyName(method.getName()); - Validate[] validations = nested.value(); - for (Validate nestedValidate : validations) - { - if ("".equals(nestedValidate.field())) - { - log.warn("Nested validation used without field name: ", validation); - } - else - { - if (nestedValidate.required()) - { - fieldValidations.put(fieldName + "." + nestedValidate.field(), nestedValidate); - } - } - } - } - } - - // Process the fields for validation annotations - Field[] fields = clazz.getDeclaredFields(); - for (Field field : fields) - { - Validate validation = field.getAnnotation(Validate.class); - if (validation != null && validation.required()) - { - fieldValidations.put(field.getName(), validation); - } - - ValidateNestedProperties nested = field.getAnnotation(ValidateNestedProperties.class); - if (nested != null) - { - Validate[] validations = nested.value(); - for (Validate nestedValidate : validations) - { - if ("".equals(nestedValidate.field())) - { - log.warn("Nested validation used without field name: ", validation); - } - else - { - if (nestedValidate.required()) - { - fieldValidations.put(field.getName() + "." + nestedValidate.field(), nestedValidate); - } - } - } - } - } - } - - /** - * Helper method that returns the name of the property when supplied with the corresponding get or set method. Does - * not do anything particularly intelligent, just drops the first three characters and makes the next character - * lower case. - */ - protected String getPropertyName(String methodName) - { - return methodName.substring(3, 4).toLowerCase() + methodName.substring(4); - } - -} Deleted: tags/openutils-mgnlstripes-3.5/src/main/java/it/openutils/magnoliastripes/tag/ExtendedMessagesTag.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedMessagesTag.java 2008-04-29 12:54:36 UTC (rev 806) +++ tags/openutils-mgnlstripes-3.5/src/main/java/it/openutils/magnoliastripes/tag/ExtendedMessagesTag.java 2008-05-05 23:11:37 UTC (rev 809) @@ -1,276 +0,0 @@ -/** - * Copyright Openmind http://www.openmindonline.it - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -package it.openutils.magnoliastripes.tag; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.HashMap; -import java.util.Map; - -import javax.servlet.jsp.JspException; - -import net.sourceforge.stripes.action.ActionBean; -import net.sourceforge.stripes.controller.ParameterName; -import net.sourceforge.stripes.exception.StripesJspException; -import net.sourceforge.stripes.tag.InputLabelTag; -import net.sourceforge.stripes.validation.Validate; -import net.sourceforge.stripes.validation.ValidateNestedProperties; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * @author luca boati - * @version $Id$ - */ -public class ExtendedMessagesTag extends InputLabelTag -{ - - /** - * Logger. - */ - private Logger log = LoggerFactory.getLogger(ExtendedMessagesTag.class); - - boolean nameSet = false; - - /** - * {@inheritDoc} - */ - @Override - public void setName(String name) - { - // TODO Auto-generated method stub - super.setName(name); - this.nameSet = true; - } - - /** - * {@inheritDoc} - */ - @Override - public int doEndInputTag() throws JspException - { - try - { - String label = getLocalizedFieldName(); - String fieldName = getAttributes().remove("name"); - - if (label == null) - { - label = getBodyContentAsString(); - } - - if (label == null) - { - label = "Label could not find localized field name and had no body."; - } - - // if (isRequiredField(this.getActionBean(), fieldName)) - // { - // String cssClass = get("class"); - // if (cssClass != null) - // { - // set("class", cssClass + " required"); - // } - // else - // { - // set("class", "required"); - // } - // } - - // Write out the tag - // writeOpenTag(getPageContext().getOut(), "label"); - getPageContext().getOut().write(label); - // writeCloseTag(getPageContext().getOut(), "label"); - - // Reset the field name so as to not screw up tag pooling - if (this.nameSet) - { - super.setName(fieldName); - } - - // set("class", null); - - return EVAL_PAGE; - } - catch (IOException ioe) - { - throw new StripesJspException("Encountered an exception while trying to write to " - + "the output from the stripes:label tag handler class, InputLabelTag.", ioe); - } - } - - protected boolean isRequiredField(ActionBean bean, String name) - { - - ParameterName param = new ParameterName(name); - boolean isIndexed = param.isIndexed(); - - Map<String, Validate> validationInfos = getValidations(bean.getClass()); - - if (validationInfos != null) - { - - for (Map.Entry<String, Validate> entry : validationInfos.entrySet()) - { - String propertyName = entry.getKey(); - Validate validationInfo = entry.getValue(); - - if (name.equals(propertyName) && validationInfo.required() && !isIndexed) - { - return true; - } - } - } - - if (isIndexed) - { - - Validate validationInfo = validationInfos.get(param.getStrippedName()); - - if (validationInfo != null && validationInfo.required()) - { - return true; - } - } - return false; - } - - @SuppressWarnings("unchecked") - protected Map<String, Validate> getValidations(Class< ? extends ActionBean> clazz) - { - if (this.pageContext.getAttribute("validationInfos") != null) - { - Map<String, Map<String, Validate>> validationInfos = (Map<String, Map<String, Validate>>) this.pageContext - .getAttribute("validationInfos"); - if (validationInfos.containsKey(clazz.getName())) - { - return validationInfos.get(clazz.getName()); - } - else - { - Map<String, Validate> fieldValidations = new HashMap<String, Validate>(); - processClassAnnotations(clazz, fieldValidations); - validationInfos.put(clazz.getName(), fieldValidations); - return fieldValidations; - } - } - else - { - Map<String, Map<String, Validate>> validationInfos = new HashMap<String, Map<String, Validate>>(); - Map<String, Validate> fieldValidations = new HashMap<String, Validate>(); - processClassAnnotations(clazz, fieldValidations); - validationInfos.put(clazz.getName(), fieldValidations); - this.pageContext.setAttribute("validationInfos", validationInfos); - return fieldValidations; - } - } - - @SuppressWarnings("unchecked") - protected void processClassAnnotations(Class clazz, Map<String, Validate> fieldValidations) - { - Class superclass = clazz.getSuperclass(); - if (superclass != null) - { - processClassAnnotations(superclass, fieldValidations); - } - - // Process the methods on the class - Method[] methods = clazz.getDeclaredMethods(); - for (Method method : methods) - { - if (!Modifier.isPublic(method.getModifiers())) - { - continue; // only public methods! - } - - Validate validation = method.getAnnotation(Validate.class); - if (validation != null && validation.required()) - { - String fieldName = getPropertyName(method.getName()); - fieldValidations.put(fieldName, validation); - } - - ValidateNestedProperties nested = method.getAnnotation(ValidateNestedProperties.class); - if (nested != null) - { - String fieldName = getPropertyName(method.getName()); - Validate[] validations = nested.value(); - for (Validate nestedValidate : validations) - { - if ("".equals(nestedValidate.field())) - { - log.warn("Nested validation used without field name: ", validation); - } - else - { - if (nestedValidate.required()) - { - fieldValidations.put(fieldName + "." + nestedValidate.field(), nestedValidate); - } - } - } - } - } - - // Process the fields for validation annotations - Field[] fields = clazz.getDeclaredFields(); - for (Field field : fields) - { - Validate validation = field.getAnnotation(Validate.class); - if (validation != null && validation.required()) - { - fieldValidations.put(field.getName(), validation); - } - - ValidateNestedProperties nested = field.getAnnotation(ValidateNestedProperties.class); - if (nested != null) - { - Validate[] validations = nested.value(); - for (Validate nestedValidate : validations) - { - if ("".equals(nestedValidate.field())) - { - log.warn("Nested validation used without field name: ", validation); - } - else - { - if (nestedValidate.required()) - { - fieldValidations.put(field.getName() + "." + nestedValidate.field(), nestedValidate); - } - } - } - } - } - } - - /** - * Helper method that returns the name of the property when supplied with the corresponding get or set method. Does - * not do anything particularly intelligent, just drops the first three characters and makes the next character - * lower case. - */ - protected String getPropertyName(String methodName) - { - return methodName.substring(3, 4).toLowerCase() + methodName.substring(4); - } - -} Copied: tags/openutils-mgnlstripes-3.5/src/main/resources/META-INF/mgnlstripes.tld (from rev 807, trunk/openutils-mgnlstripes/src/main/resources/META-INF/mgnlstripes.tld) =================================================================== --- tags/openutils-mgnlstripes-3.5/src/main/resources/META-INF/mgnlstripes.tld (rev 0) +++ tags/openutils-mgnlstripes-3.5/src/main/resources/META-INF/mgnlstripes.tld 2008-05-05 23:11:37 UTC (rev 809) @@ -0,0 +1,198 @@ +<taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" + version="2.0"> + <description>mgnlstripes</description> + <display-name>mgnlstripes tags</display-name> + <tlib-version>1.0</tlib-version> + <short-name>mgnlstripes</short-name> + <uri>mgnlstripes</uri> + <tag> + <description> Stripes' HTML form tag. Provides a standard HTML form tag interface, but allows other stripes input + tags to re-populate their values. Also includes a hidden field in the form for the page name that the form is + being rendered on (to allow forwarding to the same page in the case of a validation error. </description> + <display-name>form</display-name> + <name>form</name> + <tag-class>it.openutils.magnoliastripes.tag.ExtendedFormTag</tag-class> + <body-content>JSP</body-content> + <attribute> + <description> The URL to which this form will post. Expected to be a web-app relative path - the tag will prepend + the context path to any action that begins with a slash and does not already contain the context path. Should + match a URL to which an ActionBean has been bound. Required unless 'beanclass' is provided. </description> + <name>action</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> The fully qualified name of an ActionBean class, or alternatively a Class instance for an ActionBean + class. An alternative to the 'action' attribute, the 'beanclass' attribute will generate an action appropriate + for the ActionBean identified. Note that if an "ActionBean" that does not yet exist is identified an exception + will be thrown! </description> + <name>beanclass</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <type>java.lang.Object</type> + </attribute> + <attribute> + <description> The name of the form field that should receive focus when the page is loaded. Two special values are + recognized, 'first' and the empty string; these values cause the form to set focus on the first element in the + form. If any value is set, and the form has validation errors, the behaviour is altered and the first field with + validation errors is focused instead. </description> + <name>focus</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <type>java.lang.String</type> + </attribute> + <attribute> + <description> A comma separated list of content types that it is acceptable to submit through this form. (HTML + Pass-through) </description> + <name>accept</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> A comma separated list of possible character sets for form data. Will be written to the page as + accept-charset. (HTML Pass-through) </description> + <name>acceptcharset</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> The mime type used to encode the content of this form. This value will be overridden if one or more + Stripes file input tags is used within the body of the form. </description> + <name>enctype</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> The HTTP method used for sending data to the server. Options are GET and POST. Default is GET. (HTML + Pass-through) </description> + <name>method</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>The unique name of the form. (HTML Pass-through)</description> + <name>name</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> Where the target URL is to be opened. One of _blank, _self, _parent and _top. (HTML Pass-through) + </description> + <name>target</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when the form is reset. (HTML Pass-through)</description> + <name>onreset</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run prior to the form being submitted to the server, (HTML Pass-through)</description> + <name>onsubmit</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <!-- Start: Standard HTML attributes --> + <attribute> + <description>The CSS class to be applied to the element. (HTML Pass-through)</description> + <name>class</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Text direction. (HTML Pass-through)</description> + <name>dir</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>A unique identifier for the HTML tag on the pgae. (HTML Pass-through)</description> + <name>id</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>The language code of the element. (HTML Pass-through)</description> + <name>lang</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run on each mouse click. (HTML Pass-through)</description> + <name>onclick</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run on a double-click of the mouse. (HTML Pass-through)</description> + <name>ondblclick</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when a key is depressed. (HTML Pass-through)</description> + <name>onkeydown</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when a key is pressed and released. (HTML Pass-through)</description> + <name>onkeypress</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when a key is released. (HTML Pass-through)</description> + <name>onkeyup</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when a mouse button is depressed. (HTML Pass-through)</description> + <name>onmousedown</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when the mouse pointer is moved. (HTML Pass-through)</description> + <name>onmousemove</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when the mouse pointer moves out of the element. (HTML Pass-through)</description> + <name>onmouseout</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when the mouse pointer moves over the element. (HTML Pass-through)</description> + <name>onmouseover</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when a mouse button is released. (HTML Pass-through)</description> + <name>onmouseup</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Inline CSS style fragment that applies to the element (HTML Pass-through)</description> + <name>style</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Tool-tip text for the element. (HTML Pass-through)</description> + <name>title</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <!-- End: Standard HTML attributes --> + <dynamic-attributes>false</dynamic-attributes> + </tag> +</taglib> \ No newline at end of file Deleted: tags/openutils-mgnlstripes-3.5/src/site/apt/index.apt =================================================================== --- trunk/openutils-mgnlstripes/src/site/apt/index.apt 2008-04-29 12:54:36 UTC (rev 806) +++ tags/openutils-mgnlstripes-3.5/src/site/apt/index.apt 2008-05-05 23:11:37 UTC (rev 809) @@ -1,152 +0,0 @@ - -------------------------- - openutils-mgnlstripes - -------------------------- - Fabrizio Giustina - -------------------------- - -About openutils-mgnlstripes - - openutils-mgnlstripes is a custom {{{http://www.magnolia.info}magnolia}} module which integrates the - {{{http://mc4j.org/confluence/display/stripes/Home}Stripes}} MVC framework. - - After installed into magnolia, this module will allow you to use any available Stripes action as a Magnolia paragraph, - Any magically-converted Stripes action will still be able to use any standard Stripes feature, plus it will enjoy the - automatic injection of any paragraph property. - - <<This module requires magnolia 3.1-m3, and will not work on any earlier version!>> - -Configuration - - First of all drop the openutils-mgnlstripes jar and the stripes jar into WEB-INF/lib, or (better) if you are using maven - just declare the following dependency: - -+----------------------------------------------+ - <dependency> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-mgnlstripes</artifactId> - <version>0.2</version> - </dependency> -+----------------------------------------------+ - - Then configure stripes in your web.xml as usual (see {{{http://mc4j.org/confluence/display/stripes/Quick+Start+Guide}http://mc4j.org/confluence/display/stripes/Quick+Start+Guide}} for this). - - You only need to change the configuration for the stripes <<<ActionResolver.Class>>> in order to use - <<<it.openutils.magnoliastripes.MgnlActionResolver>>>. You can do that by adding/modifying the following init parameter - in WEB.xml: - - -+----------------------------------------------+ - <init-param> - <param-name>ActionResolver.Class</param-name> - <param-value>it.openutils.magnoliastripes.MgnlActionResolver</param-value> - </init-param> -+----------------------------------------------+ - -Usage - - When magnolia and stripes will startup now any auto-discovered stripes action will be configured in order to be used as - a magnolia paragraph. This means that paragraphs will be auto-generated, and they don't need to be configured into jcr. - - You should see a few <<<info>>> logs that enumerates the list of stripes paragraphs configured. By convention the name of - the paragraph is the same name of the Stripes action class minus action and lowercase. - - So <<<it.myapp.web.MyStripesAction >>> will be available as a paragraph named <<<mystripes>>>. - - Before being able to use any paragraph you will need to create a dialog for that. By convention the dialog should have - the same name of the paragraph so, following the previous example, you will need to configure a dialog called <<<mystripes>>>. - - Try to put a property called <<<title>>> in such dialog for a test. - - You are ready to use your paragraph into any magnolia template as usual: - -+----------------------------------------------+ - - <cms:contentNodeIterator contentNodeCollectionName="column"> - <cms:editBar adminOnly="true" /> - <cms:includeTemplate /> - </cms:contentNodeIterator> - <cms:newBar contentNodeCollectionName="column" paragraph="mystripes" adminOnly="true" /> - -+----------------------------------------------+ - - Try to add an instance of the <<<mystripes>>> paragraph. Set the title property to whatever you want, you - will be able to use it in your Stripes action bean. - - The following example show the code for the simple <<<MyStripesAction>>> that prints out the configured title to the log: - -+----------------------------------------------+ -package it.myapp.web; - -import net.sourceforge.stripes.action.ActionBean; -import net.sourceforge.stripes.action.ActionBeanContext; -import net.sourceforge.stripes.action.DefaultHandler; -import net.sourceforge.stripes.action.ForwardResolution; -import net.sourceforge.stripes.action.Resolution; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -public class MyStripesAction implements ActionBean -{ - - private Logger log = LoggerFactory.getLogger(MyStripesAction.class); - - private String title; - - @Override - public ActionBeanContext getContext() - { - // TODO - return null; - } - - @Override - public void setContext(ActionBeanContext context) - { - // TODO - } - - public void setTitle(String title) - { - this.title = title; - } - - @DefaultHandler - public Resolution show() - { - - log.info("My title is: {}!", title); - - return new ForwardResolution("/templates/paragraphs/anyjsp.jsp"); - } -} -+----------------------------------------------+ - - As you can see, you will be able to mix parameters that you can use in Stripes action with pure content. Note that you - will not need to configure and use any magnolia paragraph property into your action since you can still use also the - standard magnolia tags in the jsp that is rendered by stripes! - - -Todo/improvements - - Warning! This is a preliminary technology-preview release! - - What does this means? Well, that it should work fine, but the integration is not yet complete and there are still some - missing features... be careful for what is know to not to work. - - - This is a list of know todos: - - * Important! reload stripes paragraph when the configuration of other paragraphs in magnolia is changed! At this moment - stripes paragraphs disappear after any change in paragraphs configured into jcr. - - * Handle multipart forms in request wrapper (should be easy to do) - - * A better way of handling multivalued properties in paragraph - - * Handle binary properties in paragraph - - * Use spring binding/validation for validation of fields in dialogs - - Copied: tags/openutils-mgnlstripes-3.5/src/site/apt/index.apt (from rev 807, trunk/openutils-mgnlstripes/src/site/apt/index.apt) =================================================================== --- tags/openutils-mgnlstripes-3.5/src/site/apt/index.apt (rev 0) +++ tags/openutils-mgnlstripes-3.5/src/site/apt/index.apt 2008-05-05 23:11:37 UTC (rev 809) @@ -0,0 +1,144 @@ + -------------------------- + openutils-mgnlstripes + -------------------------- + Fabrizio Giustina + -------------------------- + +About openutils-mgnlstripes + + openutils-mgnlstripes is a custom {{{http://www.magnolia.info}magnolia}} module which integrates the + {{{http://mc4j.org/confluence/display/stripes/Home}Stripes}} MVC framework. + + After installed into magnolia, this module will allow you to use any available Stripes action as a Magnolia paragraph, + Any magically-converted Stripes action will still be able to use any standard Stripes feature, plus it will enjoy the + automatic injection of any paragraph property. + + <<This module requires magnolia 3.5.x, and will not work on any earlier version!>> + +Configuration + + First of all drop the openutils-mgnlstripes jar and the stripes jar into WEB-INF/lib, or (better) if you are using maven + just declare the following dependency: + ++----------------------------------------------+ + <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-mgnlstripes</artifactId> + <version>3.5</version> + </dependency> ++----------------------------------------------+ + + Then configure stripes in your web.xml as usual (see {{{http://mc4j.org/confluence/display/stripes/Quick+Start+Guide}http://mc4j.org/confluence/display/stripes/Quick+Start+Guide}} for this). + + <<update: since version 3.5 you don't need to add the Stripes filter to web.xml manually, since this is automatically + configured by the module in config:server/filters. You can add any initialization parameter you may need to the main + magnolia filter in web.xml and it will be inherited by the stripes filter>> + + You only need to change the configuration for the stripes <<<ActionResolver.Class>>> in order to use + <<<it.openutils.magnoliastripes.MgnlActionResolver>>>. You can do that by adding/modifying the following init parameter + in WEB.xml: + + ++----------------------------------------------+ + <init-param> + <param-name>ActionResolver.Class</param-name> + <param-value>it.openutils.magnoliastripes.MgnlActionResolver</param-value> + </init-param> ++----------------------------------------------+ + +Usage + + When magnolia and stripes will startup now any auto-discovered stripes action will be configured in order to be used as + a magnolia paragraph. This means that paragraphs will be auto-generated, and they don't need to be configured into jcr. + + You should see a few <<<info>>> logs that enumerates the list of stripes paragraphs configured. By convention the name of + the paragraph is the same name of the Stripes action class minus action and lowercase. + + So <<<it.myapp.web.MyStripesAction >>> will be available as a paragraph named <<<mystripes>>>. + + Before being able to use any paragraph you will need to create a dialog for that. By convention the dialog should have + the same name of the paragraph so, following the previous example, you will need to configure a dialog called <<<mystripes>>>. + + Try to put a property called <<<title>>> in such dialog for a test. + + You are ready to use your paragraph into any magnolia template as usual: + ++----------------------------------------------+ + + <cms:contentNodeIterator contentNodeCollectionName="column"> + <cms:editBar adminOnly="true" /> + <cms:includeTemplate /> + </cms:contentNodeIterator> + <cms:newBar contentNodeCollectionName="column" paragraph="mystripes" adminOnly="true" /> + ++----------------------------------------------+ + + Try to add an instance of the <<<mystripes>>> paragraph. Set the title property to whatever you want, you + will be able to use it in your Stripes action bean. + + The following example show the code for the simple <<<MyStripesAction>>> that prints out the configured title to the log: + ++----------------------------------------------+ +package it.myapp.web; + +import net.sourceforge.stripes.action.ActionBean; +import net.sourceforge.stripes.action.ActionBeanContext; +import net.sourceforge.stripes.action.DefaultHandler; +import net.sourceforge.stripes.action.ForwardResolution; +import net.sourceforge.stripes.action.Resolution; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class MyStripesAction implements ActionBean +{ + + private Logger log = LoggerFactory.getLogger(MyStripesAction.class); + + private String title; + + @Override + public ActionBeanContext getContext() + { + // TODO + return null; + } + + @Override + public void setContext(ActionBeanContext context) + { + // TODO + } + + public void setTitle(String title) + { + this.title = title; + } + + @DefaultHandler + public Resolution show() + { + + log.info("My title is: {}!", title); + + return new ForwardResolution("/templates/paragraphs/anyjsp.jsp"); + } +} ++----------------------------------------------+ + + As you can see, you will be able to mix parameters that you can use in Stripes action with pure content. Note that you + will not need to configure and use any magnolia paragraph property into your action since you can still use also the + standard magnolia tags in the jsp that is rendered by stripes! + + +Todo/improvements + + This is a list of know todos: + + * Important! reload stripes paragraph when the configuration of other paragraphs in magnolia is changed! At this moment + stripes paragraphs disappear after any change in paragraphs configured into jcr. + + * Use stripes binding/validation for validation of fields in dialogs + + Deleted: tags/openutils-mgnlstripes-3.5/src/site/changes/changes.xml =================================================================== --- trunk/openutils-mgnlstripes/src/site/changes/changes.xml 2008-04-29 12:54:36 UTC (rev 806) +++ tags/openutils-mgnlstripes-3.5/src/site/changes/changes.xml 2008-05-05 23:11:37 UTC (rev 809) @@ -1,29 +0,0 @@ -<?xml version="1.0"?> -<!-- - "type" attribute can be: add, remove, update or fix. ---> -<document> - <properties> - <title>Changes</title> - <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> - </properties> - <body> - <release version="3.5" date="2008-04-24" description="3.5"> - <action type="add" dev="fgiust" due-to=""> </action> - </release> - <release version="0.2" date="2007-08-14" description=""> - <action type="update" dev="fgiust"> - Added support for indexed parameters by replacing "{}" with "[]" in parameter names (hack). With Stripes you can - use indexed parameters, but square brakets are not allowed in jcr node names and can't be used in paragraph - attributes. You can now use "list{1}" in attribute names for that. - </action> - <action type="fix" dev="fgiust"> - Excluded commons-logging dependency from stripes in pom.xml. Magnolia already imports jcl104-over-slf4j, which - is a replacement over the standard commons-logging jar. - </action> - </release> - <release version="0.1" date="2007-08-13" description="Initial release"> - <action type="add" dev="fgiust" due-to="">Initial release with support for stripes paragraphs.</action> - </release> - </body> -</document> \ No newline at end of file Copied: tags/openutils-mgnlstripes-3.5/src/site/changes/changes.xml (from rev 807, trunk/openutils-mgnlstripes/src/site/changes/changes.xml) =================================================================== --- tags/openutils-mgnlstripes-3.5/src/site/changes/changes.xml (rev 0) +++ tags/openutils-mgnlstripes-3.5/src/site/changes/changes.xml 2008-05-05 23:11:37 UTC (rev 809) @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<!-- + "type" attribute can be: add, remove, update or fix. +--> +<document> + <properties> + <title>Changes</title> + <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> + </properties> + <body> + <release version="3.5" date="2008-04-24" description="3.5"> + <action type="update" dev="fgiust">update deps to magnolia 3.5.4</action> + <action type="update" dev="fgiust">the stripes filter is now added by the module automatically, and it should not + be added anymore in web.xml</action> + <action type="update" dev="fgiust">multipart forms are now handled properly</action> + </release> + <release version="0.2" date="2007-08-14" description=""> + <action type="update" dev="fgiust"> Added support for indexed parameters by replacing "{}" with "[]" in parameter + names (hack). With Stripes you can use indexed parameters, but square brakets are not allowed in jcr node names + and can't be used in paragraph attributes. You can now use "list{1}" in attribute names for that.</action> + <action type="fix" dev="fgiust"> Excluded commons-logging dependency from stripes in pom.xml. Magnolia already + imports jcl104-over-slf4j, which is a replacement over the standard commons-logging jar.</action> + </release> + <release version="0.1" date="2007-08-13" description="Initial release"> + <action type="add" dev="fgiust" due-to="">Initial release with support for stripes paragraphs.</action> + </release> + </body> +</document> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-05-05 23:10:47
|
Revision: 808 http://openutils.svn.sourceforge.net/openutils/?rev=808&view=rev Author: fgiust Date: 2008-05-05 16:10:29 -0700 (Mon, 05 May 2008) Log Message: ----------- [maven-release-plugin] prepare release openutils-mgnlstripes-3.5 Modified Paths: -------------- trunk/openutils-mgnlstripes/pom.xml Modified: trunk/openutils-mgnlstripes/pom.xml =================================================================== --- trunk/openutils-mgnlstripes/pom.xml 2008-05-05 23:08:04 UTC (rev 807) +++ trunk/openutils-mgnlstripes/pom.xml 2008-05-05 23:10:29 UTC (rev 808) @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<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"> +<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>net.sourceforge.openutils</groupId> <artifactId>openutils</artifactId> @@ -11,7 +10,7 @@ <packaging>jar</packaging> <artifactId>openutils-mgnlstripes</artifactId> <name>openutils-mgnlstripes</name> - <version>3.5-SNAPSHOT</version> + <version>3.5</version> <licenses> <license> <name>GPLv3</name> @@ -97,4 +96,10 @@ </snapshots> </repository> </repositories> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-3.5</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlstripes-3.5</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlstripes-3.5</url> + </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-05-05 23:08:41
|
Revision: 807 http://openutils.svn.sourceforge.net/openutils/?rev=807&view=rev Author: fgiust Date: 2008-05-05 16:08:04 -0700 (Mon, 05 May 2008) Log Message: ----------- ready for 3.5 Modified Paths: -------------- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java trunk/openutils-mgnlstripes/src/site/apt/index.apt trunk/openutils-mgnlstripes/src/site/changes/changes.xml Added Paths: ----------- trunk/openutils-mgnlstripes/src/main/resources/META-INF/mgnlstripes.tld Removed Paths: ------------- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedLabelTag.java trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedMessagesTag.java Modified: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java 2008-04-29 12:54:36 UTC (rev 806) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedFormTag.java 2008-05-05 23:08:04 UTC (rev 807) @@ -22,6 +22,10 @@ /** + * <p> + * workaround needed to create a form tag with an "url" attribute different from the actionbean mapped uri. Could be + * solved more cleanly by http://mc4j.org/jira/browse/STS-349, which will be available in stripes 1.5 + * </p> * @author fgiust * @version $Id: $ */ Deleted: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedLabelTag.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedLabelTag.java 2008-04-29 12:54:36 UTC (rev 806) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedLabelTag.java 2008-05-05 23:08:04 UTC (rev 807) @@ -1,276 +0,0 @@ -/** - * Copyright Openmind http://www.openmindonline.it - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -package it.openutils.magnoliastripes.tag; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.HashMap; -import java.util.Map; - -import javax.servlet.jsp.JspException; - -import net.sourceforge.stripes.action.ActionBean; -import net.sourceforge.stripes.controller.ParameterName; -import net.sourceforge.stripes.exception.StripesJspException; -import net.sourceforge.stripes.tag.InputLabelTag; -import net.sourceforge.stripes.validation.Validate; -import net.sourceforge.stripes.validation.ValidateNestedProperties; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * @author molaschi - * @version $Id: $ - */ -public class ExtendedLabelTag extends InputLabelTag -{ - - /** - * Logger. - */ - private Logger log = LoggerFactory.getLogger(ExtendedLabelTag.class); - - boolean nameSet = false; - - /** - * {@inheritDoc} - */ - @Override - public void setName(String name) - { - // TODO Auto-generated method stub - super.setName(name); - this.nameSet = true; - } - - /** - * {@inheritDoc} - */ - @Override - public int doEndInputTag() throws JspException - { - try - { - String label = getLocalizedFieldName(); - String fieldName = getAttributes().remove("name"); - - if (label == null) - { - label = getBodyContentAsString(); - } - - if (label == null) - { - label = "Label could not find localized field name and had no body."; - } - - if (isRequiredField(this.getActionBean(), fieldName)) - { - String cssClass = get("class"); - if (cssClass != null) - { - set("class", cssClass + " required"); - } - else - { - set("class","required"); - } - } - - // Write out the tag - writeOpenTag(getPageContext().getOut(), "label"); - getPageContext().getOut().write(label); - writeCloseTag(getPageContext().getOut(), "label"); - - // Reset the field name so as to not screw up tag pooling - if (this.nameSet) - { - super.setName(fieldName); - } - - set("class", null); - - return EVAL_PAGE; - } - catch (IOException ioe) - { - throw new StripesJspException("Encountered an exception while trying to write to " - + "the output from the stripes:label tag handler class, InputLabelTag.", ioe); - } - } - - protected boolean isRequiredField(ActionBean bean, String name) - { - - ParameterName param = new ParameterName(name); - boolean isIndexed = param.isIndexed(); - - Map<String, Validate> validationInfos = getValidations(bean.getClass()); - - if (validationInfos != null) - { - - for (Map.Entry<String, Validate> entry : validationInfos.entrySet()) - { - String propertyName = entry.getKey(); - Validate validationInfo = entry.getValue(); - - if (name.equals(propertyName) && validationInfo.required() && !isIndexed) - { - return true; - } - } - } - - if (isIndexed) - { - - Validate validationInfo = validationInfos.get(param.getStrippedName()); - - if (validationInfo != null && validationInfo.required()) - { - return true; - } - } - return false; - } - - @SuppressWarnings("unchecked") - protected Map<String, Validate> getValidations(Class< ? extends ActionBean> clazz) - { - if (this.pageContext.getAttribute("validationInfos") != null) - { - Map<String, Map<String, Validate>> validationInfos = (Map<String, Map<String, Validate>>) this.pageContext - .getAttribute("validationInfos"); - if (validationInfos.containsKey(clazz.getName())) - { - return validationInfos.get(clazz.getName()); - } - else - { - Map<String, Validate> fieldValidations = new HashMap<String, Validate>(); - processClassAnnotations(clazz, fieldValidations); - validationInfos.put(clazz.getName(), fieldValidations); - return fieldValidations; - } - } - else - { - Map<String, Map<String, Validate>> validationInfos = new HashMap<String, Map<String, Validate>>(); - Map<String, Validate> fieldValidations = new HashMap<String, Validate>(); - processClassAnnotations(clazz, fieldValidations); - validationInfos.put(clazz.getName(), fieldValidations); - this.pageContext.setAttribute("validationInfos", validationInfos); - return fieldValidations; - } - } - - @SuppressWarnings("unchecked") - protected void processClassAnnotations(Class clazz, Map<String, Validate> fieldValidations) - { - Class superclass = clazz.getSuperclass(); - if (superclass != null) - { - processClassAnnotations(superclass, fieldValidations); - } - - // Process the methods on the class - Method[] methods = clazz.getDeclaredMethods(); - for (Method method : methods) - { - if (!Modifier.isPublic(method.getModifiers())) - { - continue; // only public methods! - } - - Validate validation = method.getAnnotation(Validate.class); - if (validation != null && validation.required()) - { - String fieldName = getPropertyName(method.getName()); - fieldValidations.put(fieldName, validation); - } - - ValidateNestedProperties nested = method.getAnnotation(ValidateNestedProperties.class); - if (nested != null) - { - String fieldName = getPropertyName(method.getName()); - Validate[] validations = nested.value(); - for (Validate nestedValidate : validations) - { - if ("".equals(nestedValidate.field())) - { - log.warn("Nested validation used without field name: ", validation); - } - else - { - if (nestedValidate.required()) - { - fieldValidations.put(fieldName + "." + nestedValidate.field(), nestedValidate); - } - } - } - } - } - - // Process the fields for validation annotations - Field[] fields = clazz.getDeclaredFields(); - for (Field field : fields) - { - Validate validation = field.getAnnotation(Validate.class); - if (validation != null && validation.required()) - { - fieldValidations.put(field.getName(), validation); - } - - ValidateNestedProperties nested = field.getAnnotation(ValidateNestedProperties.class); - if (nested != null) - { - Validate[] validations = nested.value(); - for (Validate nestedValidate : validations) - { - if ("".equals(nestedValidate.field())) - { - log.warn("Nested validation used without field name: ", validation); - } - else - { - if (nestedValidate.required()) - { - fieldValidations.put(field.getName() + "." + nestedValidate.field(), nestedValidate); - } - } - } - } - } - } - - /** - * Helper method that returns the name of the property when supplied with the corresponding get or set method. Does - * not do anything particularly intelligent, just drops the first three characters and makes the next character - * lower case. - */ - protected String getPropertyName(String methodName) - { - return methodName.substring(3, 4).toLowerCase() + methodName.substring(4); - } - -} Deleted: trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedMessagesTag.java =================================================================== --- trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedMessagesTag.java 2008-04-29 12:54:36 UTC (rev 806) +++ trunk/openutils-mgnlstripes/src/main/java/it/openutils/magnoliastripes/tag/ExtendedMessagesTag.java 2008-05-05 23:08:04 UTC (rev 807) @@ -1,276 +0,0 @@ -/** - * Copyright Openmind http://www.openmindonline.it - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -package it.openutils.magnoliastripes.tag; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.HashMap; -import java.util.Map; - -import javax.servlet.jsp.JspException; - -import net.sourceforge.stripes.action.ActionBean; -import net.sourceforge.stripes.controller.ParameterName; -import net.sourceforge.stripes.exception.StripesJspException; -import net.sourceforge.stripes.tag.InputLabelTag; -import net.sourceforge.stripes.validation.Validate; -import net.sourceforge.stripes.validation.ValidateNestedProperties; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - -/** - * @author luca boati - * @version $Id$ - */ -public class ExtendedMessagesTag extends InputLabelTag -{ - - /** - * Logger. - */ - private Logger log = LoggerFactory.getLogger(ExtendedMessagesTag.class); - - boolean nameSet = false; - - /** - * {@inheritDoc} - */ - @Override - public void setName(String name) - { - // TODO Auto-generated method stub - super.setName(name); - this.nameSet = true; - } - - /** - * {@inheritDoc} - */ - @Override - public int doEndInputTag() throws JspException - { - try - { - String label = getLocalizedFieldName(); - String fieldName = getAttributes().remove("name"); - - if (label == null) - { - label = getBodyContentAsString(); - } - - if (label == null) - { - label = "Label could not find localized field name and had no body."; - } - - // if (isRequiredField(this.getActionBean(), fieldName)) - // { - // String cssClass = get("class"); - // if (cssClass != null) - // { - // set("class", cssClass + " required"); - // } - // else - // { - // set("class", "required"); - // } - // } - - // Write out the tag - // writeOpenTag(getPageContext().getOut(), "label"); - getPageContext().getOut().write(label); - // writeCloseTag(getPageContext().getOut(), "label"); - - // Reset the field name so as to not screw up tag pooling - if (this.nameSet) - { - super.setName(fieldName); - } - - // set("class", null); - - return EVAL_PAGE; - } - catch (IOException ioe) - { - throw new StripesJspException("Encountered an exception while trying to write to " - + "the output from the stripes:label tag handler class, InputLabelTag.", ioe); - } - } - - protected boolean isRequiredField(ActionBean bean, String name) - { - - ParameterName param = new ParameterName(name); - boolean isIndexed = param.isIndexed(); - - Map<String, Validate> validationInfos = getValidations(bean.getClass()); - - if (validationInfos != null) - { - - for (Map.Entry<String, Validate> entry : validationInfos.entrySet()) - { - String propertyName = entry.getKey(); - Validate validationInfo = entry.getValue(); - - if (name.equals(propertyName) && validationInfo.required() && !isIndexed) - { - return true; - } - } - } - - if (isIndexed) - { - - Validate validationInfo = validationInfos.get(param.getStrippedName()); - - if (validationInfo != null && validationInfo.required()) - { - return true; - } - } - return false; - } - - @SuppressWarnings("unchecked") - protected Map<String, Validate> getValidations(Class< ? extends ActionBean> clazz) - { - if (this.pageContext.getAttribute("validationInfos") != null) - { - Map<String, Map<String, Validate>> validationInfos = (Map<String, Map<String, Validate>>) this.pageContext - .getAttribute("validationInfos"); - if (validationInfos.containsKey(clazz.getName())) - { - return validationInfos.get(clazz.getName()); - } - else - { - Map<String, Validate> fieldValidations = new HashMap<String, Validate>(); - processClassAnnotations(clazz, fieldValidations); - validationInfos.put(clazz.getName(), fieldValidations); - return fieldValidations; - } - } - else - { - Map<String, Map<String, Validate>> validationInfos = new HashMap<String, Map<String, Validate>>(); - Map<String, Validate> fieldValidations = new HashMap<String, Validate>(); - processClassAnnotations(clazz, fieldValidations); - validationInfos.put(clazz.getName(), fieldValidations); - this.pageContext.setAttribute("validationInfos", validationInfos); - return fieldValidations; - } - } - - @SuppressWarnings("unchecked") - protected void processClassAnnotations(Class clazz, Map<String, Validate> fieldValidations) - { - Class superclass = clazz.getSuperclass(); - if (superclass != null) - { - processClassAnnotations(superclass, fieldValidations); - } - - // Process the methods on the class - Method[] methods = clazz.getDeclaredMethods(); - for (Method method : methods) - { - if (!Modifier.isPublic(method.getModifiers())) - { - continue; // only public methods! - } - - Validate validation = method.getAnnotation(Validate.class); - if (validation != null && validation.required()) - { - String fieldName = getPropertyName(method.getName()); - fieldValidations.put(fieldName, validation); - } - - ValidateNestedProperties nested = method.getAnnotation(ValidateNestedProperties.class); - if (nested != null) - { - String fieldName = getPropertyName(method.getName()); - Validate[] validations = nested.value(); - for (Validate nestedValidate : validations) - { - if ("".equals(nestedValidate.field())) - { - log.warn("Nested validation used without field name: ", validation); - } - else - { - if (nestedValidate.required()) - { - fieldValidations.put(fieldName + "." + nestedValidate.field(), nestedValidate); - } - } - } - } - } - - // Process the fields for validation annotations - Field[] fields = clazz.getDeclaredFields(); - for (Field field : fields) - { - Validate validation = field.getAnnotation(Validate.class); - if (validation != null && validation.required()) - { - fieldValidations.put(field.getName(), validation); - } - - ValidateNestedProperties nested = field.getAnnotation(ValidateNestedProperties.class); - if (nested != null) - { - Validate[] validations = nested.value(); - for (Validate nestedValidate : validations) - { - if ("".equals(nestedValidate.field())) - { - log.warn("Nested validation used without field name: ", validation); - } - else - { - if (nestedValidate.required()) - { - fieldValidations.put(field.getName() + "." + nestedValidate.field(), nestedValidate); - } - } - } - } - } - } - - /** - * Helper method that returns the name of the property when supplied with the corresponding get or set method. Does - * not do anything particularly intelligent, just drops the first three characters and makes the next character - * lower case. - */ - protected String getPropertyName(String methodName) - { - return methodName.substring(3, 4).toLowerCase() + methodName.substring(4); - } - -} Added: trunk/openutils-mgnlstripes/src/main/resources/META-INF/mgnlstripes.tld =================================================================== --- trunk/openutils-mgnlstripes/src/main/resources/META-INF/mgnlstripes.tld (rev 0) +++ trunk/openutils-mgnlstripes/src/main/resources/META-INF/mgnlstripes.tld 2008-05-05 23:08:04 UTC (rev 807) @@ -0,0 +1,198 @@ +<taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" + version="2.0"> + <description>mgnlstripes</description> + <display-name>mgnlstripes tags</display-name> + <tlib-version>1.0</tlib-version> + <short-name>mgnlstripes</short-name> + <uri>mgnlstripes</uri> + <tag> + <description> Stripes' HTML form tag. Provides a standard HTML form tag interface, but allows other stripes input + tags to re-populate their values. Also includes a hidden field in the form for the page name that the form is + being rendered on (to allow forwarding to the same page in the case of a validation error. </description> + <display-name>form</display-name> + <name>form</name> + <tag-class>it.openutils.magnoliastripes.tag.ExtendedFormTag</tag-class> + <body-content>JSP</body-content> + <attribute> + <description> The URL to which this form will post. Expected to be a web-app relative path - the tag will prepend + the context path to any action that begins with a slash and does not already contain the context path. Should + match a URL to which an ActionBean has been bound. Required unless 'beanclass' is provided. </description> + <name>action</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> The fully qualified name of an ActionBean class, or alternatively a Class instance for an ActionBean + class. An alternative to the 'action' attribute, the 'beanclass' attribute will generate an action appropriate + for the ActionBean identified. Note that if an "ActionBean" that does not yet exist is identified an exception + will be thrown! </description> + <name>beanclass</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <type>java.lang.Object</type> + </attribute> + <attribute> + <description> The name of the form field that should receive focus when the page is loaded. Two special values are + recognized, 'first' and the empty string; these values cause the form to set focus on the first element in the + form. If any value is set, and the form has validation errors, the behaviour is altered and the first field with + validation errors is focused instead. </description> + <name>focus</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + <type>java.lang.String</type> + </attribute> + <attribute> + <description> A comma separated list of content types that it is acceptable to submit through this form. (HTML + Pass-through) </description> + <name>accept</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> A comma separated list of possible character sets for form data. Will be written to the page as + accept-charset. (HTML Pass-through) </description> + <name>acceptcharset</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> The mime type used to encode the content of this form. This value will be overridden if one or more + Stripes file input tags is used within the body of the form. </description> + <name>enctype</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> The HTTP method used for sending data to the server. Options are GET and POST. Default is GET. (HTML + Pass-through) </description> + <name>method</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>The unique name of the form. (HTML Pass-through)</description> + <name>name</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description> Where the target URL is to be opened. One of _blank, _self, _parent and _top. (HTML Pass-through) + </description> + <name>target</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when the form is reset. (HTML Pass-through)</description> + <name>onreset</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run prior to the form being submitted to the server, (HTML Pass-through)</description> + <name>onsubmit</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <!-- Start: Standard HTML attributes --> + <attribute> + <description>The CSS class to be applied to the element. (HTML Pass-through)</description> + <name>class</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Text direction. (HTML Pass-through)</description> + <name>dir</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>A unique identifier for the HTML tag on the pgae. (HTML Pass-through)</description> + <name>id</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>The language code of the element. (HTML Pass-through)</description> + <name>lang</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run on each mouse click. (HTML Pass-through)</description> + <name>onclick</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run on a double-click of the mouse. (HTML Pass-through)</description> + <name>ondblclick</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when a key is depressed. (HTML Pass-through)</description> + <name>onkeydown</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when a key is pressed and released. (HTML Pass-through)</description> + <name>onkeypress</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when a key is released. (HTML Pass-through)</description> + <name>onkeyup</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when a mouse button is depressed. (HTML Pass-through)</description> + <name>onmousedown</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when the mouse pointer is moved. (HTML Pass-through)</description> + <name>onmousemove</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when the mouse pointer moves out of the element. (HTML Pass-through)</description> + <name>onmouseout</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when the mouse pointer moves over the element. (HTML Pass-through)</description> + <name>onmouseover</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Scripting code run when a mouse button is released. (HTML Pass-through)</description> + <name>onmouseup</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Inline CSS style fragment that applies to the element (HTML Pass-through)</description> + <name>style</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <attribute> + <description>Tool-tip text for the element. (HTML Pass-through)</description> + <name>title</name> + <required>false</required> + <rtexprvalue>true</rtexprvalue> + </attribute> + <!-- End: Standard HTML attributes --> + <dynamic-attributes>false</dynamic-attributes> + </tag> +</taglib> \ No newline at end of file Modified: trunk/openutils-mgnlstripes/src/site/apt/index.apt =================================================================== --- trunk/openutils-mgnlstripes/src/site/apt/index.apt 2008-04-29 12:54:36 UTC (rev 806) +++ trunk/openutils-mgnlstripes/src/site/apt/index.apt 2008-05-05 23:08:04 UTC (rev 807) @@ -13,7 +13,7 @@ Any magically-converted Stripes action will still be able to use any standard Stripes feature, plus it will enjoy the automatic injection of any paragraph property. - <<This module requires magnolia 3.1-m3, and will not work on any earlier version!>> + <<This module requires magnolia 3.5.x, and will not work on any earlier version!>> Configuration @@ -24,12 +24,16 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-mgnlstripes</artifactId> - <version>0.2</version> + <version>3.5</version> </dependency> +----------------------------------------------+ Then configure stripes in your web.xml as usual (see {{{http://mc4j.org/confluence/display/stripes/Quick+Start+Guide}http://mc4j.org/confluence/display/stripes/Quick+Start+Guide}} for this). + <<update: since version 3.5 you don't need to add the Stripes filter to web.xml manually, since this is automatically + configured by the module in config:server/filters. You can add any initialization parameter you may need to the main + magnolia filter in web.xml and it will be inherited by the stripes filter>> + You only need to change the configuration for the stripes <<<ActionResolver.Class>>> in order to use <<<it.openutils.magnoliastripes.MgnlActionResolver>>>. You can do that by adding/modifying the following init parameter in WEB.xml: @@ -130,23 +134,11 @@ Todo/improvements - Warning! This is a preliminary technology-preview release! - - What does this means? Well, that it should work fine, but the integration is not yet complete and there are still some - missing features... be careful for what is know to not to work. - - This is a list of know todos: * Important! reload stripes paragraph when the configuration of other paragraphs in magnolia is changed! At this moment stripes paragraphs disappear after any change in paragraphs configured into jcr. - * Handle multipart forms in request wrapper (should be easy to do) + * Use stripes binding/validation for validation of fields in dialogs - * A better way of handling multivalued properties in paragraph - * Handle binary properties in paragraph - - * Use spring binding/validation for validation of fields in dialogs - - Modified: trunk/openutils-mgnlstripes/src/site/changes/changes.xml =================================================================== --- trunk/openutils-mgnlstripes/src/site/changes/changes.xml 2008-04-29 12:54:36 UTC (rev 806) +++ trunk/openutils-mgnlstripes/src/site/changes/changes.xml 2008-05-05 23:08:04 UTC (rev 807) @@ -9,18 +9,17 @@ </properties> <body> <release version="3.5" date="2008-04-24" description="3.5"> - <action type="add" dev="fgiust" due-to=""> </action> + <action type="update" dev="fgiust">update deps to magnolia 3.5.4</action> + <action type="update" dev="fgiust">the stripes filter is now added by the module automatically, and it should not + be added anymore in web.xml</action> + <action type="update" dev="fgiust">multipart forms are now handled properly</action> </release> <release version="0.2" date="2007-08-14" description=""> - <action type="update" dev="fgiust"> - Added support for indexed parameters by replacing "{}" with "[]" in parameter names (hack). With Stripes you can - use indexed parameters, but square brakets are not allowed in jcr node names and can't be used in paragraph - attributes. You can now use "list{1}" in attribute names for that. - </action> - <action type="fix" dev="fgiust"> - Excluded commons-logging dependency from stripes in pom.xml. Magnolia already imports jcl104-over-slf4j, which - is a replacement over the standard commons-logging jar. - </action> + <action type="update" dev="fgiust"> Added support for indexed parameters by replacing "{}" with "[]" in parameter + names (hack). With Stripes you can use indexed parameters, but square brakets are not allowed in jcr node names + and can't be used in paragraph attributes. You can now use "list{1}" in attribute names for that.</action> + <action type="fix" dev="fgiust"> Excluded commons-logging dependency from stripes in pom.xml. Magnolia already + imports jcl104-over-slf4j, which is a replacement over the standard commons-logging jar.</action> </release> <release version="0.1" date="2007-08-13" description="Initial release"> <action type="add" dev="fgiust" due-to="">Initial release with support for stripes paragraphs.</action> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-04-29 15:20:50
|
Revision: 804 http://openutils.svn.sourceforge.net/openutils/?rev=804&view=rev Author: molaschi Date: 2008-04-29 05:42:20 -0700 (Tue, 29 Apr 2008) Log Message: ----------- Add project openutils-mgnlbootstrapsync and module to pom.xml Modified Paths: -------------- trunk/pom.xml Added Paths: ----------- trunk/openutils-mgnlbootstrapsync/ Property changes on: trunk/openutils-mgnlbootstrapsync ___________________________________________________________________ Name: svn:ignore + .* target Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2008-04-29 12:26:18 UTC (rev 803) +++ trunk/pom.xml 2008-04-29 12:42:20 UTC (rev 804) @@ -234,6 +234,7 @@ <module>openutils-mgnlstripes</module> <module>openutils-mgnltasks</module> <module>openutils-spring-rmibernate</module> + <module>openutils-mgnlbootstrapsync</module> <!-- <module>openutils-spring-remote-callback</module>--> </modules> <dependencyManagement> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-04-29 12:54:35
|
Revision: 806 http://openutils.svn.sourceforge.net/openutils/?rev=806&view=rev Author: molaschi Date: 2008-04-29 05:54:36 -0700 (Tue, 29 Apr 2008) Log Message: ----------- test folders Added Paths: ----------- trunk/openutils-mgnlbootstrapsync/src/test/ trunk/openutils-mgnlbootstrapsync/src/test/java/ trunk/openutils-mgnlbootstrapsync/src/test/resources/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mol...@us...> - 2008-04-29 12:53:49
|
Revision: 805 http://openutils.svn.sourceforge.net/openutils/?rev=805&view=rev Author: molaschi Date: 2008-04-29 05:53:22 -0700 (Tue, 29 Apr 2008) Log Message: ----------- Add openutils-mgnlbootstrapsync files Added Paths: ----------- trunk/openutils-mgnlbootstrapsync/pom.xml trunk/openutils-mgnlbootstrapsync/src/ trunk/openutils-mgnlbootstrapsync/src/main/ trunk/openutils-mgnlbootstrapsync/src/main/java/ trunk/openutils-mgnlbootstrapsync/src/main/java/it/ trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/ trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/ trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/BootstrapAtomicFilter.java trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/BootstrapEnableRoot.java trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/BootstrapExportRoot.java trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/lifecycle/ trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/lifecycle/BootstrapSyncModuleLifecycle.java trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/ trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/AbstractBootstrapSyncListener.java trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/watch/ trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/watch/BootstrapSyncRepositoryWatch.java trunk/openutils-mgnlbootstrapsync/src/main/resources/ trunk/openutils-mgnlbootstrapsync/src/main/resources/META-INF/ trunk/openutils-mgnlbootstrapsync/src/main/resources/META-INF/magnolia/ trunk/openutils-mgnlbootstrapsync/src/main/resources/META-INF/magnolia/bootstrapsync.xml Added: trunk/openutils-mgnlbootstrapsync/pom.xml =================================================================== --- trunk/openutils-mgnlbootstrapsync/pom.xml (rev 0) +++ trunk/openutils-mgnlbootstrapsync/pom.xml 2008-04-29 12:53:22 UTC (rev 805) @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>8</version> + <relativePath>..</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <packaging>jar</packaging> + <artifactId>openutils-mgnlbootstrapsync</artifactId> + <name>openutils-mgnlbootstrapsync</name> + <version>0.1-SNAPSHOT</version> + <licenses> + <license> + <name>GPLv3</name> + <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> + </license> + </licenses> + <build> + <resources> + <resource> + <filtering>false</filtering> + <directory>src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + <resource> + <filtering>true</filtering> + <directory>src/main/resources</directory> + <includes> + <include>META-INF/magnolia/*</include> + </includes> + </resource> + </resources> + </build> + <dependencies> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-core</artifactId> + <version>3.5-rc2</version> + </dependency> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-module-admininterface</artifactId> + <version>3.5.2</version> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.1</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + <repositories> + <repository> + <id>repository.magnolia.info</id> + <name>magnolia repository</name> + <url>http://svn.magnolia.info/maven/m2</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> +</project> Property changes on: trunk/openutils-mgnlbootstrapsync/pom.xml ___________________________________________________________________ Name: svn:executable + * Name: svn:eol-style + native Added: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/BootstrapAtomicFilter.java =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/BootstrapAtomicFilter.java (rev 0) +++ trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/BootstrapAtomicFilter.java 2008-04-29 12:53:22 UTC (rev 805) @@ -0,0 +1,144 @@ +package it.openutils.mgnlbootstrapsync; + +import info.magnolia.cms.core.ie.filters.VersionFilter; + +import org.apache.commons.lang.ArrayUtils; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.XMLFilterImpl; + + +/** + * @author mmolaschi + * @version $Id: $ + */ +public class BootstrapAtomicFilter extends XMLFilterImpl +{ + + private int inLevel; + + private int inVersionElement; + + private boolean inMetadata; + + /** + * @param parent parent reader + */ + public BootstrapAtomicFilter(XMLReader parent) + { + super(parent); + } + + /** + * {@inheritDoc} + */ + @Override + public void endElement(String uri, String localName, String qName) throws SAXException + { + if (inVersionElement > 0) + { + inVersionElement--; + return; + } + + if (inLevel > 0) + { + if ("sv:node".equals(qName)) + { + if (inMetadata && inLevel == 3) + { + inMetadata = false; + inLevel--; + super.endElement(uri, localName, qName); + return; + } + inLevel--; + + if (inLevel > 1) + { + return; + } + } + if (inMetadata && inLevel >= 2) + { + super.endElement(uri, localName, qName); + return; + } + if (inLevel > 2) + { + return; + } + } + + super.endElement(uri, localName, qName); + } + + /** + * {@inheritDoc} + */ + @Override + public void characters(char[] ch, int start, int length) throws SAXException + { + // filter content + if (inVersionElement == 0 && (inMetadata || inLevel <= 2)) + { + super.characters(ch, start, length); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException + { + if (inVersionElement > 0) + { + inVersionElement++; + return; + } + if ("sv:node".equals(qName)) + { + String attName = atts.getValue("sv:name"); //$NON-NLS-1$ + if (attName != null && ArrayUtils.contains(VersionFilter.FILTERED_NODES, attName)) + { + inVersionElement++; + return; + } + } + else if ("sv:property".equals(qName)) + { + String attName = atts.getValue("sv:name"); //$NON-NLS-1$ + if (attName != null && ArrayUtils.contains(VersionFilter.FILTERED_PROPERTIES, attName)) + { + inVersionElement++; + return; + } + } + + if (!inMetadata && inLevel > 2) + { + if ("sv:node".equals(qName)) + { + inLevel++; + } + return; + } + + if ("sv:node".equals(qName)) + { + String attName = atts.getValue("sv:name"); + inLevel++; + if ("MetaData".equals(attName) && inLevel == 3) + { + inMetadata = true; + } + else if (inLevel > 2) + { + return; + } + } + super.startElement(uri, localName, qName, atts); + } +} Property changes on: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/BootstrapAtomicFilter.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/BootstrapEnableRoot.java =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/BootstrapEnableRoot.java (rev 0) +++ trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/BootstrapEnableRoot.java 2008-04-29 12:53:22 UTC (rev 805) @@ -0,0 +1,125 @@ +package it.openutils.mgnlbootstrapsync; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang.StringUtils; + + +/** + * @author mmolaschi luca boati + * @version $Id: $ + */ +public class BootstrapEnableRoot +{ + + private String enableRoots; + + private List<String[]> rootTokensList; + + /** + * + */ + public BootstrapEnableRoot() + { + + } + + /** + * + * @param enableRoots comma separeted list of enabled roots + */ + public BootstrapEnableRoot(String enableRoots) + { + this.setEnableRoots(enableRoots); + } + + /** + * Returns the enableRoots. + * @return the enableRoots + */ + public String getEnableRoots() + { + return enableRoots; + } + + /** + * Sets the enableRoots. + * @param enableRoots the enableRoots to set + */ + public void setEnableRoots(String enableRoots) + { + this.enableRoots = enableRoots; + + if (enableRoots != null) + { + String[] roots = StringUtils.split(enableRoots, ","); + rootTokensList = new ArrayList<String[]>(roots.length); + for (String root : roots) + { + String[] rootTokens = StringUtils.split(root, "/"); + int i = 0; + for (String[] rt : rootTokensList) + { + if (rootTokens.length > rt.length) + { + rootTokensList.add(i, rootTokens); + i = -1; + break; + } + i++; + } + if (i >= 0) + { + rootTokensList.add(rootTokens); + } + } + } + } + + /** + * Check if a path is enabled + * @param path path to check + * @return true if path is enabled + */ + public boolean isEnable(String path) + { + // check if a node can be exported + if (path == null) + { + return true; + } + + // if enablePath is not set, the node can be exported + if (rootTokensList == null || rootTokensList.size() == 0) + { + return true; + } + + String[] pathTokens = StringUtils.split(path, "/"); + for (String[] rootTokens : rootTokensList) + { + if (pathTokens.length < rootTokens.length) + { + continue; + } + boolean match = true; + for (int i = 0; i < rootTokens.length; i++) + { + if (!rootTokens[i].equals(pathTokens[i])) + { + match = false; + break; + } + } + + if (match) + { + return true; + } + } + + return false; + + } +} Property changes on: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/BootstrapEnableRoot.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/BootstrapExportRoot.java =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/BootstrapExportRoot.java (rev 0) +++ trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/BootstrapExportRoot.java 2008-04-29 12:53:22 UTC (rev 805) @@ -0,0 +1,137 @@ +package it.openutils.mgnlbootstrapsync; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang.StringUtils; + + +/** + * @author mmolaschi luca boati + * @version $Id: $ + */ +public class BootstrapExportRoot +{ + + private String exportRoots; + + private List<String[]> rootTokensList; + + /** + * + */ + public BootstrapExportRoot() + { + + } + + /** + * @param exportRoots comma separeted list of nodes (every modified to children will be exported as this node) + */ + public BootstrapExportRoot(String exportRoots) + { + this.setExportRoots(exportRoots); + } + + /** + * Returns the exportRoots. + * @return the exportRoots + */ + public String getExportRoots() + { + return exportRoots; + } + + /** + * Sets the exportRoots. + * @param exportRoots the exportRoots to set + */ + public void setExportRoots(String exportRoots) + { + this.exportRoots = exportRoots; + + if (exportRoots != null) + { + String[] roots = StringUtils.split(exportRoots, ","); + rootTokensList = new ArrayList<String[]>(roots.length); + for (String root : roots) + { + String[] rootTokens = StringUtils.split(root, "/"); + int i = 0; + for (String[] rt : rootTokensList) + { + if (rootTokens.length > rt.length) + { + rootTokensList.add(i, rootTokens); + i = -1; + break; + } + i++; + } + if (i >= 0) + { + rootTokensList.add(rootTokens); + } + } + } + } + + /** + * Check if path match some root node + * @param path path to check + * @return true if a path match some root + */ + public boolean match(String path) + { + return null != getRootPath(path); + } + + /** + * Get matching root for path + * @param path path + * @return matching root + */ + public String getRootPath(String path) + { + if (rootTokensList == null || rootTokensList.size() == 0) + { + return null; + } + + String[] pathTokens = StringUtils.split(path, "/"); + for (String[] rootTokens : rootTokensList) + { + if (pathTokens.length < rootTokens.length) + { + continue; + } + boolean match = true; + for (int i = 0; i < rootTokens.length; i++) + { + if (rootTokens[i].equals("*")) + { + continue; + } + if (!rootTokens[i].equals(pathTokens[i])) + { + match = false; + break; + } + } + if (match) + { + String[] pathRootTokens = (String[]) ArrayUtils.subarray(pathTokens, 0, rootTokens.length); + + String pathRoot = StringUtils.join(pathRootTokens, "/"); + if (!pathRoot.startsWith("/")) + { + pathRoot = "/" + pathRoot; + } + return pathRoot; + } + } + return null; + + } +} Property changes on: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/BootstrapExportRoot.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/lifecycle/BootstrapSyncModuleLifecycle.java =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/lifecycle/BootstrapSyncModuleLifecycle.java (rev 0) +++ trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/lifecycle/BootstrapSyncModuleLifecycle.java 2008-04-29 12:53:22 UTC (rev 805) @@ -0,0 +1,143 @@ +package it.openutils.mgnlbootstrapsync.lifecycle; + +import java.util.HashMap; +import java.util.Map; + +import javax.jcr.RepositoryException; +import javax.jcr.observation.Event; + +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import info.magnolia.cms.core.HierarchyManager; +import info.magnolia.cms.core.ItemType; +import info.magnolia.cms.core.SystemProperty; +import info.magnolia.context.MgnlContext; +import info.magnolia.module.ModuleLifecycle; +import info.magnolia.module.ModuleLifecycleContext; +import it.openutils.mgnlbootstrapsync.listener.AbstractBootstrapSyncListener; +import it.openutils.mgnlbootstrapsync.listener.BootstrapSyncListener; +import it.openutils.mgnlbootstrapsync.watch.BootstrapSyncRepositoryWatch; + + +/** + * @author molaschi + * @version $Id: $ + */ +public class BootstrapSyncModuleLifecycle implements ModuleLifecycle +{ + + /** + * Logger. + */ + private Logger log = LoggerFactory.getLogger(BootstrapSyncModuleLifecycle.class); + + private Map<String, AbstractBootstrapSyncListener> listeners = new HashMap<String, AbstractBootstrapSyncListener>(); + + /** + * {@inheritDoc} + */ + public void start(ModuleLifecycleContext moduleLifecycleContext) + { + // is develop? + boolean develop = SystemProperty.getBooleanProperty("magnolia.develop"); + // bootstrap sync enabled? + boolean bootstrapSync = SystemProperty.getBooleanProperty("magnolia.bootstrapSync"); + + if (develop && bootstrapSync) + { + // get all repositories on which activate bootstrap sync + String[] repositories = StringUtils.split( + SystemProperty.getProperty("magnolia.bootstrapSync.repositories"), + ","); + + // cycle + for (String repository : repositories) + { + // get synchronization property for each repository + + // get path to export to + String exportPath = SystemProperty.getProperty("magnolia.bootstrapSync." + repository + ".exportPath"); + + // get roots to export (node with all children) + String exportRoots = SystemProperty + .getProperty("magnolia.bootstrapSync." + repository + ".exportRoots"); + + // get roots from which to export (one file for each node (ordering problem)) + String enableRoots = SystemProperty + .getProperty("magnolia.bootstrapSync." + repository + ".enablePaths"); + + // get node type to export + String nodeType = SystemProperty + .getProperty("magnolia.bootstrapSync." + repository + ".nodeType"); + if (nodeType == null) + { + nodeType = ItemType.CONTENT.getSystemName(); + } + + // create watch + BootstrapSyncRepositoryWatch watch = new BootstrapSyncRepositoryWatch( + repository, + exportPath, + exportRoots, + enableRoots, + nodeType); + + // create listener + BootstrapSyncListener listener = new BootstrapSyncListener(watch); + + try + { + HierarchyManager hm = MgnlContext.getSystemContext().getHierarchyManager(repository); + + log.debug("Starting listener on repository {}", repository); + hm.getWorkspace().getObservationManager().addEventListener( + listener, + Event.NODE_ADDED + | Event.PROPERTY_CHANGED + | Event.PROPERTY_ADDED + | Event.PROPERTY_REMOVED + | Event.NODE_REMOVED, + "/", + true, + null, + null, + false); + + // store + listeners.put(watch.getRepository(), listener); + } + catch (RepositoryException ex) + { + log.error(ex.getMessage(), ex); + log.error("Stopping BootstrapSync Listeners"); + stop(moduleLifecycleContext); + break; + } + } + } + } + + /** + * {@inheritDoc} + */ + public void stop(ModuleLifecycleContext moduleLifecycleContext) + { + for (Map.Entry<String, AbstractBootstrapSyncListener> entry : listeners.entrySet()) + { + HierarchyManager hm = MgnlContext.getSystemContext().getHierarchyManager(entry.getKey()); + try + { + // stop listener + log.debug("Stopping listener on repository {}", entry.getKey()); + hm.getWorkspace().getObservationManager().removeEventListener(entry.getValue()); + } + catch (RepositoryException ex) + { + log.error(ex.getMessage(), ex); + } + } + } + +} Property changes on: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/lifecycle/BootstrapSyncModuleLifecycle.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/AbstractBootstrapSyncListener.java =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/AbstractBootstrapSyncListener.java (rev 0) +++ trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/AbstractBootstrapSyncListener.java 2008-04-29 12:53:22 UTC (rev 805) @@ -0,0 +1,427 @@ +package it.openutils.mgnlbootstrapsync.listener; + +import info.magnolia.cms.core.Content; +import info.magnolia.cms.core.HierarchyManager; +import info.magnolia.cms.core.Path; +import info.magnolia.cms.core.ie.DataTransporter; +import info.magnolia.cms.core.ie.filters.VersionFilter; +import info.magnolia.cms.security.AccessDeniedException; +import info.magnolia.cms.util.ContentUtil; +import info.magnolia.context.MgnlContext; +import it.openutils.mgnlbootstrapsync.BootstrapAtomicFilter; +import it.openutils.mgnlbootstrapsync.watch.BootstrapSyncRepositoryWatch; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Collection; +import java.util.Iterator; +import java.util.zip.DeflaterOutputStream; + +import javax.jcr.PathNotFoundException; +import javax.jcr.RepositoryException; +import javax.jcr.Session; +import javax.jcr.observation.EventIterator; +import javax.jcr.observation.EventListener; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.XMLReaderFactory; + +/** + * + * @author mmolaschi + * @version $Id: $ + */ +public abstract class AbstractBootstrapSyncListener implements EventListener +{ + + private static Logger log = LoggerFactory.getLogger(AbstractBootstrapSyncListener.class); + + private BootstrapSyncRepositoryWatch watch; + + private Object synchronizationObject = new Object(); + + /** + * + * @param watch watch for this listener + */ + public AbstractBootstrapSyncListener(BootstrapSyncRepositoryWatch watch) + { + this.watch = watch; + } + + + /** + * {@inheritDoc} + */ + public abstract void onEvent(EventIterator events); + + public BootstrapSyncRepositoryWatch getWatch() + { + return watch; + } + + public void setWatch(BootstrapSyncRepositoryWatch watch) + { + this.watch = watch; + } + + /** + * Change event on node + * @param nodePath path to node + */ + public void exportNode(String nodePath) + { + synchronized (synchronizationObject) + { + String path = nodePath; + + // get repository manager + HierarchyManager hm = MgnlContext.getSystemContext().getHierarchyManager(watch.getRepository()); + + // check if path can exported + boolean isEnablePath = this.watch.getEnableRoots().isEnable(path); + if (isEnablePath) + { + try + { + // check if it is a property + if (hm.isNodeData(path)) + { + // move to parent node + path = StringUtils.substringBeforeLast(path, "/"); + } + } + catch (AccessDeniedException e) + { + log.error(e.getMessage(), e); + return; + } + + Content exported = null; + + try + { + // get exported content + exported = getRightContent(hm.getContent(path), watch.getNodeType()); + if (exported == null) + { + return; + } + } + catch (RepositoryException e) + { + if (log.isDebugEnabled() && e instanceof PathNotFoundException) + { + log.debug("Path already deleted:" + path); + } + if (log.isErrorEnabled() && !(e instanceof PathNotFoundException)) + { + log.error("Error hierarchy manager for path " + path, e); + } + return; + } + + // get handle + String handle = exported.getHandle(); + + // check if path is under a "compressed" node + String pathToExport = this.watch.getExportRoots().getRootPath(handle); + + if (pathToExport == null) + { + // not "compressed" + exportFileIterative(hm, exported); + } + else + { + exportFile(hm, pathToExport, false); + } + } + } + } + + /** + * Remove event on node + * @param path path to node + */ + public void removeNode(String path) + { + // synchornization + synchronized (synchronizationObject) + { + // get hierarchy manager + HierarchyManager hm = MgnlContext.getSystemContext().getHierarchyManager(watch.getRepository()); + + // check if path can exported + boolean isEnablePath = this.watch.getEnableRoots().isEnable(path); + if (isEnablePath) + { + // check if path is under a "compressed" node + String pathToExport = this.watch.getExportRoots().getRootPath(path); + + if (pathToExport == null || pathToExport.equals(path)) + { + // remove every file that starts with path + cleanFileSystem(path); + + try + { + // get parent node + String parentHandle = StringUtils.substringBeforeLast(path, "/"); + String parentXmlName = watch.getRepository() + + StringUtils.replace(parentHandle, "/", ".") + + ".xml"; + if (parentHandle.length() == 0) + { + parentHandle = "/"; + } + + // check if path is under a "compressed" node + String pathParentToExport = this.watch.getExportRoots().getRootPath(parentHandle); + + if (pathParentToExport == null) + { + // xml reader for filtering 2 levels + BootstrapAtomicFilter xmlReader = new BootstrapAtomicFilter(XMLReaderFactory + .createXMLReader(org.apache.xerces.parsers.SAXParser.class.getName())); + + // export parent node + exportFile(parentXmlName, xmlReader, hm, parentHandle); + } + else + { + exportFile(hm, pathParentToExport, false); + } + } + catch (SAXException ex) + { + throw new RuntimeException(ex); + } + } + else + { + exportFile(hm, pathToExport, false); + } + } + } + } + + /** + * Go up in tree until the current node type equals passed item type + * @param c current node + * @param itemType item type to check + * @return right node or null if not found + * @throws RepositoryException repository exception + */ + @SuppressWarnings("unchecked") + private Content getRightContent(Content c, String itemType) throws RepositoryException + { + if (c.getItemType().getSystemName().equals(itemType)) + { + return c; + } + if (c.getChildren() != null) + { + Iterator it = c.getChildren().iterator(); + while(it.hasNext()) + { + return getRightContent((Content)it.next(), itemType); + } + } + return null; + } + + /** + * Export node and its subnodes + * @param hm hierarchy manager + * @param node node + */ + @SuppressWarnings("unchecked") + protected void exportFileIterative(HierarchyManager hm, Content node) + { + // write itself + exportFile(hm, node.getHandle(), true); + + // cycle on children + Collection<Content> children = node.getChildren(ContentUtil.EXCLUDE_META_DATA_CONTENT_FILTER); + if (children != null) + { + for (Content child : children) + { + exportFileIterative(hm, child); + } + } + } + + /** + * Export node to file + * @param hm hierarchy manager + * @param handle path to node + * @param singleNode export single node in file + */ + protected void exportFile(HierarchyManager hm, String handle, boolean singleNode) + { + try + { + if (singleNode) + { + String parentHandle = StringUtils.substringBeforeLast(handle, "/"); + String parentXmlName = watch.getRepository() + StringUtils.replace(parentHandle, "/", ".") + ".xml"; + if (parentHandle.length() == 0) + { + parentHandle = "/"; + } + + BootstrapAtomicFilter xmlReader = new BootstrapAtomicFilter(XMLReaderFactory + .createXMLReader(org.apache.xerces.parsers.SAXParser.class.getName())); + + exportFile(parentXmlName, xmlReader, hm, parentHandle); + } + String xmlName = watch.getRepository() + StringUtils.replace(handle, "/", ".") + ".xml"; + + XMLReader xmlReader = null; + + if (singleNode) + { + xmlReader = new BootstrapAtomicFilter(XMLReaderFactory + .createXMLReader(org.apache.xerces.parsers.SAXParser.class.getName())); + } + exportFile(xmlName, xmlReader, hm, handle); + } + catch (SAXException ex) + { + throw new RuntimeException(ex); + } + } + + /** + * + * @param fileName file name + * @param reader xml filter + * @param hm hierarchy manager + * @param handle path to node + */ + protected void exportFile(String fileName, XMLReader reader, HierarchyManager hm, String handle) + { + // create necessary parent directories + File folder = new File(Path.getAbsoluteFileSystemPath(watch.getExportPath())); + folder.mkdirs(); + + File xmlFile = new File(folder.getAbsoluteFile(), fileName); + FileOutputStream fos = null; + try + { + fos = new FileOutputStream(xmlFile); + } + catch (FileNotFoundException e) + { + log.error(e.getMessage(), e); + return; + } + + try + { + executeExport(fos, reader, hm.getWorkspace().getSession(), handle, watch.getRepository()); + } + catch (IOException e) + { + log.error(e.getMessage(), e); + } + finally + { + IOUtils.closeQuietly(fos); + } + } + + /** + * Clean files for node (path) + * @param path path to node + */ + protected void cleanFileSystem(String path) + { + + String baseName = watch.getRepository() + StringUtils.replace(path, "/", "."); + + // create necessary parent directories + File folder = new File(Path.getAbsoluteFileSystemPath(watch.getExportPath())); + + if (folder.exists()) + { + String[] files = folder.list(); + for (String file : files) + { + File f = new File(folder, file); + if (f.exists() && f.getName().startsWith(baseName)) + { + f.delete(); + log.debug("Removed File: " + f.getName()); + } + } + } + } + + /** + * Execute export + * @param baseOutputStream file output stream + * @param reader xml filter + * @param session jcr session + * @param basepath path to node + * @param repository repository + * @throws IOException exception writing file + */ + protected static void executeExport(OutputStream baseOutputStream, XMLReader reader, Session session, + String basepath, String repository) throws IOException + { + OutputStream outputStream = baseOutputStream; + + try + { + // use XMLSerializer and a SAXFilter in order to rewrite the + // file + + XMLReader xmlReader = reader; + if (reader == null) + { + xmlReader = new VersionFilter(XMLReaderFactory + .createXMLReader(org.apache.xerces.parsers.SAXParser.class.getName())); + } + else + { + xmlReader = new VersionFilter(reader); + } + + DataTransporter.parseAndFormat(outputStream, xmlReader, repository, basepath, session, false); + } + catch (IOException e) + { + throw new RuntimeException(e); + } + catch (SAXException e) + { + throw new RuntimeException(e); + } + catch (RepositoryException e) + { + throw new RuntimeException(e); + } + + // finish the stream properly if zip stream + // this is not done by the IOUtils + if (outputStream instanceof DeflaterOutputStream) + { + ((DeflaterOutputStream) outputStream).finish(); + } + + baseOutputStream.flush(); + IOUtils.closeQuietly(baseOutputStream); + } + +} Property changes on: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/AbstractBootstrapSyncListener.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java (rev 0) +++ trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java 2008-04-29 12:53:22 UTC (rev 805) @@ -0,0 +1,160 @@ +package it.openutils.mgnlbootstrapsync.listener; + +import it.openutils.mgnlbootstrapsync.watch.BootstrapSyncRepositoryWatch; + +import java.util.ArrayList; +import java.util.List; + +import javax.jcr.RepositoryException; +import javax.jcr.observation.Event; +import javax.jcr.observation.EventIterator; + +import org.apache.commons.lang.StringUtils; +import org.apache.jackrabbit.core.observation.EventImpl; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * @author luca boati mmolaschi + * @version $Id: $ + */ +public class BootstrapSyncListener extends AbstractBootstrapSyncListener +{ + + /** + * Store operation + * @author mmolaschi + * @version $Id: $ + */ + public class JcrOperation + { + + private String path; + + private boolean remove; + + /** + * @param path path of operation + * @param remove is a remove op? + */ + public JcrOperation(String path, boolean remove) + { + this.path = path; + this.remove = remove; + } + } + + private static Logger log = LoggerFactory.getLogger(BootstrapSyncListener.class); + + /** + * Configure listener on watch + * @param watch watch + */ + public BootstrapSyncListener(BootstrapSyncRepositoryWatch watch) + { + super(watch); + } + + /** + * {@inheritDoc} + */ + @Override + public void onEvent(EventIterator events) + { + List<JcrOperation> operations = new ArrayList<JcrOperation>(); + while (events.hasNext()) + { + // Event event + EventImpl event = (EventImpl) events.nextEvent(); + String eventPath = null; + try + { + eventPath = event.getPath(); + } + catch (RepositoryException ex) + { + log.error(ex.getMessage(), ex); + continue; + } + if (eventPath.startsWith("/jcr:")) + { + return; + } + + switch (event.getType()) + { + case Event.NODE_ADDED : + log.debug(eventPath + " added"); + break; + case Event.NODE_REMOVED : + log.debug(eventPath + " removed"); + break; + case Event.PROPERTY_ADDED : + log.debug(eventPath + " added"); + break; + case Event.PROPERTY_CHANGED : + log.debug(eventPath + " changed"); + break; + case Event.PROPERTY_REMOVED : + log.debug(eventPath + " removed"); + break; + default : + break; + } + + if (event.getType() == Event.NODE_REMOVED) + { + operations.add(new JcrOperation(eventPath, true)); + } + else + { + operations.add(new JcrOperation(eventPath, false)); + } + } + + // calculate minimum path and remove operation + String basePath = null; + JcrOperation remove = null; + for (JcrOperation operation : operations) + { + if (operation.remove) + { + remove = operation; + continue; + } + + int basePathSl = StringUtils.countMatches(basePath, "/"); + int pathSl = StringUtils.countMatches(operation.path, "/"); + + if (basePath == null || pathSl < basePathSl) + { + basePath = operation.path; + } + } + + if (remove != null) + { + if (log.isDebugEnabled()) + { + log.debug("Removed PATH: " + remove.path); + } + + removeNode(remove.path); + } + + if (basePath != null) + { + // remove metadata if present + basePath = StringUtils.substringBefore(basePath, "/MetaData"); + + if (log.isDebugEnabled()) + { + log.debug("Changed PATH: " + basePath); + } + + exportNode(basePath); + } + } + +} Property changes on: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/watch/BootstrapSyncRepositoryWatch.java =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/watch/BootstrapSyncRepositoryWatch.java (rev 0) +++ trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/watch/BootstrapSyncRepositoryWatch.java 2008-04-29 12:53:22 UTC (rev 805) @@ -0,0 +1,119 @@ +package it.openutils.mgnlbootstrapsync.watch; + +import it.openutils.mgnlbootstrapsync.BootstrapEnableRoot; +import it.openutils.mgnlbootstrapsync.BootstrapExportRoot; + +/** + * + * @author mmolaschi + * @version $Id: $ + */ +public class BootstrapSyncRepositoryWatch +{ + + private String repository; + + private String exportPath; + + private BootstrapExportRoot exportRoots; + + private BootstrapEnableRoot enableRoots; + + private String nodeType; + + /** + * + * @param repository repository to watch + * @param basePath base path for repository + * @param exportPath folder to export files to + * @param exportRoots comma separeted list of nodes (every modified to children will be exported as this node) + * @param enableRoots enabled branches for listener + */ + public BootstrapSyncRepositoryWatch(String repository, String exportPath, String exportRoots, String enableRoots, String nodeType) + { + this.repository = repository; + this.exportPath = exportPath; + this.exportRoots = new BootstrapExportRoot(exportRoots); + this.enableRoots = new BootstrapEnableRoot(enableRoots); + } + + public String getRepository() + { + return repository; + } + + public void setRepository(String repository) + { + this.repository = repository; + } + + public String getExportPath() + { + return exportPath; + } + + public void setExportPath(String exportPath) + { + this.exportPath = exportPath; + } + + + /** + * Returns the exportRoots. + * @return the exportRoots + */ + public BootstrapExportRoot getExportRoots() + { + return exportRoots; + } + + + /** + * Sets the exportRoots. + * @param exportRoots the exportRoots to set + */ + public void setExportRoots(BootstrapExportRoot exportRoots) + { + this.exportRoots = exportRoots; + } + + + /** + * Returns the enableRoots. + * @return the enableRoots + */ + public BootstrapEnableRoot getEnableRoots() + { + return enableRoots; + } + + + /** + * Sets the enableRoots. + * @param enableRoots the enableRoots to set + */ + public void setEnableRoots(BootstrapEnableRoot enableRoots) + { + this.enableRoots = enableRoots; + } + + + /** + * Returns the nodeType. + * @return the nodeType + */ + public String getNodeType() + { + return nodeType; + } + + + /** + * Sets the nodeType. + * @param nodeType the nodeType to set + */ + public void setNodeType(String nodeType) + { + this.nodeType = nodeType; + } +} Property changes on: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/watch/BootstrapSyncRepositoryWatch.java ___________________________________________________________________ Name: svn:eol-style + native Added: trunk/openutils-mgnlbootstrapsync/src/main/resources/META-INF/magnolia/bootstrapsync.xml =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/main/resources/META-INF/magnolia/bootstrapsync.xml (rev 0) +++ trunk/openutils-mgnlbootstrapsync/src/main/resources/META-INF/magnolia/bootstrapsync.xml 2008-04-29 12:53:22 UTC (rev 805) @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE module SYSTEM "module.dtd"> +<module> + <name>bootstrapsync</name> + <displayName>bootstrapsync</displayName> + <description>Bootstrap Synchronizer</description> + <class>it.openutils.mgnlbootstrapsync.lifecycle.BootstrapSyncModuleLifecycle</class> + <version>${project.version}</version> +</module> Property changes on: trunk/openutils-mgnlbootstrapsync/src/main/resources/META-INF/magnolia/bootstrapsync.xml ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-04-29 12:26:18
|
Revision: 803 http://openutils.svn.sourceforge.net/openutils/?rev=803&view=rev Author: fgiust Date: 2008-04-29 05:26:18 -0700 (Tue, 29 Apr 2008) Log Message: ----------- Added [modulename].update.disabled property in SimpleModuleVersionHandler Modified Paths: -------------- trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java trunk/openutils-mgnltasks/src/site/changes/changes.xml Modified: trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java =================================================================== --- trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java 2008-04-28 22:19:45 UTC (rev 802) +++ trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java 2008-04-29 12:26:18 UTC (rev 803) @@ -17,6 +17,7 @@ */ package it.openutils.mgnltasks; +import info.magnolia.cms.core.SystemProperty; import info.magnolia.module.DefaultModuleVersionHandler; import info.magnolia.module.InstallContext; import info.magnolia.module.delta.Delta; @@ -58,10 +59,17 @@ return super.getDeltas(ctx, from); } + String modulename = ctx.getCurrentModuleDefinition().getName(); + Version to = ctx.getCurrentModuleDefinition().getVersionDefinition(); List<Delta> deltas = new ArrayList<Delta>(); + if (SystemProperty.getBooleanProperty(modulename + ".update.disabled")) + { + return deltas; + } + if (!to.isEquivalent(from) || "${project.version}".equals(ObjectUtils.toString(from)) || "SNAPSHOT".equals(from.getClassifier())) @@ -69,7 +77,7 @@ log.info("Updating from version {}", from); Delta delta = DeltaBuilder.update(to, "Update to current version"); - delta.getTasks().add(new ModuleConfigBootstrapTask(ctx.getCurrentModuleDefinition().getName())); + delta.getTasks().add(new ModuleConfigBootstrapTask(modulename)); delta.getTasks().add(new UpdateModuleVersionTask()); deltas.add(delta); Modified: trunk/openutils-mgnltasks/src/site/changes/changes.xml =================================================================== --- trunk/openutils-mgnltasks/src/site/changes/changes.xml 2008-04-28 22:19:45 UTC (rev 802) +++ trunk/openutils-mgnltasks/src/site/changes/changes.xml 2008-04-29 12:26:18 UTC (rev 803) @@ -8,6 +8,10 @@ <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> </properties> <body> + <release version="3.5.2" date="in svn" description="in svn"> + <action type="add" dev="fgiust">Added [modulename].update.disabled property in SimpleModuleVersionHandler that + can be set to true in order to disable module configuration updates</action> + </release> <release version="3.5.1" date="2008-04-28" description="3.5.1"> <action type="add" dev="fgiust">Added UpdateModuleVersionTask.</action> <action type="add" dev="fgiust">Added SimpleModuleVersionHandler.</action> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-04-28 22:19:38
|
Revision: 802 http://openutils.svn.sourceforge.net/openutils/?rev=802&view=rev Author: fgiust Date: 2008-04-28 15:19:45 -0700 (Mon, 28 Apr 2008) Log Message: ----------- [maven-release-plugin] prepare for next development iteration Modified Paths: -------------- trunk/openutils-mgnltasks/pom.xml Modified: trunk/openutils-mgnltasks/pom.xml =================================================================== --- trunk/openutils-mgnltasks/pom.xml 2008-04-28 22:19:38 UTC (rev 801) +++ trunk/openutils-mgnltasks/pom.xml 2008-04-28 22:19:45 UTC (rev 802) @@ -10,7 +10,7 @@ <packaging>jar</packaging> <artifactId>openutils-mgnltasks</artifactId> <name>openutils-mgnltasks</name> - <version>3.5.1</version> + <version>3.5.2-SNAPSHOT</version> <description>A collection of useful magnolia update tasks that can be reused in custom modules</description> <licenses> <license> @@ -86,10 +86,4 @@ </snapshots> </repository> </repositories> - - <scm> - <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnltasks-3.5.1</connection> - <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnltasks-3.5.1</developerConnection> - <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnltasks-3.5.1</url> - </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-04-28 22:19:32
|
Revision: 801 http://openutils.svn.sourceforge.net/openutils/?rev=801&view=rev Author: fgiust Date: 2008-04-28 15:19:38 -0700 (Mon, 28 Apr 2008) Log Message: ----------- [maven-release-plugin] copy for tag openutils-mgnltasks-3.5.1 Added Paths: ----------- tags/openutils-mgnltasks-3.5.1/ tags/openutils-mgnltasks-3.5.1/pom.xml tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/UpdateModuleVersionTask.java tags/openutils-mgnltasks-3.5.1/src/site/changes/changes.xml tags/openutils-mgnltasks-3.5.1/src/site/site.xml Removed Paths: ------------- tags/openutils-mgnltasks-3.5.1/pom.xml tags/openutils-mgnltasks-3.5.1/src/site/changes/changes.xml tags/openutils-mgnltasks-3.5.1/src/site/site.xml Copied: tags/openutils-mgnltasks-3.5.1 (from rev 784, trunk/openutils-mgnltasks) Deleted: tags/openutils-mgnltasks-3.5.1/pom.xml =================================================================== --- trunk/openutils-mgnltasks/pom.xml 2008-04-27 20:42:00 UTC (rev 784) +++ tags/openutils-mgnltasks-3.5.1/pom.xml 2008-04-28 22:19:38 UTC (rev 801) @@ -1,90 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<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>net.sourceforge.openutils</groupId> - <artifactId>openutils</artifactId> - <version>8</version> - <relativePath>..</relativePath> - </parent> - <modelVersion>4.0.0</modelVersion> - <packaging>jar</packaging> - <artifactId>openutils-mgnltasks</artifactId> - <name>openutils-mgnltasks</name> - <version>3.5-SNAPSHOT</version> - <description>A collection of useful magnolia update tasks that can be reused in custom modules</description> - <licenses> - <license> - <name>GPLv3</name> - <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> - </license> - </licenses> - <build> - <resources> - <resource> - <filtering>false</filtering> - <directory>src/main/resources</directory> - <includes> - <include>**/*</include> - </includes> - </resource> - <resource> - <filtering>true</filtering> - <directory>src/main/resources</directory> - <includes> - <include>META-INF/magnolia/*</include> - </includes> - </resource> - </resources> - </build> - <dependencies> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-core</artifactId> - <version>3.5.4</version> - </dependency> - <dependency> - <groupId>info.magnolia</groupId> - <artifactId>magnolia-module-admininterface</artifactId> - <version>3.5.4</version> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.4</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>jsp-api</artifactId> - <version>2.0</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <classifier>jdk15</classifier> - <version>5.7</version> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - <repositories> - <repository> - <id>repository.magnolia.info</id> - <name>magnolia repository</name> - <url>http://repo.magnolia.info/m2</url> - <releases> - <enabled>true</enabled> - </releases> - <snapshots> - <enabled>false</enabled> - </snapshots> - </repository> - </repositories> -</project> Copied: tags/openutils-mgnltasks-3.5.1/pom.xml (from rev 800, trunk/openutils-mgnltasks/pom.xml) =================================================================== --- tags/openutils-mgnltasks-3.5.1/pom.xml (rev 0) +++ tags/openutils-mgnltasks-3.5.1/pom.xml 2008-04-28 22:19:38 UTC (rev 801) @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="UTF-8"?> +<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>net.sourceforge.openutils</groupId> + <artifactId>openutils</artifactId> + <version>8</version> + <relativePath>..</relativePath> + </parent> + <modelVersion>4.0.0</modelVersion> + <packaging>jar</packaging> + <artifactId>openutils-mgnltasks</artifactId> + <name>openutils-mgnltasks</name> + <version>3.5.1</version> + <description>A collection of useful magnolia update tasks that can be reused in custom modules</description> + <licenses> + <license> + <name>GPLv3</name> + <url>http://www.gnu.org/licenses/gpl-3.0.txt</url> + </license> + </licenses> + <build> + <resources> + <resource> + <filtering>false</filtering> + <directory>src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + <resource> + <filtering>true</filtering> + <directory>src/main/resources</directory> + <includes> + <include>META-INF/magnolia/*</include> + </includes> + </resource> + </resources> + </build> + <dependencies> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-core</artifactId> + <version>3.5.4</version> + </dependency> + <dependency> + <groupId>info.magnolia</groupId> + <artifactId>magnolia-module-admininterface</artifactId> + <version>3.5.4</version> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>2.4</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>jsp-api</artifactId> + <version>2.0</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <classifier>jdk15</classifier> + <version>5.7</version> + <scope>test</scope> + <exclusions> + <exclusion> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + </exclusion> + </exclusions> + </dependency> + </dependencies> + <repositories> + <repository> + <id>repository.magnolia.info</id> + <name>magnolia repository</name> + <url>http://repo.magnolia.info/m2</url> + <releases> + <enabled>true</enabled> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnltasks-3.5.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnltasks-3.5.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnltasks-3.5.1</url> + </scm> +</project> Copied: tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java (from rev 799, trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java) =================================================================== --- tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java (rev 0) +++ tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java 2008-04-28 22:19:38 UTC (rev 801) @@ -0,0 +1,85 @@ +/** + * Copyright Openmind http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package it.openutils.mgnltasks; + +import info.magnolia.module.DefaultModuleVersionHandler; +import info.magnolia.module.InstallContext; +import info.magnolia.module.delta.Delta; +import info.magnolia.module.delta.DeltaBuilder; +import info.magnolia.module.model.Version; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang.ObjectUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * A base module version handler that re-bootstrap its configuration each time the version number changes. Can be used + * as is or subclassed (usually overriding getStartupTasks() for configuration tweacks). + * @author fgiust + * @version $Id: $ + */ +public class SimpleModuleVersionHandler extends DefaultModuleVersionHandler +{ + + /** + * Logger. + */ + protected Logger log = LoggerFactory.getLogger(getClass()); + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + @Override + public List<Delta> getDeltas(InstallContext ctx, Version from) + { + if (from == null) + { + log.info("Actual version not set"); + return super.getDeltas(ctx, from); + } + + Version to = ctx.getCurrentModuleDefinition().getVersionDefinition(); + + List<Delta> deltas = new ArrayList<Delta>(); + + if (!to.isEquivalent(from) + || "${project.version}".equals(ObjectUtils.toString(from)) + || "SNAPSHOT".equals(from.getClassifier())) + { + log.info("Updating from version {}", from); + + Delta delta = DeltaBuilder.update(to, "Update to current version"); + delta.getTasks().add(new ModuleConfigBootstrapTask(ctx.getCurrentModuleDefinition().getName())); + delta.getTasks().add(new UpdateModuleVersionTask()); + + deltas.add(delta); + } + else + { + log.info("Version {} already installed, no update tasks to run", from); + } + + return deltas; + } + +} Copied: tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/UpdateModuleVersionTask.java (from rev 798, trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/UpdateModuleVersionTask.java) =================================================================== --- tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/UpdateModuleVersionTask.java (rev 0) +++ tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/UpdateModuleVersionTask.java 2008-04-28 22:19:38 UTC (rev 801) @@ -0,0 +1,63 @@ +/** + * Copyright Openmind http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package it.openutils.mgnltasks; + +import info.magnolia.cms.core.Content; +import info.magnolia.cms.core.HierarchyManager; +import info.magnolia.cms.core.ItemType; +import info.magnolia.cms.core.NodeData; +import info.magnolia.cms.util.NodeDataUtil; +import info.magnolia.module.InstallContext; +import info.magnolia.module.delta.AbstractRepositoryTask; +import info.magnolia.module.delta.TaskExecutionException; + +import javax.jcr.RepositoryException; + + +/** + * A task that updates the current version of a module stored in the config repository. + * @author fgiust + * @version $Id: $ + */ +public class UpdateModuleVersionTask extends AbstractRepositoryTask +{ + + public UpdateModuleVersionTask() + { + super("Version number", "Sets installed module version number"); + } + + /** + * {@inheritDoc} + */ + @Override + protected void doExecute(InstallContext ctx) throws RepositoryException, TaskExecutionException + { + // make sure we have the /modules node + if (!ctx.hasModulesNode()) + { + final HierarchyManager hm = ctx.getConfigHierarchyManager(); + hm.createContent("/", "modules", ItemType.CONTENT.getSystemName()); + } + + final Content moduleNode = ctx.getOrCreateCurrentModuleNode(); + final NodeData nodeData = NodeDataUtil.getOrCreate(moduleNode, "version"); + nodeData.setValue(ctx.getCurrentModuleDefinition().getVersionDefinition().toString()); + } + +} \ No newline at end of file Deleted: tags/openutils-mgnltasks-3.5.1/src/site/changes/changes.xml =================================================================== --- trunk/openutils-mgnltasks/src/site/changes/changes.xml 2008-04-27 20:42:00 UTC (rev 784) +++ tags/openutils-mgnltasks-3.5.1/src/site/changes/changes.xml 2008-04-28 22:19:38 UTC (rev 801) @@ -1,16 +0,0 @@ -<?xml version="1.0"?> -<!-- - "type" attribute can be: add, remove, update or fix. ---> -<document> - <properties> - <title>Changes</title> - <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> - </properties> - <body> - <release version="3.5" date="2008-04-27" description="first release"> - <action type="add" dev="fgiust">First public release. The version is labeled "3.5" in order to make clear which - version of magnolia is required.</action> - </release> - </body> -</document> \ No newline at end of file Copied: tags/openutils-mgnltasks-3.5.1/src/site/changes/changes.xml (from rev 798, trunk/openutils-mgnltasks/src/site/changes/changes.xml) =================================================================== --- tags/openutils-mgnltasks-3.5.1/src/site/changes/changes.xml (rev 0) +++ tags/openutils-mgnltasks-3.5.1/src/site/changes/changes.xml 2008-04-28 22:19:38 UTC (rev 801) @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<!-- + "type" attribute can be: add, remove, update or fix. +--> +<document> + <properties> + <title>Changes</title> + <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> + </properties> + <body> + <release version="3.5.1" date="2008-04-28" description="3.5.1"> + <action type="add" dev="fgiust">Added UpdateModuleVersionTask.</action> + <action type="add" dev="fgiust">Added SimpleModuleVersionHandler.</action> + </release> + <release version="3.5" date="2008-04-27" description="first release"> + <action type="add" dev="fgiust">First public release. The version is labeled "3.5" in order to make clear which + version of magnolia is required.</action> + </release> + </body> +</document> \ No newline at end of file Deleted: tags/openutils-mgnltasks-3.5.1/src/site/site.xml =================================================================== --- trunk/openutils-mgnltasks/src/site/site.xml 2008-04-27 20:42:00 UTC (rev 784) +++ tags/openutils-mgnltasks-3.5.1/src/site/site.xml 2008-04-28 22:19:38 UTC (rev 801) @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project name="Openutils mgnltasks"> - <publishDate position="navigation-bottom" format="yyyy-MM-dd" /> - <version position="navigation-bottom" /> - <bannerRight> - <name>Openutils</name> - <src>http://openutils.sourceforge.net/images/openutils-logo.png</src> - <href>http://openutils.sourceforge.net</href> - </bannerRight> - <bannerLeft> - <name>Sourceforge</name> - <src>http://sourceforge.net/sflogo.php?group_id=150467&amp;type=2</src> - <href>http://www.sourceforge.net/projects/openutils</href> - </bannerLeft> - <body> - <head> - <link rel="icon" href="images/favicon.ico" /> - </head> - <breadcrumbs> - <item name="openutils" href="http://openutils.sourceforge.net/" /> - <item name="openutils-mgnltasks" href="http://openutils.sourceforge.net/openutils-mgnltasks" /> - </breadcrumbs> - <menu name="openutils mgnltasks"> - <item name="Introduction" href="index.html"></item> - </menu> - <menu ref="modules" inherit="bottom" /> - <menu ref="reports" inherit="bottom" /> - </body> - <skin> - <groupId>net.sourceforge.openutils</groupId> - <artifactId>openutils-maven-skin</artifactId> - <version>1.0</version> - </skin> -</project> Copied: tags/openutils-mgnltasks-3.5.1/src/site/site.xml (from rev 794, trunk/openutils-mgnltasks/src/site/site.xml) =================================================================== --- tags/openutils-mgnltasks-3.5.1/src/site/site.xml (rev 0) +++ tags/openutils-mgnltasks-3.5.1/src/site/site.xml 2008-04-28 22:19:38 UTC (rev 801) @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="Openutils mgnltasks"> + <publishDate position="navigation-bottom" format="yyyy-MM-dd" /> + <version position="navigation-bottom" /> + <bannerRight> + <name>Openutils</name> + <src>http://openutils.sourceforge.net/images/openutils-logo.png</src> + <href>http://openutils.sourceforge.net</href> + </bannerRight> + <bannerLeft> + <name>Sourceforge</name> + <src>http://sourceforge.net/sflogo.php?group_id=150467&amp;type=2</src> + <href>http://www.sourceforge.net/projects/openutils</href> + </bannerLeft> + <body> + <head> + <link rel="icon" href="images/favicon.ico" /> + </head> + <breadcrumbs> + <item name="openutils" href="http://openutils.sourceforge.net/" /> + <item name="openutils-mgnltasks" href="http://openutils.sourceforge.net/openutils-mgnltasks" /> + </breadcrumbs> + <menu name="openutils mgnltasks"> + <item name="Introduction" href="index.html"></item> + </menu> + <menu ref="modules" inherit="bottom" /> + <menu ref="reports" inherit="bottom" /> + </body> + <skin> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-maven-skin</artifactId> + <version>1.1</version> + </skin> +</project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-04-28 22:19:16
|
Revision: 800 http://openutils.svn.sourceforge.net/openutils/?rev=800&view=rev Author: fgiust Date: 2008-04-28 15:19:21 -0700 (Mon, 28 Apr 2008) Log Message: ----------- [maven-release-plugin] prepare release openutils-mgnltasks-3.5.1 Modified Paths: -------------- trunk/openutils-mgnltasks/pom.xml Modified: trunk/openutils-mgnltasks/pom.xml =================================================================== --- trunk/openutils-mgnltasks/pom.xml 2008-04-28 22:18:55 UTC (rev 799) +++ trunk/openutils-mgnltasks/pom.xml 2008-04-28 22:19:21 UTC (rev 800) @@ -10,7 +10,7 @@ <packaging>jar</packaging> <artifactId>openutils-mgnltasks</artifactId> <name>openutils-mgnltasks</name> - <version>3.5.1-SNAPSHOT</version> + <version>3.5.1</version> <description>A collection of useful magnolia update tasks that can be reused in custom modules</description> <licenses> <license> @@ -86,4 +86,10 @@ </snapshots> </repository> </repositories> + + <scm> + <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnltasks-3.5.1</connection> + <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnltasks-3.5.1</developerConnection> + <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnltasks-3.5.1</url> + </scm> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-04-28 22:18:49
|
Revision: 799 http://openutils.svn.sourceforge.net/openutils/?rev=799&view=rev Author: fgiust Date: 2008-04-28 15:18:55 -0700 (Mon, 28 Apr 2008) Log Message: ----------- missing header Modified Paths: -------------- trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java Modified: trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java =================================================================== --- trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java 2008-04-28 22:17:55 UTC (rev 798) +++ trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java 2008-04-28 22:18:55 UTC (rev 799) @@ -1,3 +1,20 @@ +/** + * Copyright Openmind http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ package it.openutils.mgnltasks; import info.magnolia.module.DefaultModuleVersionHandler; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2008-04-28 22:17:51
|
Revision: 798 http://openutils.svn.sourceforge.net/openutils/?rev=798&view=rev Author: fgiust Date: 2008-04-28 15:17:55 -0700 (Mon, 28 Apr 2008) Log Message: ----------- changes for 3.5.1 Modified Paths: -------------- trunk/openutils-mgnltasks/src/site/changes/changes.xml Added Paths: ----------- trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/UpdateModuleVersionTask.java Added: trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java =================================================================== --- trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java (rev 0) +++ trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java 2008-04-28 22:17:55 UTC (rev 798) @@ -0,0 +1,68 @@ +package it.openutils.mgnltasks; + +import info.magnolia.module.DefaultModuleVersionHandler; +import info.magnolia.module.InstallContext; +import info.magnolia.module.delta.Delta; +import info.magnolia.module.delta.DeltaBuilder; +import info.magnolia.module.model.Version; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang.ObjectUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * A base module version handler that re-bootstrap its configuration each time the version number changes. Can be used + * as is or subclassed (usually overriding getStartupTasks() for configuration tweacks). + * @author fgiust + * @version $Id: $ + */ +public class SimpleModuleVersionHandler extends DefaultModuleVersionHandler +{ + + /** + * Logger. + */ + protected Logger log = LoggerFactory.getLogger(getClass()); + + /** + * {@inheritDoc} + */ + @SuppressWarnings("unchecked") + @Override + public List<Delta> getDeltas(InstallContext ctx, Version from) + { + if (from == null) + { + log.info("Actual version not set"); + return super.getDeltas(ctx, from); + } + + Version to = ctx.getCurrentModuleDefinition().getVersionDefinition(); + + List<Delta> deltas = new ArrayList<Delta>(); + + if (!to.isEquivalent(from) + || "${project.version}".equals(ObjectUtils.toString(from)) + || "SNAPSHOT".equals(from.getClassifier())) + { + log.info("Updating from version {}", from); + + Delta delta = DeltaBuilder.update(to, "Update to current version"); + delta.getTasks().add(new ModuleConfigBootstrapTask(ctx.getCurrentModuleDefinition().getName())); + delta.getTasks().add(new UpdateModuleVersionTask()); + + deltas.add(delta); + } + else + { + log.info("Version {} already installed, no update tasks to run", from); + } + + return deltas; + } + +} Property changes on: trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Added: trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/UpdateModuleVersionTask.java =================================================================== --- trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/UpdateModuleVersionTask.java (rev 0) +++ trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/UpdateModuleVersionTask.java 2008-04-28 22:17:55 UTC (rev 798) @@ -0,0 +1,63 @@ +/** + * Copyright Openmind http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package it.openutils.mgnltasks; + +import info.magnolia.cms.core.Content; +import info.magnolia.cms.core.HierarchyManager; +import info.magnolia.cms.core.ItemType; +import info.magnolia.cms.core.NodeData; +import info.magnolia.cms.util.NodeDataUtil; +import info.magnolia.module.InstallContext; +import info.magnolia.module.delta.AbstractRepositoryTask; +import info.magnolia.module.delta.TaskExecutionException; + +import javax.jcr.RepositoryException; + + +/** + * A task that updates the current version of a module stored in the config repository. + * @author fgiust + * @version $Id: $ + */ +public class UpdateModuleVersionTask extends AbstractRepositoryTask +{ + + public UpdateModuleVersionTask() + { + super("Version number", "Sets installed module version number"); + } + + /** + * {@inheritDoc} + */ + @Override + protected void doExecute(InstallContext ctx) throws RepositoryException, TaskExecutionException + { + // make sure we have the /modules node + if (!ctx.hasModulesNode()) + { + final HierarchyManager hm = ctx.getConfigHierarchyManager(); + hm.createContent("/", "modules", ItemType.CONTENT.getSystemName()); + } + + final Content moduleNode = ctx.getOrCreateCurrentModuleNode(); + final NodeData nodeData = NodeDataUtil.getOrCreate(moduleNode, "version"); + nodeData.setValue(ctx.getCurrentModuleDefinition().getVersionDefinition().toString()); + } + +} \ No newline at end of file Property changes on: trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/UpdateModuleVersionTask.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: trunk/openutils-mgnltasks/src/site/changes/changes.xml =================================================================== --- trunk/openutils-mgnltasks/src/site/changes/changes.xml 2008-04-27 21:45:51 UTC (rev 797) +++ trunk/openutils-mgnltasks/src/site/changes/changes.xml 2008-04-28 22:17:55 UTC (rev 798) @@ -8,6 +8,10 @@ <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author> </properties> <body> + <release version="3.5.1" date="2008-04-28" description="3.5.1"> + <action type="add" dev="fgiust">Added UpdateModuleVersionTask.</action> + <action type="add" dev="fgiust">Added SimpleModuleVersionHandler.</action> + </release> <release version="3.5" date="2008-04-27" description="first release"> <action type="add" dev="fgiust">First public release. The version is labeled "3.5" in order to make clear which version of magnolia is required.</action> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |