├── src ├── test │ ├── resources │ │ ├── exanpe │ │ │ └── t5 │ │ │ │ └── lib │ │ │ │ └── demo │ │ │ │ ├── pages │ │ │ │ ├── comp │ │ │ │ │ ├── LocaleSessionTest.properties │ │ │ │ │ ├── LocaleSessionTest_en.properties │ │ │ │ │ ├── LocaleSessionTest_fr_FR.properties │ │ │ │ │ ├── MenuTest.properties │ │ │ │ │ ├── AjaxLoaderTest.properties │ │ │ │ │ ├── RichTextEditorTest.properties │ │ │ │ │ ├── DialogTest.properties │ │ │ │ │ ├── AjaxValidationTest.properties │ │ │ │ │ ├── TabViewTest.properties │ │ │ │ │ ├── VerticalMenuTest.properties │ │ │ │ │ ├── TooltipTest.properties │ │ │ │ │ ├── AccordionTest.properties │ │ │ │ │ ├── GMapTest.properties │ │ │ │ │ ├── LocaleSessionTest.tml │ │ │ │ │ ├── ColorPickerTest.tml │ │ │ │ │ ├── ListSorterTest.tml │ │ │ │ │ ├── LoggerTest.tml │ │ │ │ │ ├── PasswordStrengthCheckerTest.tml │ │ │ │ │ ├── SandBoxTest.tml │ │ │ │ │ ├── BinaryImgTest.tml │ │ │ │ │ ├── AjaxValidationTest.tml │ │ │ │ │ ├── BorderTest.tml │ │ │ │ │ ├── SelectLoaderTest.tml │ │ │ │ │ ├── AuthorizeAnnotationTest.tml │ │ │ │ │ ├── SecurePasswordTest.tml │ │ │ │ │ ├── VerticalMenuTest.tml │ │ │ │ │ ├── ContextPageResetTest.tml │ │ │ │ │ ├── TooltipTest.tml │ │ │ │ │ ├── ResizableTest.tml │ │ │ │ │ ├── PasswordStrengthCheckerTest.js │ │ │ │ │ ├── TabViewTest.tml │ │ │ │ │ ├── SliderTest.tml │ │ │ │ │ ├── AjaxLoaderTest.tml │ │ │ │ │ ├── HideablePanelTest.tml │ │ │ │ │ ├── SlideShowTest.tml │ │ │ │ │ ├── RichTextEditorTest.tml │ │ │ │ │ ├── TapestrySkin.tml │ │ │ │ │ ├── AuthorizeMixinTest.tml │ │ │ │ │ ├── AuthorizeTest.tml │ │ │ │ │ ├── GMapTest.tml │ │ │ │ │ ├── DialogTest.tml │ │ │ │ │ └── MenuTest.tml │ │ │ │ ├── security │ │ │ │ │ ├── AdminOnly.tml │ │ │ │ │ └── UserOnly.tml │ │ │ │ └── Index.tml │ │ │ │ ├── components │ │ │ │ ├── TooltipWrapper.properties │ │ │ │ ├── TooltipWrapper.tml │ │ │ │ └── Layout.tml │ │ │ │ └── img │ │ │ │ └── images.jpg │ │ ├── log4j.properties │ │ └── applicationContext-security.xml │ ├── webapp │ │ ├── img │ │ │ ├── rte │ │ │ │ └── help.gif │ │ │ ├── sc │ │ │ │ ├── astro1.jpg │ │ │ │ ├── astro2.jpg │ │ │ │ └── astro3.jpg │ │ │ ├── tab │ │ │ │ ├── email.png │ │ │ │ ├── comments.png │ │ │ │ └── application.png │ │ │ ├── gmap │ │ │ │ ├── metro.png │ │ │ │ └── tour-eiffel.png │ │ │ └── spwd │ │ │ │ └── reset.png │ │ └── WEB-INF │ │ │ └── web.xml │ ├── conf │ │ └── testng.xml │ └── java │ │ └── exanpe │ │ └── t5 │ │ └── lib │ │ └── demo │ │ ├── components │ │ ├── TooltipWrapper.java │ │ └── Layout.java │ │ ├── pages │ │ ├── comp │ │ │ ├── AccordionTest.java │ │ │ ├── ResizableTest.java │ │ │ ├── MenuTest.java │ │ │ ├── TabViewTest.java │ │ │ ├── GMapTest.java │ │ │ ├── TooltipTest.java │ │ │ ├── BorderTest.java │ │ │ ├── SlideShowTest.java │ │ │ ├── HideablePanelTest.java │ │ │ ├── ColorPickerTest.java │ │ │ ├── LocaleSessionTest.java │ │ │ ├── DialogTest.java │ │ │ ├── SecurePasswordTest.java │ │ │ ├── ListSorterTest.java │ │ │ ├── RichTextEditorTest.java │ │ │ ├── ContextPageResetTest.java │ │ │ ├── VerticalMenuTest.java │ │ │ ├── SliderTest.java │ │ │ ├── AjaxValidationTest.java │ │ │ ├── AjaxLoaderTest.java │ │ │ ├── AuthorizeMixinTest.java │ │ │ ├── AuthorizeTest.java │ │ │ ├── LoggerTest.java │ │ │ ├── PasswordStrengthCheckerTest.java │ │ │ ├── SelectLoaderTest.java │ │ │ └── AuthorizeAnnotationTest.java │ │ ├── bug │ │ │ └── AccordionBugTest.java │ │ ├── security │ │ │ ├── AdminOnly.java │ │ │ └── UserOnly.java │ │ └── Index.java │ │ ├── bean │ │ ├── City.java │ │ ├── Country.java │ │ ├── User.java │ │ └── AjaxFormLoopEngine.java │ │ ├── encoders │ │ └── CountryEncoder.java │ │ └── security │ │ └── SameUserPasswordAP.java ├── main │ ├── resources │ │ └── fr │ │ │ └── exanpe │ │ │ └── t5 │ │ │ └── lib │ │ │ ├── components │ │ │ ├── AjaxLoader.properties │ │ │ ├── img │ │ │ │ ├── FFFFFF.png │ │ │ │ ├── acc │ │ │ │ │ ├── open.png │ │ │ │ │ ├── closed.png │ │ │ │ │ ├── accordion-header.png │ │ │ │ │ └── accordion-title.png │ │ │ │ ├── bor │ │ │ │ │ ├── top.png │ │ │ │ │ ├── bottom.png │ │ │ │ │ ├── topLeft.png │ │ │ │ │ ├── topRight.png │ │ │ │ │ ├── bottomLeft.png │ │ │ │ │ ├── bottomRight.png │ │ │ │ │ ├── middleLeft.png │ │ │ │ │ └── middleRight.png │ │ │ │ ├── hdp │ │ │ │ │ ├── hide.png │ │ │ │ │ └── show.png │ │ │ │ ├── rte │ │ │ │ │ ├── open.png │ │ │ │ │ ├── closed.png │ │ │ │ │ ├── editor-bg.png │ │ │ │ │ ├── blankimage.png │ │ │ │ │ ├── editor-knob.gif │ │ │ │ │ ├── editor-sprite.gif │ │ │ │ │ └── editor-sprite-active.gif │ │ │ │ ├── cpk │ │ │ │ │ ├── hue_bg.png │ │ │ │ │ ├── hue_thumb.png │ │ │ │ │ ├── color_wheel.png │ │ │ │ │ ├── picker_mask.png │ │ │ │ │ └── picker_thumb.png │ │ │ │ ├── slider │ │ │ │ │ ├── bg-h.gif │ │ │ │ │ ├── bg-v.gif │ │ │ │ │ ├── bg-v-e.gif │ │ │ │ │ ├── bg-fader.gif │ │ │ │ │ ├── thumb-e.gif │ │ │ │ │ └── thumb-n.gif │ │ │ │ ├── spwd │ │ │ │ │ ├── reset.png │ │ │ │ │ └── keyboard-case.png │ │ │ │ ├── t5 │ │ │ │ │ ├── deselect.png │ │ │ │ │ ├── grid-bg.png │ │ │ │ │ ├── select.png │ │ │ │ │ ├── sort-asc.png │ │ │ │ │ ├── sortable.png │ │ │ │ │ ├── sort-desc.png │ │ │ │ │ ├── ajax-loader.gif │ │ │ │ │ └── gridpager-bg.png │ │ │ │ ├── binimg │ │ │ │ │ └── error.png │ │ │ │ ├── menu │ │ │ │ │ ├── menu-title.png │ │ │ │ │ ├── menuitem-hassubmenu.png │ │ │ │ │ └── menubaritem-hassubmenu.png │ │ │ │ ├── vmenu │ │ │ │ │ ├── vmenu-title.png │ │ │ │ │ └── vmenuitem-link.png │ │ │ │ ├── common │ │ │ │ │ ├── exanpe-sprite.png │ │ │ │ │ ├── exanpe-gradient-bg.png │ │ │ │ │ └── exanpe-gradient-bg-hover.png │ │ │ │ ├── dialog │ │ │ │ │ ├── dialog-close.png │ │ │ │ │ └── dialog-hd-background.png │ │ │ │ └── ajaxloader │ │ │ │ │ └── ajax-loader.gif │ │ │ ├── SlideShow.tml │ │ │ ├── VerticalMenuItem.tml │ │ │ ├── Authorize.tml │ │ │ ├── Accordion.tml │ │ │ ├── BinaryImg.tml │ │ │ ├── SlideShowItem.tml │ │ │ ├── Menu.tml │ │ │ ├── SubMenu.tml │ │ │ ├── Tooltip.tml │ │ │ ├── MenuBar.tml │ │ │ ├── Tab.tml │ │ │ ├── GMap.tml │ │ │ ├── AccordionItem.tml │ │ │ ├── ColorPicker.tml │ │ │ ├── ListSorter.tml │ │ │ ├── MenuItem.tml │ │ │ ├── AjaxLoader.tml │ │ │ ├── HideablePanel.tml │ │ │ ├── Border.tml │ │ │ ├── Slider.tml │ │ │ ├── VerticalMenu.tml │ │ │ ├── SecurePassword.tml │ │ │ └── TabView.tml │ │ │ └── mixins │ │ │ ├── Dialog.properties │ │ │ ├── PasswordStrengthChecker.properties │ │ │ └── RichTextEditor.properties │ └── java │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ └── fr │ │ └── exanpe │ │ └── t5 │ │ └── lib │ │ ├── constants │ │ ├── MenuEventTypeEnum.java │ │ ├── AccordionEventTypeEnum.java │ │ ├── SecurePasswordEventTypeEnum.java │ │ ├── SliderOrientationTypeEnum.java │ │ ├── DialogRenderModeEnum.java │ │ ├── PasswordStrengthCheckerTypeEnum.java │ │ ├── AjaxValidationResult.java │ │ ├── GMapTypeEnum.java │ │ ├── ExanpeSymbols.java │ │ └── ExanpeEventConstants.java │ │ ├── components │ │ ├── SubMenu.java │ │ ├── Authorize.java │ │ ├── Border.java │ │ └── SlideShowItem.java │ │ ├── model │ │ ├── gmap │ │ │ ├── GMapPolyPointModel.java │ │ │ ├── GMapBaseModel.java │ │ │ └── GMapMarkerModel.java │ │ ├── SlideShowInternalModel.java │ │ ├── AccordionInternalModel.java │ │ ├── MenuInternalModel.java │ │ └── GMapInternalModel.java │ │ ├── internal │ │ ├── InputStreamResponse.java │ │ └── authorize │ │ │ └── AuthorizeWorker.java │ │ ├── mixins │ │ └── AuthorizeMixin.java │ │ ├── services │ │ ├── AuthorizeBusinessService.java │ │ ├── LocaleSessionService.java │ │ ├── impl │ │ │ ├── LocaleSessionServiceImpl.java │ │ │ └── AuthorizeBusinessServiceImpl.java │ │ └── ExanpeComponentService.java │ │ ├── annotation │ │ ├── ContextPageReset.java │ │ └── Authorize.java │ │ └── exception │ │ └── AuthorizeException.java ├── site │ ├── xdoc │ │ ├── download.xml │ │ ├── roadmap.xml │ │ ├── about.xml │ │ ├── migration.xml │ │ ├── getting_started.xml │ │ └── user_guide.xml │ └── site.xml └── changes │ └── changes.xml ├── .gitignore └── LICENSE.txt /src/test/resources/exanpe/t5/lib/demo/pages/comp/LocaleSessionTest.properties: -------------------------------------------------------------------------------- 1 | test=default -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/LocaleSessionTest_en.properties: -------------------------------------------------------------------------------- 1 | test=Hello -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/components/TooltipWrapper.properties: -------------------------------------------------------------------------------- 1 | msg-tooltip=Mon message -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/LocaleSessionTest_fr_FR.properties: -------------------------------------------------------------------------------- 1 | test=Bonjour -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/MenuTest.properties: -------------------------------------------------------------------------------- 1 | sub1key-label=From property 2 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/AjaxLoaderTest.properties: -------------------------------------------------------------------------------- 1 | loader2-msg=Chargement en cours... -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | test-output 2 | bin 3 | .classpath 4 | .project 5 | .settings 6 | target 7 | .metadata 8 | /.git 9 | -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/AjaxLoader.properties: -------------------------------------------------------------------------------- 1 | exanpe-ajaxloader-default-message=Loading... -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/RichTextEditorTest.properties: -------------------------------------------------------------------------------- 1 | bold=Gras 2 | justifyleft=Aligné à gauche -------------------------------------------------------------------------------- /src/test/webapp/img/rte/help.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/test/webapp/img/rte/help.gif -------------------------------------------------------------------------------- /src/test/webapp/img/sc/astro1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/test/webapp/img/sc/astro1.jpg -------------------------------------------------------------------------------- /src/test/webapp/img/sc/astro2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/test/webapp/img/sc/astro2.jpg -------------------------------------------------------------------------------- /src/test/webapp/img/sc/astro3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/test/webapp/img/sc/astro3.jpg -------------------------------------------------------------------------------- /src/test/webapp/img/tab/email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/test/webapp/img/tab/email.png -------------------------------------------------------------------------------- /src/test/webapp/img/gmap/metro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/test/webapp/img/gmap/metro.png -------------------------------------------------------------------------------- /src/test/webapp/img/spwd/reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/test/webapp/img/spwd/reset.png -------------------------------------------------------------------------------- /src/test/webapp/img/tab/comments.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/test/webapp/img/tab/comments.png -------------------------------------------------------------------------------- /src/test/webapp/img/gmap/tour-eiffel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/test/webapp/img/gmap/tour-eiffel.png -------------------------------------------------------------------------------- /src/test/webapp/img/tab/application.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/test/webapp/img/tab/application.png -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/DialogTest.properties: -------------------------------------------------------------------------------- 1 | link3-title=Titre properties 2 | link3-message=Message from properties -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/AjaxValidationTest.properties: -------------------------------------------------------------------------------- 1 | props-ajaxValidator-message=Message venant d'un fichier properties -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/TabViewTest.properties: -------------------------------------------------------------------------------- 1 | tab21-title=Title from resources 2 | tab21-icon=context:img/tab/comments.png -------------------------------------------------------------------------------- /src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | Tapestry-Module-Classes: fr.exanpe.t5.lib.services.ExanpeLibraryModule 4 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/img/images.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/test/resources/exanpe/t5/lib/demo/img/images.jpg -------------------------------------------------------------------------------- /src/test/conf/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/VerticalMenuTest.properties: -------------------------------------------------------------------------------- 1 | comments-title=Comments title from resources 2 | comments-icon=context:img/tab/comments.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/FFFFFF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/FFFFFF.png -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/TooltipTest.properties: -------------------------------------------------------------------------------- 1 | msg1=Tooltip content from properties 2 | tooltip3-tooltip=The tooltip content is consolidate
from id -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/acc/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/acc/open.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/bor/top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/bor/top.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/hdp/hide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/hdp/hide.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/hdp/show.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/hdp/show.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/rte/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/rte/open.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/acc/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/acc/closed.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/bor/bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/bor/bottom.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/bor/topLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/bor/topLeft.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/cpk/hue_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/cpk/hue_bg.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/rte/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/rte/closed.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/slider/bg-h.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/slider/bg-h.gif -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/slider/bg-v.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/slider/bg-v.gif -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/spwd/reset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/spwd/reset.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/t5/deselect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/t5/deselect.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/t5/grid-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/t5/grid-bg.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/t5/select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/t5/select.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/t5/sort-asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/t5/sort-asc.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/t5/sortable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/t5/sortable.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/binimg/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/binimg/error.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/bor/topRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/bor/topRight.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/cpk/hue_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/cpk/hue_thumb.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/rte/editor-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/rte/editor-bg.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/slider/bg-v-e.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/slider/bg-v-e.gif -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/t5/sort-desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/t5/sort-desc.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/bor/bottomLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/bor/bottomLeft.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/bor/bottomRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/bor/bottomRight.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/bor/middleLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/bor/middleLeft.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/bor/middleRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/bor/middleRight.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/cpk/color_wheel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/cpk/color_wheel.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/cpk/picker_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/cpk/picker_mask.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/cpk/picker_thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/cpk/picker_thumb.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/menu/menu-title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/menu/menu-title.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/rte/blankimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/rte/blankimage.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/rte/editor-knob.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/rte/editor-knob.gif -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/slider/bg-fader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/slider/bg-fader.gif -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/slider/thumb-e.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/slider/thumb-e.gif -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/slider/thumb-n.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/slider/thumb-n.gif -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/t5/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/t5/ajax-loader.gif -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/t5/gridpager-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/t5/gridpager-bg.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/rte/editor-sprite.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/rte/editor-sprite.gif -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/spwd/keyboard-case.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/spwd/keyboard-case.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/vmenu/vmenu-title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/vmenu/vmenu-title.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/acc/accordion-header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/acc/accordion-header.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/acc/accordion-title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/acc/accordion-title.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/common/exanpe-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/common/exanpe-sprite.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/dialog/dialog-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/dialog/dialog-close.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/vmenu/vmenuitem-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/vmenu/vmenuitem-link.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/ajaxloader/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/ajaxloader/ajax-loader.gif -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/common/exanpe-gradient-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/common/exanpe-gradient-bg.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/menu/menuitem-hassubmenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/menu/menuitem-hassubmenu.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/rte/editor-sprite-active.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/rte/editor-sprite-active.gif -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/dialog/dialog-hd-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/dialog/dialog-hd-background.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/menu/menubaritem-hassubmenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/menu/menubaritem-hassubmenu.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/img/common/exanpe-gradient-bg-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exanpe/exanpe-t5-lib/HEAD/src/main/resources/fr/exanpe/t5/lib/components/img/common/exanpe-gradient-bg-hover.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/SlideShow.tml: -------------------------------------------------------------------------------- 1 | 2 | 3 |
    4 | 5 |
6 | 7 |
-------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/AccordionTest.properties: -------------------------------------------------------------------------------- 1 | accitem1-title = Titre 1 2 | accitem1-content = Here is the content. Lorem ipsum 3 | 4 | accitem2-title = Titre 2 5 | accitem2-content = Here is the content 2. Lorem ipsum 6 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/security/AdminOnly.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | Hello admin 5 | 6 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/security/UserOnly.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | Hello user 5 | 6 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/GMapTest.properties: -------------------------------------------------------------------------------- 1 | tour-eiffel-info=

Tour Eiffel

Parc du Champ de Mars
5 Avenue Anatole France 75007 Paris 2 | la-duree-title=La Durée 3 | metro-title=Metro Champs-Élysées 4 | metro-icon=context:img/gmap/metro.png -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/mixins/Dialog.properties: -------------------------------------------------------------------------------- 1 | exanpe-dialog-default-message=Do you want to continue? 2 | exanpe-dialog-default-title=Are you sure? 3 | exanpe-dialog-yes-button-label=Yes 4 | exanpe-dialog-no-button-label=No 5 | exanpe-dialog-ok-button-label=Ok 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/VerticalMenuItem.tml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/components/TooltipWrapper.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Message 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/Authorize.tml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/LocaleSessionTest.tml: -------------------------------------------------------------------------------- 1 | 2 | fr 3 |
4 | en 5 |
6 | ${message:test} 7 |
8 | -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/Accordion.tml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/BinaryImg.tml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/mixins/PasswordStrengthChecker.properties: -------------------------------------------------------------------------------- 1 | exanpe-password-strength-checker-disclaimer-label=Password Strength 2 | exanpe-password-strength-checker-veryweak-label=Too Weak 3 | exanpe-password-strength-checker-weak-label=Weak 4 | exanpe-password-strength-checker-strong-label=Strong 5 | exanpe-password-strength-checker-strongest-label=Very Strong -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/SlideShowItem.tml: -------------------------------------------------------------------------------- 1 | 2 | 3 |
  • 4 | 5 | 6 | 7 | 8 | 9 | 10 |
  • 11 | 12 |
    -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/Menu.tml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
    7 |
    8 |
      9 | 10 |
    11 |
    12 |
    13 | 14 |
    -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/ColorPickerTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | ColorPicker :
    7 | 8 | 9 | ColorPicker from resources :
    10 | 11 | 12 | 13 |
    14 | 15 |
    -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/SubMenu.tml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
    7 |
    8 |
      9 | 10 |
    11 |
    12 |
    13 | 14 |
    -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/ListSorterTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | List : 6 | 7 | ${element} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/LoggerTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/Tooltip.tml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 |
    11 | 12 | 13 | 14 |
    15 | 16 |
    17 | -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/MenuBar.tml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
    7 |
    8 |
      9 | 10 | 11 | 12 |
    13 |
    14 |
    15 | 16 |
    -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/Tab.tml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
    6 | 7 |
    8 | 9 |
    10 | 11 | 12 | 13 |
    14 |
    15 | 16 |
    17 | 18 | 19 | 20 |
    -------------------------------------------------------------------------------- /src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootCategory=INFO, A1 2 | 3 | # A1 is set to be a ConsoleAppender. 4 | log4j.appender.A1=org.apache.log4j.ConsoleAppender 5 | 6 | # A1 uses PatternLayout. 7 | log4j.appender.A1.layout=org.apache.log4j.PatternLayout 8 | log4j.appender.A1.layout.ConversionPattern=[%p] %c{1} %m%n 9 | 10 | # Service category names are the name of the defining module class 11 | # and then the service id. 12 | log4j.category.exanpe.t5.lib.demo.services.AppModule.TimingFilter=error 13 | 14 | # Exanpe modules 15 | log4j.category.fr.exanpe.t5.lib=DEBUG 16 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/components/Layout.tml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exanpe T5 Library Test App: ${title} 4 | 5 | 6 | 7 | 8 |

    ${title}

    9 | 10 | 11 | 12 |
    13 | 14 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2011 EXANPE 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/GMap.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 |
    5 |
    6 | 7 | 8 |
      9 | 10 | 11 |
    • 12 | ${current.title} 13 |
    • 14 |
      15 |
    16 |
    17 |
    18 |
    19 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/PasswordStrengthCheckerTest.tml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 |
    9 | 10 | 11 |
    12 | 13 |
    14 | 15 |
    -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/AccordionItem.tml: -------------------------------------------------------------------------------- 1 | 2 | 3 |
  • 4 | 5 | 6 | ${title} 7 | 8 | 9 |
    10 |
    11 | 12 | ${content} 13 | 14 | 15 | 16 | 17 | 18 | 19 |
    20 |
    21 |
  • 22 | 23 |
    -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/ColorPicker.tml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # 5 | 6 | 7 | 8 |
    9 |
    10 |
    11 |
    12 | 13 |
    -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/SandBoxTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 |
    9 |
    10 |
    11 | remove 12 |
    13 | 14 |
    15 | 16 | 17 |
    18 | 19 |
    -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/BinaryImgTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | From file : 5 | 6 | 7 |


    8 | 9 | From byte array : 10 | 11 | 12 |


    13 | 14 | Error : 15 | 16 | 17 |


    18 |
    -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/ListSorter.tml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 |
      8 | 9 | 10 |
    • 11 | 12 |
    • 13 | 14 |
      15 | 16 |
    17 | 18 | 19 |
    -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/MenuItem.tml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 |
  • 8 | ${label } 9 | 10 |
  • 11 |
    12 | 13 | 14 | 15 |
  • 16 | ${label } 17 | 18 |
  • 19 |
    20 | 21 | 22 | 23 |
    -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/AjaxValidationTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Admin validate on blur !
    7 | 8 | 9 | 10 | 11 |
    12 | 13 |
    -------------------------------------------------------------------------------- /src/site/xdoc/download.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Download - Exanpe T5 Lib 8 | Exanpe 9 | 10 | 11 | 12 | 13 |
    14 |

    15 | The library doesn't require any download. Just add it to your pom and the magic occurs :)
    16 | Have a look at the Getting Started page 17 |

    18 |
    19 | 20 | 21 | 22 |
    -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/BorderTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 |
    5 | 6 | This text is contained in a border ! a a a a a a a a a 7 | a a a a a a a a a

    8 | a a a 9 | a a a 10 | a a a 11 | 12 |
    13 |
    14 | 15 |


    16 | Informal parameters 17 | 18 | 19 | This text is contained in a border ! a a a a a a a a a 20 | a a a a a a a a a

    21 | a a a 22 | a a a 23 | a a a 24 | 25 |
    26 |



    27 | 28 |
    -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/SelectLoaderTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 16 | 17 |
    18 |
    19 | 20 |
    -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/mixins/RichTextEditor.properties: -------------------------------------------------------------------------------- 1 | exanpe-rte-toolbar-buttons=bold,italic,underline,justifyleft,justifycenter,justifyright,createlink,insertimage,undo,redo,insertunorderedlist,insertorderedlist,heading,none,h1,h2,h3,h4,h5,h6,forecolor,backcolor 2 | bold=Bold 3 | italic=Italic 4 | underline=Underline 5 | justifyleft=Align Left 6 | justifycenter=Align Center 7 | justifyright=Align Right 8 | createlink=HTML Link 9 | insertimage=Insert Image 10 | undo=Undo 11 | redo=Redo 12 | insertunorderedlist=Create an Unordered List 13 | insertorderedlist=Create an Ordered List 14 | heading=Paragraph 15 | none=Normal 16 | h1=Header 1 17 | h2=Header 2 18 | h3=Header 3 19 | h4=Header 4 20 | h5=Header 5 21 | h6=Header 6 22 | forecolor=Font Color 23 | backcolor=Background Color -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/AuthorizeAnnotationTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | Switch to ROLE_USER only

    5 | 6 | Switch to ROLE_ADMIN only

    7 | 8 | Click this link to trigger a server action according to your role
    9 | Last triggered : ${roleInvoked } 10 | 11 |

    12 | This page can only be accessed by admin 13 | 14 |

    15 | This page can only be accessed by user 16 | 17 |
    -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/components/TooltipWrapper.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.components; 18 | 19 | public class TooltipWrapper 20 | { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/AccordionTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | 20 | public class AccordionTest { 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/ResizableTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | 20 | public class ResizableTest 21 | { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/constants/MenuEventTypeEnum.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.constants; 18 | 19 | public enum MenuEventTypeEnum{ 20 | CLICK, 21 | HOVER; 22 | } -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/MenuTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | public class MenuTest 20 | { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/constants/AccordionEventTypeEnum.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.constants; 18 | 19 | public enum AccordionEventTypeEnum{ 20 | CLICK, 21 | HOVER; 22 | } -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/bug/AccordionBugTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.bug; 18 | 19 | public class AccordionBugTest 20 | { 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/SecurePasswordTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | Secure Password on click, value persisting :
    7 | 8 | 9 |



    10 | 11 | Secure Password on hover + maxlength :
    12 | 13 | 14 |



    15 | 16 | Secure Password with other icon :
    17 | 18 | 19 |



    20 | 21 | 22 | 23 |
    24 | 25 |
    -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/constants/SecurePasswordEventTypeEnum.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.constants; 18 | 19 | public enum SecurePasswordEventTypeEnum{ 20 | CLICK, 21 | HOVER; 22 | } -------------------------------------------------------------------------------- /src/site/xdoc/roadmap.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Roadmap - Exanpe T5 Lib 8 | Exanpe 9 | 10 | 11 | 12 | 13 |
    14 | 15 |

    16 | The library is designed to help the use of Tapestry 5 as much as possible.
    17 | Feel free to suggest any idea, improvement, or to report any problem in our GitHub space! 18 |

    19 | 20 |
    21 | 22 | 23 | 24 |
    25 | 26 | 27 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/VerticalMenuTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 |
      7 |
    • VerticalMenu Test
    • 8 |
    • Retour index
    • 9 |
    10 |
    11 | 12 | This is the second menu item 13 |
    with long content 14 |
    15 | 16 |
    17 | 18 |
    19 | -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/AjaxLoader.tml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 |
    9 |
    10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
    -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/TabViewTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | 20 | public class TabViewTest { 21 | 22 | public void onAction(){ 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/HideablePanel.tml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 |
    11 | 12 |
    13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
    -------------------------------------------------------------------------------- /src/site/xdoc/about.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | About us - Exanpe T5 Lib 8 | Exanpe 9 | 10 | 11 | 12 | 13 |
    14 | 15 |

    16 | Exanpe is a French team eager to discover new frameworks and technologies related to Java EE.
    17 | We are trying to help people, speed up and ease their development during our spare time. 18 | 19 |

    20 | Feel free to report any mistake we could have made, we enjoy learning too ;). 21 |

    22 |
    23 | 24 | 25 | 26 |
    -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/ContextPageResetTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Enter a value : 6 | 7 | 8 | 9 | Result :
    10 | ${value} 11 |

    12 | Real context :
    13 | ${realContext} 14 | 15 |
      16 |
    • Refresh page
    • 17 |
    • Refresh page with a real context
    • 18 |
    • Refresh page and reset
    • 19 |
    • Refresh page and reset with a real context
    • 20 |
    21 |
    -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/TooltipTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 |
    5 | Tooltip on div element, content from block... 6 |
    7 |
    8 | 9 |

    10 | Tooltip on p element, content from message... 11 |

    12 |
    13 | 14 | 15 |

    16 | 17 |

    18 |
    19 | 20 | 21 | The content of my Tooltip is rich... 22 |
    23 |
    24 | 25 | 26 | 27 |
    -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/Border.tml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 |
    7 |
    8 |
    9 |   10 |
    11 |
    12 |
    13 | 14 |
    15 |
    16 |
    17 | 18 |
    19 |
    20 |
    21 | 22 |
    23 |
    24 |
    25 |   26 |
    27 |
    28 |
    29 | 30 |
    -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/security/AdminOnly.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.security; 18 | 19 | import fr.exanpe.t5.lib.annotation.Authorize; 20 | 21 | @Authorize(all = "ROLE_ADMIN") 22 | public class AdminOnly 23 | { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/security/UserOnly.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.security; 18 | 19 | import fr.exanpe.t5.lib.annotation.Authorize; 20 | 21 | @Authorize(all = "ROLE_USER") 22 | public class UserOnly 23 | { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/GMapTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import fr.exanpe.t5.lib.components.GMap; 20 | 21 | /** 22 | * The demo page for {@link GMap} component 23 | * 24 | * @author lguerin 25 | */ 26 | public class GMapTest 27 | { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/Slider.tml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
    7 |
    8 | 9 | 0 10 | 11 |
    12 |
    14 | 15 |
    16 |
    17 |
    18 |
    19 | 20 |
    21 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/TooltipTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import fr.exanpe.t5.lib.components.Tooltip; 20 | 21 | /** 22 | * The demo page for {@link Tooltip} component 23 | * 24 | * @author lguerin 25 | */ 26 | public class TooltipTest 27 | { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/VerticalMenu.tml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 |
    7 | 8 |
    9 | 10 | 26 | 27 |
    -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/components/SubMenu.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.components; 18 | 19 | /** 20 | * Component allowing to group some {@link MenuItem} into a sub menu level. 21 | * 22 | * @see MenuItem 23 | * @author jmaupoux 24 | */ 25 | public class SubMenu 26 | { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/model/gmap/GMapPolyPointModel.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.model.gmap; 18 | 19 | /** 20 | * Model class for Google Map Polyline Point. 21 | * 22 | * @author lguerin 23 | * @since 1.2 24 | */ 25 | public class GMapPolyPointModel extends GMapBaseModel 26 | { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/BorderTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | /** 18 | * 19 | */ 20 | package exanpe.t5.lib.demo.pages.comp; 21 | 22 | import fr.exanpe.t5.lib.components.Border; 23 | 24 | /** 25 | * The demo page for the {@link Border} component. 26 | * 27 | * @author jmaupoux 28 | */ 29 | public class BorderTest{ 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/SlideShowTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | /** 18 | * 19 | */ 20 | package exanpe.t5.lib.demo.pages.comp; 21 | 22 | import fr.exanpe.t5.lib.components.HideablePanel; 23 | 24 | /** 25 | * The demo page for the {@link HideablePanel} component. 26 | * 27 | * @author jmaupoux 28 | */ 29 | public class SlideShowTest{ 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/HideablePanelTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | /** 18 | * 19 | */ 20 | package exanpe.t5.lib.demo.pages.comp; 21 | 22 | import fr.exanpe.t5.lib.components.HideablePanel; 23 | 24 | /** 25 | * The demo page for the {@link HideablePanel} component. 26 | * 27 | * @author jmaupoux 28 | */ 29 | public class HideablePanelTest{ 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/ResizableTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 11 | 12 |
    13 | HELLO HELLO HELLO HELLO HELLO HELLO HELLO HELLO HELLO HELLO HELLO HELLO 14 | HELLO HELLO HELLO HELLO HELLO HELLO HELLO HELLO HELLO vvvvHELLO HELLO 15 | HELLO 16 |
    17 | 18 |
    19 | HELLO HELLO HELLO HELLO HELLO HELLO HELLO HELLO HELLO HELLO HELLO HELLO 20 | HELLO HELLO HELLO HELLO HELLO HELLO HELLO HELLO HELLO vvvvHELLO HELLO 21 | HELLO 22 |
    23 | 26 | 27 |
    28 | -------------------------------------------------------------------------------- /src/test/resources/applicationContext-security.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/constants/SliderOrientationTypeEnum.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | /** 18 | * 19 | */ 20 | package fr.exanpe.t5.lib.constants; 21 | 22 | import fr.exanpe.t5.lib.components.Slider; 23 | 24 | /** 25 | * The {@link Slider} component orientation.
    26 | * 27 | * @author lguerin 28 | */ 29 | public enum SliderOrientationTypeEnum 30 | { 31 | HORIZONTAL, VERTICAL; 32 | 33 | public String toString() 34 | { 35 | return super.toString().toLowerCase(); 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/constants/DialogRenderModeEnum.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | /** 18 | * 19 | */ 20 | package fr.exanpe.t5.lib.constants; 21 | 22 | /** 23 | * Dialog render mode : 24 | * - CONFIRM : Confirm box with Yes/No buttons 25 | * - INFO : Info box: stop the current event 26 | * 27 | * @author lguerin 28 | */ 29 | public enum DialogRenderModeEnum 30 | { 31 | CONFIRM, INFO; 32 | 33 | public String toString() 34 | { 35 | return super.toString().toLowerCase(); 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/PasswordStrengthCheckerTest.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 EXANPE 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | function dummyChecker(password) { 18 | var strength = ""; 19 | if (password.length == 1) 20 | { 21 | strength = "veryweak"; 22 | } 23 | if (password.length == 2) 24 | { 25 | strength = "weak"; 26 | } 27 | if (password.length == 3) 28 | { 29 | strength = "strong"; 30 | } 31 | if (password.length > 3) 32 | { 33 | strength = "strongest"; 34 | } 35 | return strength; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/SecurePassword.tml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 |
    7 | 8 | 9 | 10 | 11 | 12 | 13 | 21 | 22 | 23 | 24 | 25 | 26 |
    14 | 15 |   16 | 17 | ${caseValue} 18 | 19 | 20 |
    27 |
    28 | 29 | 30 | 31 | 32 |
    -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/TabViewTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | This is my tab 1
    1
    1


    7 | content 11 8 |
    9 | 10 | This is my tab 2
    2
    2


    11 | content22 12 |
    13 | 14 | This is my tab 3
    2
    2


    15 | content23 16 |
    17 |
    18 | 19 | 20 | 21 | 22 | This is my tab 1
    1
    1


    23 | content 11 24 |
    25 | 26 | This is my tab 2
    2
    2


    27 | content22 28 |
    29 |
    30 | 31 |
    -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/SliderTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | slider1 value: ${sliderValue} 6 |
    7 | 8 |
    9 |

    10 | 11 | slider2 value: ${sliderValue2}
    12 | Display Id temps reel : 13 |
    14 | 15 |
    16 |

    17 | 18 | 19 | slider3 value: ${sliderValue3} 20 | 21 | 22 |
    23 | 24 |
    25 |

    26 | 27 | slider4 value: ${sliderValue4} 28 |
    29 | 30 |
    31 |

    32 | 33 | 34 |
    35 | 36 |
    -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/AjaxLoaderTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 |

    There are no users to display.

    8 |
    9 |
    10 |
    11 | 12 |
    13 | 14 | 15 | 16 |

    There are no users to display.

    17 |
    18 |
    19 |
    20 | 21 | 22 | 23 | ${date} 24 | 25 | 26 | 33 | 34 |
    35 | 36 | 37 | 38 |
    -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/model/SlideShowInternalModel.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.model; 18 | 19 | import fr.exanpe.t5.lib.components.SlideShow; 20 | import fr.exanpe.t5.lib.components.SlideShowItem; 21 | 22 | /** 23 | * Internal model to pass value from SlideShow to its items. 24 | * 25 | * @see SlideShow 26 | * @see SlideShowItem 27 | * @author jmaupoux 28 | */ 29 | public class SlideShowInternalModel 30 | { 31 | 32 | private int height; 33 | 34 | public int getHeight() 35 | { 36 | return height; 37 | } 38 | 39 | public void setHeight(int height) 40 | { 41 | this.height = height; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/internal/InputStreamResponse.java: -------------------------------------------------------------------------------- 1 | package fr.exanpe.t5.lib.internal; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | 6 | import org.apache.tapestry5.StreamResponse; 7 | import org.apache.tapestry5.services.Response; 8 | 9 | import fr.exanpe.t5.lib.components.BinaryImg; 10 | 11 | /** 12 | * Specific response to handle a stream 13 | * 14 | * @see BinaryImg 15 | * @author jmaupoux 16 | */ 17 | public class InputStreamResponse implements StreamResponse 18 | { 19 | /** 20 | * The stream to return 21 | */ 22 | private final InputStream inputStream; 23 | 24 | /** 25 | * The content type to return 26 | */ 27 | private final String contentType; 28 | 29 | public InputStreamResponse(InputStream inputStream, String contentType) 30 | { 31 | this.inputStream = inputStream; 32 | this.contentType = contentType; 33 | } 34 | 35 | public String getContentType() 36 | { 37 | return contentType; 38 | } 39 | 40 | public InputStream getStream() throws IOException 41 | { 42 | return inputStream; 43 | } 44 | 45 | public void prepareResponse(Response arg0) 46 | { 47 | arg0.setHeader("Cache-Control", "no-cache"); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/HideablePanelTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | Classic :
    5 | 6 | 7 | hideeeeeeeeeee hideeeeeeeeeee hide


    this 8 |
    9 | 10 | show 11 | 12 |
    13 | 14 |


    15 | Fast duration :
    16 | 17 | 18 | 19 | hideeeeeeeeeee hideeeeeeeeeee hide


    this 20 |
    21 | 22 | show 23 | 24 |
    25 | 26 | 36 | 37 |
    38 | 39 |
    40 | 41 |
    -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/constants/PasswordStrengthCheckerTypeEnum.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.constants; 18 | 19 | /** 20 | * Password complexity type : 21 | *
      22 | *
    • VERYWEAK : Dummy password

    • 23 | *
    • WEAK : Does not meet the minimum requirements.

    • 24 | *
    • STRONG : Meets minimum requirements.

    • 25 | *
    • STRONGEST : Check all complexity requirements.
    • 26 | *
    27 | * 28 | * @author lguerin 29 | */ 30 | public enum PasswordStrengthCheckerTypeEnum 31 | { 32 | VERYWEAK, WEAK, STRONG, STRONGEST; 33 | 34 | public String toString() 35 | { 36 | return super.toString().toLowerCase(); 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/mixins/AuthorizeMixin.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.mixins; 18 | 19 | import org.apache.tapestry5.annotations.Mixin; 20 | 21 | import fr.exanpe.t5.lib.base.BaseAuthorize; 22 | import fr.exanpe.t5.lib.components.Authorize; 23 | 24 | /** 25 | * A mixin used to get control of a component according the roles of a user.
    26 | * Depending on role, the component this mixin is applied on will, or won't be processed.
    27 | * {@link Mixin} version of the {@link Authorize} component. 28 | * 29 | * @see BaseAuthorize 30 | * @see Authorize 31 | * @since 1.2 32 | * @author jmaupoux 33 | */ 34 | public class AuthorizeMixin extends BaseAuthorize 35 | { 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/bean/City.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.bean; 18 | 19 | public class City 20 | { 21 | private String id; 22 | private String name; 23 | 24 | public City(String id, String name) 25 | { 26 | super(); 27 | this.id = id; 28 | this.name = name; 29 | } 30 | 31 | public String getId() 32 | { 33 | return id; 34 | } 35 | 36 | public void setId(String id) 37 | { 38 | this.id = id; 39 | } 40 | 41 | public String getName() 42 | { 43 | return name; 44 | } 45 | 46 | public void setName(String name) 47 | { 48 | this.name = name; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/resources/fr/exanpe/t5/lib/components/TabView.tml: -------------------------------------------------------------------------------- 1 | 2 | 3 |
    4 |
      5 | 6 |
    7 | 8 |
    9 | 10 |
    11 |
    12 | 13 | 46 | 47 | 48 |
    -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/bean/Country.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.bean; 18 | 19 | public class Country 20 | { 21 | private String id; 22 | private String name; 23 | 24 | public Country(String id, String name) 25 | { 26 | super(); 27 | this.id = id; 28 | this.name = name; 29 | } 30 | 31 | public String getId() 32 | { 33 | return id; 34 | } 35 | 36 | public void setId(String id) 37 | { 38 | this.id = id; 39 | } 40 | 41 | public String getName() 42 | { 43 | return name; 44 | } 45 | 46 | public void setName(String name) 47 | { 48 | this.name = name; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/SlideShowTest.tml: -------------------------------------------------------------------------------- 1 | 3 |
    4 | 5 | slideShow 2 visibles:
    6 | 7 | 8 | 9 | 10 | 11 | 12 |



    13 | 14 | slideShow not circular, with content for items :
    15 | 16 | 17 | content 1 18 | 19 | 20 | content 2 21 | 22 | 23 | content 3 24 | 25 | 26 | 27 |



    28 | 29 | slideShow Autoplaying:
    30 | 31 | 32 | 33 | 34 | 35 | 36 |



    37 | 38 |
    39 |
    -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/constants/AjaxValidationResult.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.constants; 18 | 19 | import fr.exanpe.t5.lib.mixins.AjaxValidation; 20 | 21 | /** 22 | * Possible ajax validation result. Required as event methods cannot return Boolean values. 23 | *
      24 | *
    • true
    • 25 | *
    • false
    • 26 | *
    27 | * 28 | * @see AjaxValidation 29 | * @see ExanpeEventConstants#AJAXVALIDATION_EVENT 30 | * @author jmaupoux 31 | */ 32 | public enum AjaxValidationResult 33 | { 34 | TRUE(Boolean.TRUE), FALSE(Boolean.FALSE); 35 | 36 | private Boolean bool; 37 | 38 | private AjaxValidationResult(Boolean bool) 39 | { 40 | this.bool = bool; 41 | } 42 | 43 | public Boolean toBoolean() 44 | { 45 | return bool; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/ColorPickerTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import java.awt.Color; 20 | 21 | import org.apache.tapestry5.annotations.Persist; 22 | import org.apache.tapestry5.annotations.Property; 23 | 24 | import fr.exanpe.t5.lib.components.Tooltip; 25 | 26 | /** 27 | * The demo page for {@link Tooltip} component 28 | * 29 | * @author lguerin 30 | */ 31 | public class ColorPickerTest 32 | { 33 | @Property 34 | @Persist 35 | private Color color; 36 | 37 | @Property 38 | @Persist 39 | private Color color2; 40 | 41 | public void onSubmit() 42 | { 43 | if (color != null) 44 | System.out.println("submit//" + Integer.toHexString(color.getRGB())); 45 | else 46 | System.out.println("submit null"); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/LocaleSessionTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import java.util.Locale; 20 | 21 | import org.apache.tapestry5.ioc.Messages; 22 | import org.apache.tapestry5.ioc.annotations.Inject; 23 | 24 | import fr.exanpe.t5.lib.services.LocaleSessionService; 25 | 26 | public class LocaleSessionTest 27 | { 28 | @Inject 29 | private LocaleSessionService localeSessionService; 30 | 31 | @Inject 32 | private Messages msg; 33 | 34 | void onActionFromFr() 35 | { 36 | localeSessionService.setLocale(Locale.FRANCE); 37 | System.out.println(msg.get("test")); 38 | } 39 | 40 | void onActionFromEn() 41 | { 42 | localeSessionService.setLocale("en"); 43 | System.out.println(msg.get("test")); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/Index.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages; 18 | 19 | import org.apache.tapestry5.Link; 20 | import org.apache.tapestry5.annotations.OnEvent; 21 | import org.apache.tapestry5.ioc.annotations.Inject; 22 | import org.apache.tapestry5.services.PageRenderLinkSource; 23 | 24 | import exanpe.t5.lib.demo.pages.comp.PasswordStrengthCheckerTest; 25 | 26 | /** 27 | * Default index page for all the tests. 28 | * 29 | * @author lguerin 30 | */ 31 | public class Index 32 | { 33 | @Inject 34 | private PageRenderLinkSource pageRender; 35 | 36 | @OnEvent(value = "passwordStrengthCheckerTest") 37 | Object goToPasswordStrengthCheckerTestPage() 38 | { 39 | Link link = pageRender.createPageRenderLink(PasswordStrengthCheckerTest.class); 40 | link.addParameter("param1", "test"); 41 | return link; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/DialogTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import org.apache.tapestry5.PersistenceConstants; 20 | import org.apache.tapestry5.annotations.Persist; 21 | import org.apache.tapestry5.annotations.Property; 22 | 23 | import fr.exanpe.t5.lib.mixins.Dialog; 24 | 25 | /** 26 | * The demo page for {@link Dialog} mixin 27 | * 28 | * @author lguerin 29 | */ 30 | public class DialogTest 31 | { 32 | @Persist(PersistenceConstants.FLASH) 33 | @Property 34 | private String field1; 35 | 36 | public String getDisableClass() 37 | { 38 | return Dialog.DISABLE_CLASS; 39 | } 40 | 41 | void onAction() 42 | { 43 | System.out.println("Dialog validation ok"); 44 | } 45 | 46 | void onSubmit() 47 | { 48 | System.out.println(">>> Thanks " + field1); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/model/AccordionInternalModel.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.model; 18 | 19 | import java.util.LinkedList; 20 | import java.util.List; 21 | 22 | import fr.exanpe.t5.lib.components.Accordion; 23 | import fr.exanpe.t5.lib.components.AccordionItem; 24 | 25 | /** 26 | * Internal model to allow the accordion items to register to the main accordion component 27 | * 28 | * @see Accordion 29 | * @see AccordionItem 30 | * @author jmaupoux 31 | */ 32 | public class AccordionInternalModel 33 | { 34 | private List itemsId; 35 | 36 | public AccordionInternalModel() 37 | { 38 | itemsId = new LinkedList(); 39 | } 40 | 41 | public List getItemsId() 42 | { 43 | return itemsId; 44 | } 45 | 46 | public void setItemsId(List itemsId) 47 | { 48 | this.itemsId = itemsId; 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/SecurePasswordTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | /** 18 | * 19 | */ 20 | package exanpe.t5.lib.demo.pages.comp; 21 | 22 | import org.apache.tapestry5.EventConstants; 23 | import org.apache.tapestry5.annotations.OnEvent; 24 | import org.apache.tapestry5.annotations.Persist; 25 | import org.apache.tapestry5.annotations.Property; 26 | 27 | import fr.exanpe.t5.lib.components.HideablePanel; 28 | 29 | /** 30 | * The demo page for the {@link HideablePanel} component. 31 | * 32 | * @author jmaupoux 33 | */ 34 | public class SecurePasswordTest{ 35 | 36 | @Property 37 | @Persist 38 | private String spwd; 39 | 40 | @Property 41 | private String spwd2; 42 | 43 | @Property 44 | private String spwd3; 45 | 46 | @OnEvent(value = EventConstants.SUBMIT) 47 | public void display(){ 48 | System.out.println("1::"+spwd); 49 | System.out.println("2::"+spwd2); 50 | System.out.println("3::"+spwd3); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/RichTextEditorTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 |
    18 |
    19 | 20 | 21 | 22 | 23 |
    24 | 25 | richContent :

    26 | richContent2 :
    27 | 28 | 38 | 39 |
    -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/TapestrySkin.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 |
    5 |
    GridPager :

    6 | 7 | 8 |
    9 | 10 |
    Grid :

    11 | 12 |
    13 | 14 | 15 |

    16 | There are no users to display. 17 |

    18 |
    19 | 20 | ${userRow.lastname} ${userRow.firstname} 21 | 22 |
    23 |
    24 |
    25 | 26 |
    Autocomplete :

    27 |
    28 | Type in a country name: 30 |
    31 | 32 |
    33 | 34 |
    Palette :

    35 | 36 | 38 | 39 | 40 |
    41 | 42 |
    BeanEditForm :

    43 |
    44 | 46 |
    47 |
    48 |
    -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/constants/GMapTypeEnum.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | /** 18 | * 19 | */ 20 | package fr.exanpe.t5.lib.constants; 21 | 22 | /** 23 | * Types of maps you can display using the Google Maps Javascript API. 24 | * 25 | * @author lguerin 26 | * @since 1.2 27 | */ 28 | public enum GMapTypeEnum 29 | { 30 | /** 31 | * Displays the normal, default 2D tiles of Google Maps 32 | */ 33 | ROADMAP, 34 | /** 35 | * Displays photographic tiles 36 | */ 37 | SATELLITE, 38 | /** 39 | * Displays a mix of photographic tiles and a tile layer for prominent features (roads, city 40 | * names) 41 | */ 42 | HYBRID, 43 | /** 44 | * Displays physical relief tiles for displaying elevation and water features (mountains, 45 | * rivers, etc.) 46 | */ 47 | TERRAIN; 48 | 49 | public String toString() 50 | { 51 | return super.toString().toUpperCase(); 52 | }; 53 | } 54 | -------------------------------------------------------------------------------- /src/test/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | Exanpe T5 Library Test App 7 | 8 | tapestry.app-package 9 | exanpe.t5.lib.demo 10 | 11 | 12 | 13 | tapestry.use-external-spring-context 14 | true 15 | 16 | 17 | 18 | contextConfigLocation 19 | 20 | classpath:applicationContext-security.xml 21 | 22 | 23 | 24 | 25 | 26 | springSecurityFilterChain 27 | org.springframework.web.filter.DelegatingFilterProxy 28 | 29 | 30 | 31 | app 32 | org.apache.tapestry5.spring.TapestrySpringFilter 33 | 34 | 35 | 36 | springSecurityFilterChain 37 | /* 38 | 39 | 40 | 41 | app 42 | /* 43 | 44 | 45 | 46 | org.springframework.web.context.ContextLoaderListener 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/site/site.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exanpe T5 Lib 5 | http://maven.apache.org/images/apache-maven-project.png 6 | http://exanpe.github.com/exanpe-t5-lib/ 7 | 8 | 9 | http://maven.apache.org/images/maven-small.gif 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/encoders/CountryEncoder.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.encoders; 18 | 19 | import org.apache.tapestry5.ValueEncoder; 20 | 21 | import exanpe.t5.lib.demo.bean.Country; 22 | import exanpe.t5.lib.demo.services.DataService; 23 | 24 | /** 25 | * Encoder for {@link Country} objects 26 | * 27 | * @author lguerin 28 | */ 29 | public class CountryEncoder implements ValueEncoder 30 | { 31 | 32 | private DataService dataService; 33 | 34 | public CountryEncoder(DataService dataService) 35 | { 36 | this.dataService = dataService; 37 | } 38 | 39 | public String toClient(Country value) 40 | { 41 | return String.valueOf(value.getId()); 42 | } 43 | 44 | public Country toValue(String clientValue) 45 | { 46 | if (clientValue != null && !"".equalsIgnoreCase(clientValue)) { return dataService.findCountryById(clientValue); } 47 | return null; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/AuthorizeMixinTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | Switch to ROLE_USER only

    5 | Switch to ROLE_ADMIN only

    6 | Switch to ROLE_NONE

    7 | 8 |
    9 | 10 | Displayed for ROLE_USER only : 11 | 12 | 15 | Go to Index 16 | 17 |
    18 | 19 |

    20 | 21 |
    22 | 23 | Displayed for ROLE_USER or ADMIN : 24 | 25 | 28 | Go to Index 29 | 30 |
    31 | 32 |

    33 | 34 |
    35 | 36 | Displayed for ROLE_USER and ADMIN (you can't do this in this example) : 37 | 38 | 41 | Go to Index 42 | 43 | 44 |
    45 | 46 |

    47 | 48 |
    49 | 50 | Not displayed for ROLE_USER : 51 | 52 | 55 | Go to Index 56 | 57 |
    58 | 59 | 60 |
    -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/components/Layout.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.components; 18 | 19 | import org.apache.tapestry5.BindingConstants; 20 | import org.apache.tapestry5.ComponentResources; 21 | import org.apache.tapestry5.annotations.Parameter; 22 | import org.apache.tapestry5.annotations.Property; 23 | import org.apache.tapestry5.ioc.annotations.Inject; 24 | 25 | /** 26 | * Minimal default Layout for Exanpe library demo pages. 27 | * 28 | * @author lguerin 29 | */ 30 | public class Layout 31 | { 32 | @Inject 33 | private ComponentResources resources; 34 | 35 | @SuppressWarnings("unused") 36 | @Property 37 | @Parameter(defaultPrefix = BindingConstants.LITERAL) 38 | private String title; 39 | 40 | String defaulTitle() 41 | { 42 | return resources.getPageName(); 43 | } 44 | 45 | /** 46 | * Dscard fields tagged by Persist 47 | */ 48 | void onActionFromReset() 49 | { 50 | resources.discardPersistentFieldChanges(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/ListSorterTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | /** 18 | * 19 | */ 20 | package exanpe.t5.lib.demo.pages.comp; 21 | 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | import org.apache.tapestry5.annotations.Persist; 26 | import org.apache.tapestry5.annotations.Property; 27 | 28 | import fr.exanpe.t5.lib.components.ListSorter; 29 | 30 | /** 31 | * The demo page for the {@link ListSorter} component. 32 | * 33 | * @author jmaupoux 34 | */ 35 | public class ListSorterTest 36 | { 37 | @Property 38 | @Persist 39 | private List list; 40 | 41 | @Property 42 | private String element; 43 | 44 | void onActivate() 45 | { 46 | if (list == null) 47 | { 48 | list = new ArrayList(); 49 | list.add("String1"); 50 | list.add("String2"); 51 | list.add("String2S"); 52 | list.add("String2SF"); 53 | list.add("String2FDF"); 54 | 55 | } 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/model/gmap/GMapBaseModel.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | /** 18 | * 19 | */ 20 | package fr.exanpe.t5.lib.model.gmap; 21 | 22 | /** 23 | * Base classe for GMap models 24 | * 25 | * @author lguerin 26 | * @since 1.2 27 | */ 28 | public abstract class GMapBaseModel 29 | { 30 | private String id; 31 | private String latitude; 32 | private String longitude; 33 | 34 | public String getId() 35 | { 36 | return id; 37 | } 38 | 39 | public void setId(String id) 40 | { 41 | this.id = id; 42 | } 43 | 44 | public String getLatitude() 45 | { 46 | return latitude; 47 | } 48 | 49 | public void setLatitude(String latitude) 50 | { 51 | this.latitude = latitude; 52 | } 53 | 54 | public String getLongitude() 55 | { 56 | return longitude; 57 | } 58 | 59 | public void setLongitude(String longitude) 60 | { 61 | this.longitude = longitude; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/AuthorizeTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | Switch to ROLE_USER only

    5 | Switch to ROLE_ADMIN only

    6 | Switch to ROLE_NONE

    7 | 8 |
    9 | 10 | Displayed for ROLE_USER only : 11 | 12 | 13 | user only 14 | 15 |
    16 | 17 |

    18 | 19 |
    20 | 21 | Displayed for ROLE_USER or ADMIN : 22 | 23 | 24 | user or admin hello 25 | 26 |
    27 | 28 |

    29 | 30 |
    31 | 32 | Displayed for ROLE_USER and ADMIN : 33 | 34 | 35 | user and admin hello 36 | 37 |
    38 | 39 |

    40 | 41 |
    42 | 43 | Not displayed for ROLE_USER : 44 | 45 | 46 | NOT USER 47 | 48 |
    49 | 50 |

    51 | 52 |
    53 | 54 | External block (not body) displayed for ROLE_USER : 55 | 56 | 57 |
    58 | 59 | 60 | This is an external block 61 | 62 | 63 |
    -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/GMapTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Cliquez sur les liens suivants : 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    16 |
    17 |
    18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
    26 |
    27 |
    28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 |
    -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/model/gmap/GMapMarkerModel.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | /** 18 | * 19 | */ 20 | package fr.exanpe.t5.lib.model.gmap; 21 | 22 | import org.apache.tapestry5.Asset; 23 | 24 | /** 25 | * Model class for Google Map Marker. 26 | * 27 | * @author lguerin 28 | * @since 1.2 29 | */ 30 | public class GMapMarkerModel extends GMapBaseModel 31 | { 32 | private Asset icon; 33 | private String title; 34 | private String info; 35 | 36 | public String getTitle() 37 | { 38 | return title; 39 | } 40 | 41 | public void setTitle(String title) 42 | { 43 | this.title = title; 44 | } 45 | 46 | public Asset getIcon() 47 | { 48 | return icon; 49 | } 50 | 51 | public void setIcon(Asset asset) 52 | { 53 | this.icon = asset; 54 | } 55 | 56 | public String getInfo() 57 | { 58 | return info; 59 | } 60 | 61 | public void setInfo(String info) 62 | { 63 | this.info = info; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/RichTextEditorTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import org.apache.tapestry5.PersistenceConstants; 20 | import org.apache.tapestry5.annotations.Persist; 21 | import org.apache.tapestry5.annotations.Property; 22 | import org.apache.tapestry5.ioc.Messages; 23 | import org.apache.tapestry5.ioc.annotations.Inject; 24 | 25 | import fr.exanpe.t5.lib.mixins.RichTextEditor; 26 | 27 | /** 28 | * The demo page for {@link RichTextEditor} component 29 | * 30 | * @author lguerin 31 | */ 32 | public class RichTextEditorTest 33 | { 34 | @Property 35 | @Persist(PersistenceConstants.FLASH) 36 | private String richContent; 37 | 38 | @Property 39 | @Persist(PersistenceConstants.FLASH) 40 | private String richContent2; 41 | 42 | @Inject 43 | @Property 44 | private Messages messages; 45 | 46 | void onSubmit() 47 | { 48 | System.out.println(">>> Rich content: " + richContent); 49 | System.out.println(">>> Rich content2: " + richContent2); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/services/AuthorizeBusinessService.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.services; 18 | 19 | /** 20 | * This interface defines the services offered to all the library authorization elements 21 | * (component/mixin/worker). 22 | * 23 | * @author jmaupoux 24 | * @since 1.2 25 | */ 26 | public interface AuthorizeBusinessService 27 | { 28 | /** 29 | * Apply the "any" rule 30 | * 31 | * @param any the roles to restrict on 32 | * @return true to grant access, false otherwise 33 | */ 34 | public boolean applyAny(String[] any); 35 | 36 | /** 37 | * Apply the "all" rule 38 | * 39 | * @param any the roles to restrict on 40 | * @return true to grant access, false otherwise 41 | */ 42 | public boolean applyAll(String[] all); 43 | 44 | /** 45 | * Apply the "any" rule 46 | * 47 | * @param any the roles to restrict on 48 | * @return true to grant access, false otherwise 49 | */ 50 | public boolean applyNot(String[] not); 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/annotation/ContextPageReset.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.annotation; 18 | 19 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 20 | 21 | import java.lang.annotation.Documented; 22 | import java.lang.annotation.ElementType; 23 | import java.lang.annotation.Retention; 24 | import java.lang.annotation.Target; 25 | 26 | import fr.exanpe.t5.lib.constants.ExanpeSymbols; 27 | 28 | /** 29 | * Annotation to mark a method as reseting the page depending on a marker sent in the context. 30 | * If {@link ExanpeSymbols#CONTEXT_PAGE_RESET_MARKER} is found in the request, every method 31 | * containing this annotation, or named "void contextReset()", will be triggered.
    32 | * For Tapestry 5.3, a package protected method "void onActivate()" have to be defined in the class. 33 | * 34 | * @author jmaupoux 35 | * @see ExanpeSymbols#CONTEXT_PAGE_RESET_MARKER 36 | * @since 1.2 37 | */ 38 | @Target( 39 | { ElementType.METHOD }) 40 | @Retention(RUNTIME) 41 | @Documented 42 | public @interface ContextPageReset 43 | { 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/bean/User.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.bean; 18 | 19 | import java.io.Serializable; 20 | 21 | import org.apache.tapestry5.beaneditor.NonVisual; 22 | 23 | public class User implements Serializable 24 | { 25 | @NonVisual 26 | private long id; 27 | 28 | private String firstName; 29 | 30 | private String lastName; 31 | 32 | private int age; 33 | 34 | public long getId() 35 | { 36 | return id; 37 | } 38 | 39 | public void setId(long id) 40 | { 41 | this.id = id; 42 | } 43 | 44 | public String getFirstName() 45 | { 46 | return firstName; 47 | } 48 | 49 | public void setFirstName(String firstName) 50 | { 51 | this.firstName = firstName; 52 | } 53 | 54 | public String getLastName() 55 | { 56 | return lastName; 57 | } 58 | 59 | public void setLastName(String lastName) 60 | { 61 | this.lastName = lastName; 62 | } 63 | 64 | public int getAge() 65 | { 66 | return age; 67 | } 68 | 69 | public void setAge(int age) 70 | { 71 | this.age = age; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/ContextPageResetTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import org.apache.tapestry5.PersistenceConstants; 20 | import org.apache.tapestry5.annotations.Persist; 21 | import org.apache.tapestry5.annotations.Property; 22 | 23 | import fr.exanpe.t5.lib.annotation.ContextPageReset; 24 | 25 | /** 26 | * The demo page for {@link ContextPageReset} component 27 | * 28 | * @author lguerin 29 | */ 30 | public class ContextPageResetTest 31 | { 32 | @Property 33 | @Persist() 34 | private String value; 35 | 36 | @Property 37 | @Persist(PersistenceConstants.FLASH) 38 | private int realContext; 39 | 40 | void onActivate() 41 | { 42 | System.out.println("activate:: seul"); 43 | } 44 | 45 | void onActivate(int context) 46 | { 47 | this.realContext = context; 48 | } 49 | 50 | void contextReset() 51 | { 52 | System.out.println("reset plz"); 53 | value = null; 54 | } 55 | 56 | @ContextPageReset 57 | void onContextReset() 58 | { 59 | System.out.println("reset annot plz"); 60 | value = null; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/DialogTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | link1 7 | 8 |
    9 | link2 10 | 11 |
    12 | Dialog disable 13 | 14 |
    15 | Dialog disable with JS Handler 16 | 17 |
    18 | Dialog from properties 19 | 20 |
    21 | 22 | 23 |
    24 | Thanks : ${field1} 25 | 26 |
    27 | This is a RICH dialog !
    28 | Nom: 29 |
    30 |
    31 | 32 | 51 | 52 | 53 |
    54 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/bean/AjaxFormLoopEngine.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.bean; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | import org.apache.tapestry5.ValueEncoder; 23 | 24 | public abstract class AjaxFormLoopEngine 25 | { 26 | private List list = new ArrayList(); 27 | 28 | private T t; 29 | 30 | public List getList() 31 | { 32 | return list; 33 | } 34 | 35 | public void setList(List list) 36 | { 37 | this.list = list; 38 | } 39 | 40 | public T getT() 41 | { 42 | return t; 43 | } 44 | 45 | public void setT(T t) 46 | { 47 | this.t = t; 48 | } 49 | 50 | public abstract ValueEncoder getEncoder(); 51 | 52 | public T createNew() 53 | { 54 | T t = instanciate(); 55 | list.add(t); 56 | return t; 57 | } 58 | 59 | protected abstract T instanciate(); 60 | 61 | public void remove(T t) 62 | { 63 | if (!list.remove(t)) { throw new IllegalArgumentException("Impossible to remove the object " + t.toString()); } 64 | } 65 | 66 | public void clear() 67 | { 68 | list.clear(); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/components/Authorize.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.components; 18 | 19 | import org.apache.tapestry5.BindingConstants; 20 | import org.apache.tapestry5.Block; 21 | import org.apache.tapestry5.annotations.Parameter; 22 | import org.apache.tapestry5.annotations.Property; 23 | 24 | import fr.exanpe.t5.lib.base.BaseAuthorize; 25 | import fr.exanpe.t5.lib.mixins.AuthorizeMixin; 26 | 27 | /** 28 | * This component displays its body/block according to authorizations rules declared.
    29 | * All rules will be applied if provided. If one fails, the body/block won't be rendered.
    30 | * any/all/not must be filled with comma separated roles, as set into your session principal.
    31 | * For easier maintenance, we advise you to fill only one of any/all/not parameter. 32 | * 33 | * @since 1.2 34 | * @see BaseAuthorize 35 | * @see AuthorizeMixin 36 | * @author jmaupoux 37 | */ 38 | public class Authorize extends BaseAuthorize 39 | { 40 | /** 41 | * Block to render authorization. If not provided, the body of the component is rendered. 42 | */ 43 | @SuppressWarnings("unused") 44 | @Property 45 | @Parameter(defaultPrefix = BindingConstants.PROP) 46 | private Block block; 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/VerticalMenuTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import java.net.MalformedURLException; 20 | import java.net.URL; 21 | 22 | import org.apache.tapestry5.annotations.OnEvent; 23 | import org.apache.tapestry5.ioc.annotations.Inject; 24 | import org.slf4j.Logger; 25 | 26 | import fr.exanpe.t5.lib.constants.ExanpeEventConstants; 27 | 28 | public class VerticalMenuTest 29 | { 30 | @Inject 31 | private Logger logger; 32 | 33 | @OnEvent(ExanpeEventConstants.VERTICALMENU_EVENT) 34 | Object handleSelectMenu(String menuId) 35 | { 36 | System.out.println(">> select menu item id: " + menuId); 37 | String targetUrl = "http://www.google.fr"; 38 | if ("external".equals(menuId)) 39 | { 40 | URL external = null; 41 | try 42 | { 43 | external = new URL(targetUrl); 44 | } 45 | catch (MalformedURLException ex) 46 | { 47 | logger.error(String.format("Incorrect external url: %s", targetUrl)); 48 | throw new RuntimeException(ex); 49 | } 50 | return external; 51 | } 52 | return this; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/services/LocaleSessionService.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.services; 18 | 19 | import java.util.Locale; 20 | 21 | import fr.exanpe.t5.lib.internal.localesession.LocaleSessionRequestFilter; 22 | 23 | /** 24 | * This interface defines the services offered to manipulate the locale in session (instead of in 25 | * url). 26 | * Note that your Locale have to be defined as a contribution of SymbolConstants#SUPPORTED_LOCALES 27 | * 28 | * @author jmaupoux 29 | * @since 1.2 30 | */ 31 | public interface LocaleSessionService 32 | { 33 | /** 34 | * Set a locale in the session from name. 35 | * Automatically restored on request by contributing with {@link LocaleSessionRequestFilter} 36 | * 37 | * @param locale the locale String. null is allowed. 38 | */ 39 | public void setLocale(String locale); 40 | 41 | /** 42 | * Set a locale in the session. Uses the toString() value of the Locale class.
    43 | * 44 | * @param locale the Locale. null is allowed to reset the locale 45 | */ 46 | public void setLocale(Locale locale); 47 | 48 | /** 49 | * Get a locale from the current session 50 | * 51 | * @return the locale String, as set by {@link #setLocale(String)}, or null if none 52 | */ 53 | public String getLocale(); 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/exception/AuthorizeException.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.exception; 18 | 19 | import fr.exanpe.t5.lib.annotation.Authorize; 20 | 21 | /** 22 | * Exception thrown if an access denied detected by {@link Authorize} annotation occurs.
    23 | * User and Page are recorded to allow fine-grained management. 24 | * 25 | * @author jmaupoux 26 | */ 27 | public class AuthorizeException extends RuntimeException 28 | { 29 | /** 30 | * serial uid 31 | */ 32 | private static final long serialVersionUID = -6093448612924317357L; 33 | 34 | private String page; 35 | private String username; 36 | 37 | public AuthorizeException(String page, String username) 38 | { 39 | super("Illegal access to page " + page + " for user " + username); 40 | this.page = page; 41 | this.username = username; 42 | } 43 | 44 | /** 45 | * The page which access has been denied 46 | * 47 | * @return the page which access has been denied 48 | */ 49 | public String getPage() 50 | { 51 | return page; 52 | } 53 | 54 | /** 55 | * The username that initiated the exception 56 | * 57 | * @return the username that initiated the exception 58 | */ 59 | public String getUsername() 60 | { 61 | return username; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/services/impl/LocaleSessionServiceImpl.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.services.impl; 18 | 19 | import java.util.Locale; 20 | 21 | import org.apache.tapestry5.ioc.annotations.Inject; 22 | import org.apache.tapestry5.services.RequestGlobals; 23 | 24 | import fr.exanpe.t5.lib.services.LocaleSessionService; 25 | 26 | /** 27 | * Implementation of the service 28 | * 29 | * @author jmaupoux 30 | */ 31 | public class LocaleSessionServiceImpl implements LocaleSessionService 32 | { 33 | 34 | public static final String LOCALE_ATT_NAME = "__locale"; 35 | 36 | @Inject 37 | private RequestGlobals request; 38 | 39 | public void setLocale(String locale) 40 | { 41 | innerSetLocale(locale); 42 | } 43 | 44 | public void setLocale(Locale locale) 45 | { 46 | if (locale == null) 47 | { 48 | innerSetLocale(null); 49 | } 50 | else 51 | { 52 | setLocale(locale.toString()); 53 | } 54 | } 55 | 56 | private void innerSetLocale(String locale) 57 | { 58 | request.getRequest().getSession(true).setAttribute(LOCALE_ATT_NAME, locale); 59 | } 60 | 61 | public String getLocale() 62 | { 63 | return (String) request.getRequest().getSession(true).getAttribute(LOCALE_ATT_NAME); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/SliderTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import org.apache.tapestry5.annotations.InjectComponent; 20 | import org.apache.tapestry5.annotations.Log; 21 | import org.apache.tapestry5.annotations.OnEvent; 22 | import org.apache.tapestry5.annotations.Persist; 23 | import org.apache.tapestry5.annotations.Property; 24 | import org.apache.tapestry5.corelib.components.Zone; 25 | 26 | import fr.exanpe.t5.lib.components.Slider; 27 | import fr.exanpe.t5.lib.constants.ExanpeEventConstants; 28 | 29 | /** 30 | * The demo page for {@link Slider} component 31 | * 32 | * @author lguerin 33 | */ 34 | public class SliderTest 35 | { 36 | @SuppressWarnings("unused") 37 | @Property 38 | @Persist 39 | private String sliderValue; 40 | 41 | @SuppressWarnings("unused") 42 | @Property 43 | @Persist 44 | private String sliderValue2; 45 | 46 | @SuppressWarnings("unused") 47 | @Property 48 | @Persist 49 | private String sliderValue3; 50 | 51 | @SuppressWarnings("unused") 52 | @Property 53 | @Persist 54 | private String sliderValue4; 55 | 56 | @InjectComponent 57 | private Zone zone; 58 | 59 | @Log 60 | @OnEvent(ExanpeEventConstants.SLIDER_EVENT) 61 | Object handleSliderAjaxEvent(String value) 62 | { 63 | System.out.println("Ajax value: " + value); 64 | return zone.getBody(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/security/SameUserPasswordAP.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.security; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | import org.springframework.security.authentication.AuthenticationProvider; 23 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 24 | import org.springframework.security.core.Authentication; 25 | import org.springframework.security.core.AuthenticationException; 26 | import org.springframework.security.core.GrantedAuthority; 27 | import org.springframework.security.core.authority.GrantedAuthorityImpl; 28 | import org.springframework.security.core.userdetails.User; 29 | 30 | public class SameUserPasswordAP implements AuthenticationProvider 31 | { 32 | 33 | public Authentication authenticate(Authentication authentication) throws AuthenticationException 34 | { 35 | String username = authentication.getName(); 36 | GrantedAuthorityImpl ga = new GrantedAuthorityImpl("ROLE_" + username); 37 | List l = new ArrayList(); 38 | l.add(ga); 39 | 40 | return new UsernamePasswordAuthenticationToken(new User(username, username, true, true, true, true, l), username, l); 41 | } 42 | 43 | public boolean supports(Class authentication) 44 | { 45 | return true; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/annotation/Authorize.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.annotation; 18 | 19 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 20 | 21 | import java.lang.annotation.Documented; 22 | import java.lang.annotation.ElementType; 23 | import java.lang.annotation.Retention; 24 | import java.lang.annotation.Target; 25 | 26 | import fr.exanpe.t5.lib.exception.AuthorizeException; 27 | 28 | /** 29 | * Interface used to restrict a page's method invocation.
    30 | * Simply annotate your method or class with \@Authorize and the restriction will be applied 31 | * depending on the current user authorities.
    32 | * Note that on authorization failure, an {@link AuthorizeException} will be thrown. Catch it to 33 | * display a custom error page. 34 | * 35 | * @see AuthorizeException 36 | * @author jmaupoux 37 | * @since 1.2 38 | */ 39 | @Target( 40 | { ElementType.METHOD, ElementType.TYPE }) 41 | @Retention(RUNTIME) 42 | @Documented 43 | public @interface Authorize 44 | { 45 | /** 46 | * Any of these authorizations grant access 47 | */ 48 | String[] any() default 49 | {}; 50 | 51 | /** 52 | * All of these authorizations are required to grant access 53 | */ 54 | String[] all() default 55 | {}; 56 | 57 | /** 58 | * None of these authorizations grant access 59 | */ 60 | String[] not() default 61 | {}; 62 | } 63 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/AjaxValidationTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import org.apache.tapestry5.annotations.OnEvent; 20 | import org.apache.tapestry5.annotations.Property; 21 | 22 | import fr.exanpe.t5.lib.constants.AjaxValidationResult; 23 | import fr.exanpe.t5.lib.constants.ExanpeEventConstants; 24 | 25 | public class AjaxValidationTest 26 | { 27 | @Property 28 | private String value; 29 | 30 | @OnEvent(value = ExanpeEventConstants.AJAXVALIDATION_EVENT, component = "admin") 31 | public AjaxValidationResult ajaxValidate(String value) 32 | { 33 | if ("admin".equalsIgnoreCase(value)) 34 | return AjaxValidationResult.TRUE; 35 | else 36 | return AjaxValidationResult.FALSE; 37 | } 38 | 39 | @OnEvent(value = ExanpeEventConstants.AJAXVALIDATION_EVENT, component = "props") 40 | public AjaxValidationResult ajaxValidateProps(String value) 41 | { 42 | if ("admin".equalsIgnoreCase(value)) 43 | return AjaxValidationResult.TRUE; 44 | else 45 | return AjaxValidationResult.FALSE; 46 | } 47 | 48 | @OnEvent(value = ExanpeEventConstants.AJAXVALIDATION_EVENT, component = "multi") 49 | public AjaxValidationResult ajaxValidateMulti(String value) 50 | { 51 | if (value != null && value.length() < 7) 52 | return AjaxValidationResult.TRUE; 53 | return AjaxValidationResult.FALSE; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/model/MenuInternalModel.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.model; 18 | 19 | import java.util.Stack; 20 | 21 | /** 22 | * Internal mode for the menu 23 | * Used mainly to build a render stack and keep in mind the positioning state in the menu. This 24 | * positioning may have an impact on rendering. 25 | * This model is not kept after rendering. Elements are discarded after processed. 26 | * 27 | * @author jmaupoux 28 | */ 29 | public class MenuInternalModel 30 | { 31 | private Stack stack = new Stack(); 32 | 33 | /** 34 | * Type of element managed 35 | * 36 | * @author jmaupoux 37 | */ 38 | public enum MenuRenderElement 39 | { 40 | ROOT, MENUITEM; 41 | } 42 | 43 | /** 44 | * Return the parent of the current state 45 | * 46 | * @return the parent of the current state 47 | */ 48 | public MenuRenderElement getParent() 49 | { 50 | return stack.peek(); 51 | } 52 | 53 | /** 54 | * Push a new element under the current 55 | * 56 | * @param element the element 57 | */ 58 | public void push(MenuRenderElement element) 59 | { 60 | stack.push(element); 61 | } 62 | 63 | /** 64 | * End the current element. Discard it 65 | */ 66 | public void endElement() 67 | { 68 | stack.pop(); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/AjaxLoaderTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import java.text.SimpleDateFormat; 20 | import java.util.Date; 21 | import java.util.List; 22 | 23 | import org.apache.tapestry5.annotations.Import; 24 | import org.apache.tapestry5.annotations.Property; 25 | import org.apache.tapestry5.ioc.annotations.Inject; 26 | 27 | import exanpe.t5.lib.demo.bean.User; 28 | import exanpe.t5.lib.demo.services.DataService; 29 | import fr.exanpe.t5.lib.components.AjaxLoader; 30 | 31 | /** 32 | * The demo page for the {@link AjaxLoader} component. 33 | * 34 | * @author lguerin 35 | */ 36 | @Import(stylesheet = 37 | { "${exanpe.asset-base}/css/exanpe-t5-lib-skin.css" }) 38 | public class AjaxLoaderTest 39 | { 40 | @Inject 41 | private DataService dataService; 42 | 43 | @Property 44 | private User userRow; 45 | 46 | @Property 47 | private String date; 48 | 49 | public void onActivate() 50 | { 51 | date = new SimpleDateFormat("MM-dd-yyyy HH:mm:ss").format(new Date()); 52 | } 53 | 54 | public List getUsers1() throws InterruptedException 55 | { 56 | List result; 57 | result = dataService.getListUsersWithLatence(2000); 58 | return result; 59 | } 60 | 61 | public List getUsers2() throws InterruptedException 62 | { 63 | List result; 64 | result = dataService.getListUsersWithLatence(5000); 65 | return result; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/site/xdoc/migration.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | About us - Exanpe T5 Lib 8 | Exanpe 9 | 10 | 11 | 12 | 13 |
    14 |

    Accordion

    15 | A migration have to be performed on this component if you customized its look and feed.
    16 | Borders have been redefined to fix a bug under Firefox. 17 | The component CSS styles have been slightly modified :
    18 |
      19 |
    • .exanpe-acc : Removed "border-top: 1px solid #CCCCCC;" and add "border-bottom: 1px solid #CCCCCC;" instead
    • 20 |
    • .exanpe-acc .acc-title : line-height changed from 25px to 23px
    • 21 |
    • .exanpe-acc .acc-header : Add "border-top: 1px solid #CCCCCC;"
    • 22 |
    • .exanpe-acc .acc-content : Removed border-bottom, cause of a bug
    • 23 |
    • .exanpe-acc ul li .acc-title a : Add "border-top: 1px solid #CCCCCC;"
    • 24 |
    • Customize the class : .exanpe-acc ul li.opened .acc-title{ border-bottom: 1px solid #CCCCCC; }
    • 25 |
    26 | 27 |

    Menu

    28 | A migration have to be performed on this component if you customized its look and feed.
    29 | Icon have been fixed on menubar item when submenu is present : 30 |
      31 |
    • .exanpe-menu .yuimenubaritemlabel-hassubmenu : Renamed to .exanpe-menu .yuimenubaritem-hassubmenu
    • 32 |
    • .exanpe-menu .yuimenubaritem-hassubmenu : Deleted padding-right: 20px;
    • 33 |
    • Added : .exanpe-menu .yuimenubaritem-selected.yuimenubaritem-hassubmenu-selected { 34 | background: url("../img/menu/menubaritem-hassubmenu.png") 100% center no-repeat #E2E2E2; 35 | }
    • 36 |
    37 |
    38 | 39 |
    40 |

    No migration

    41 |
    42 | 43 | 44 | 45 |
    -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/AuthorizeMixinTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import org.apache.tapestry5.ioc.annotations.Inject; 20 | import org.springframework.context.ApplicationContext; 21 | import org.springframework.security.authentication.AuthenticationManager; 22 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 23 | import org.springframework.security.core.Authentication; 24 | import org.springframework.security.core.context.SecurityContextHolder; 25 | 26 | public class AuthorizeMixinTest 27 | { 28 | 29 | @Inject 30 | private ApplicationContext applicationContext; 31 | 32 | private AuthenticationManager authenticationManager; 33 | 34 | void onActivate() 35 | { 36 | authenticationManager = (AuthenticationManager) applicationContext.getBean(applicationContext.getBeanNamesForType(AuthenticationManager.class)[0]); 37 | } 38 | 39 | public void onActionFromUser() 40 | { 41 | 42 | authenticate("USER"); 43 | } 44 | 45 | public void onActionFromAdmin() 46 | { 47 | authenticate("ADMIN"); 48 | } 49 | 50 | public void onActionFromNone() 51 | { 52 | authenticate("NONE"); 53 | } 54 | 55 | private void authenticate(String role) 56 | { 57 | Authentication request = new UsernamePasswordAuthenticationToken(role, role); 58 | Authentication result = authenticationManager.authenticate(request); 59 | SecurityContextHolder.getContext().setAuthentication(result); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/services/ExanpeComponentService.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.services; 18 | 19 | import org.apache.commons.lang.StringUtils; 20 | import org.apache.tapestry5.ComponentResources; 21 | import org.apache.tapestry5.dom.Element; 22 | 23 | /** 24 | * Service for exanpe component 25 | * 26 | * @author jmaupoux 27 | */ 28 | public class ExanpeComponentService 29 | { 30 | private static final String CSS_CLASS_ATTRIBUTE = "class"; 31 | 32 | public void reorderCSSClassDeclaration(Element e, String componentRootCssClass) 33 | { 34 | String customCSSClass = e.getAttribute(CSS_CLASS_ATTRIBUTE); 35 | 36 | if (StringUtils.isNotEmpty(customCSSClass)) 37 | { 38 | String cssclasses = componentRootCssClass + " " + customCSSClass; 39 | e.forceAttributes(CSS_CLASS_ATTRIBUTE, cssclasses); 40 | } 41 | else 42 | { 43 | e.attribute(CSS_CLASS_ATTRIBUTE, componentRootCssClass); 44 | } 45 | } 46 | 47 | /** 48 | * Get a message by escalade from the resources as parameter 49 | * 50 | * @param resources 51 | * @param key 52 | * @return the message, of null if not found 53 | */ 54 | public String getEscaladeMessage(ComponentResources resources, String key) 55 | { 56 | if (resources == null) 57 | return null; 58 | if (!resources.getMessages().contains(key)) 59 | return getEscaladeMessage(resources.getContainerResources(), key); 60 | return resources.getMessages().get(key); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/components/Border.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.components; 18 | 19 | import org.apache.tapestry5.ComponentResources; 20 | import org.apache.tapestry5.MarkupWriter; 21 | import org.apache.tapestry5.annotations.AfterRender; 22 | import org.apache.tapestry5.annotations.BeginRender; 23 | import org.apache.tapestry5.annotations.Import; 24 | import org.apache.tapestry5.annotations.SupportsInformalParameters; 25 | import org.apache.tapestry5.dom.Element; 26 | import org.apache.tapestry5.ioc.annotations.Inject; 27 | 28 | import fr.exanpe.t5.lib.services.ExanpeComponentService; 29 | 30 | /** 31 | * A simple border. No t:id required.
    32 | * The purpose of this component is to provide a border integrated to the graphic style. 33 | * CSS : This component is bound to a class exanpe-bor.
    34 | * 35 | * @author jmaupoux 36 | */ 37 | @Import(stylesheet = 38 | { "css/exanpe-t5-lib-core.css", "css/exanpe-t5-lib-skin.css" }) 39 | @SupportsInformalParameters 40 | public class Border 41 | { 42 | 43 | private static final String ROOT_CSS_CLASS = "exanpe-bor"; 44 | 45 | @Inject 46 | private ComponentResources resources; 47 | 48 | @Inject 49 | private ExanpeComponentService ecservice; 50 | 51 | @BeginRender 52 | void begin(MarkupWriter writer) 53 | { 54 | Element e = writer.element("div"); 55 | 56 | resources.renderInformalParameters(writer); 57 | 58 | ecservice.reorderCSSClassDeclaration(e, ROOT_CSS_CLASS); 59 | } 60 | 61 | @AfterRender 62 | void end(MarkupWriter writer) 63 | { 64 | writer.end(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/internal/authorize/AuthorizeWorker.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.internal.authorize; 18 | 19 | import java.util.List; 20 | 21 | import org.apache.tapestry5.model.MutableComponentModel; 22 | import org.apache.tapestry5.services.ClassTransformation; 23 | import org.apache.tapestry5.services.ComponentClassTransformWorker; 24 | import org.apache.tapestry5.services.TransformMethod; 25 | 26 | import fr.exanpe.t5.lib.annotation.Authorize; 27 | import fr.exanpe.t5.lib.services.AuthorizeBusinessService; 28 | 29 | /** 30 | * Worker applied on page invocation to control authorization.
    31 | * This worker simply restrict access of pages along with the user authorizations 32 | * 33 | * @author jmaupoux 34 | */ 35 | public class AuthorizeWorker implements ComponentClassTransformWorker 36 | { 37 | private final AuthorizeBusinessService authorizeBusinessService; 38 | 39 | public AuthorizeWorker(AuthorizeBusinessService abs) 40 | { 41 | this.authorizeBusinessService = abs; 42 | } 43 | 44 | public void transform(ClassTransformation transformation, MutableComponentModel model) 45 | { 46 | final List methods = transformation.matchMethodsWithAnnotation(Authorize.class); 47 | 48 | if (methods.isEmpty()) 49 | return; 50 | 51 | for (final TransformMethod method : methods) 52 | { 53 | Authorize annot = method.getAnnotation(Authorize.class); 54 | 55 | method.addAdvice(new ComponentAuthorizeAdvice(authorizeBusinessService, annot.any(), annot.all(), annot.not())); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/AuthorizeTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import org.apache.tapestry5.Block; 20 | import org.apache.tapestry5.annotations.Property; 21 | import org.apache.tapestry5.ioc.annotations.Inject; 22 | import org.springframework.context.ApplicationContext; 23 | import org.springframework.security.authentication.AuthenticationManager; 24 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 25 | import org.springframework.security.core.Authentication; 26 | import org.springframework.security.core.context.SecurityContextHolder; 27 | 28 | public class AuthorizeTest 29 | { 30 | 31 | @Inject 32 | private ApplicationContext applicationContext; 33 | 34 | private AuthenticationManager authenticationManager; 35 | 36 | @Inject 37 | @Property 38 | private Block externalblock; 39 | 40 | void onActivate() 41 | { 42 | authenticationManager = (AuthenticationManager) applicationContext.getBean(applicationContext.getBeanNamesForType(AuthenticationManager.class)[0]); 43 | } 44 | 45 | public void onActionFromUser() 46 | { 47 | 48 | authenticate("USER"); 49 | } 50 | 51 | public void onActionFromAdmin() 52 | { 53 | authenticate("ADMIN"); 54 | } 55 | 56 | public void onActionFromNone() 57 | { 58 | authenticate("NONE"); 59 | } 60 | 61 | private void authenticate(String role) 62 | { 63 | Authentication request = new UsernamePasswordAuthenticationToken(role, role); 64 | Authentication result = authenticationManager.authenticate(request); 65 | SecurityContextHolder.getContext().setAuthentication(result); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/model/GMapInternalModel.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.model; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | import fr.exanpe.t5.lib.model.gmap.GMapMarkerModel; 23 | import fr.exanpe.t5.lib.model.gmap.GMapPolyPointModel; 24 | 25 | /** 26 | * GMap internal model to transmit data between items and map 27 | * 28 | * @author lguerin 29 | */ 30 | public class GMapInternalModel 31 | { 32 | /** 33 | * Map unique Id 34 | */ 35 | private String mapId; 36 | 37 | /** 38 | * List of GMap Markers 39 | */ 40 | private List markers = new ArrayList(); 41 | 42 | /** 43 | * List of GMap Polyline points 44 | */ 45 | private List polyPoints = new ArrayList(); 46 | 47 | public List getMarkers() 48 | { 49 | return markers; 50 | } 51 | 52 | public void setMarkers(List markers) 53 | { 54 | this.markers = markers; 55 | } 56 | 57 | public List getPolyPoints() 58 | { 59 | return polyPoints; 60 | } 61 | 62 | public void setPolyPoints(List polyPoints) 63 | { 64 | this.polyPoints = polyPoints; 65 | } 66 | 67 | public void addMarker(GMapMarkerModel marker) 68 | { 69 | markers.add(marker); 70 | } 71 | 72 | public void addPolyPoint(GMapPolyPointModel point) 73 | { 74 | polyPoints.add(point); 75 | } 76 | 77 | public String getMapId() 78 | { 79 | return mapId; 80 | } 81 | 82 | public void setMapId(String mapId) 83 | { 84 | this.mapId = mapId; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/LoggerTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import java.util.List; 20 | 21 | import org.apache.tapestry5.SelectModel; 22 | import org.apache.tapestry5.ValueEncoder; 23 | import org.apache.tapestry5.annotations.OnEvent; 24 | import org.apache.tapestry5.annotations.Property; 25 | import org.apache.tapestry5.annotations.SetupRender; 26 | import org.apache.tapestry5.ioc.annotations.Inject; 27 | import org.apache.tapestry5.services.SelectModelFactory; 28 | 29 | import exanpe.t5.lib.demo.bean.Country; 30 | import exanpe.t5.lib.demo.encoders.CountryEncoder; 31 | import exanpe.t5.lib.demo.services.DataService; 32 | import fr.exanpe.t5.lib.constants.ExanpeEventConstants; 33 | 34 | public class LoggerTest 35 | { 36 | @Inject 37 | private SelectModelFactory selectModelFactory; 38 | 39 | @Property 40 | private SelectModel countryModel; 41 | 42 | @Property 43 | private String countryValue; 44 | 45 | @Inject 46 | private DataService dataService; 47 | 48 | @SetupRender 49 | public void ini() 50 | { 51 | // invoke my service to find all countries, e.g. in the database 52 | List countries = dataService.getCountryList(); 53 | 54 | // create a SelectModel from my list of countries 55 | countryModel = selectModelFactory.create(countries, "name"); 56 | } 57 | 58 | @OnEvent(value = ExanpeEventConstants.SELECTLOADER_EVENT) 59 | public SelectModel populateSelect(String value) 60 | { 61 | throw new IllegalArgumentException("log me that"); 62 | } 63 | 64 | public ValueEncoder getCountryEncoder() 65 | { 66 | return new CountryEncoder(dataService); 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/constants/ExanpeSymbols.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | /** 18 | * 19 | */ 20 | package fr.exanpe.t5.lib.constants; 21 | 22 | import org.apache.tapestry5.ioc.annotations.Symbol; 23 | 24 | import fr.exanpe.t5.lib.annotation.ContextPageReset; 25 | 26 | /** 27 | * Exanpe custom {@link Symbol} elements. 28 | * 29 | * @author lguerin 30 | */ 31 | public class ExanpeSymbols 32 | { 33 | /** 34 | * Base path for Exanpe asset contents. 35 | */ 36 | public static final String ASSET_BASE = "exanpe.asset-base"; 37 | 38 | /** 39 | * Base YUI location
    40 | * Override to import your own distribution of YUI.
    41 | * The base must be defined according to the yui/build root folder in the distribution.
    42 | * Example : if base is "com/test", then the path "com/test/yahoo-dom-event/yahoo-dom-event.js" 43 | * HAS to exists. 44 | */ 45 | public static final String YUI2_BASE = "exanpe.yui2-base"; 46 | 47 | /** 48 | * Context page reset marker in URL.
    49 | * Default is reset. 50 | * When CONTEXT_PAGE_RESET_MARKER will be found in the URL, it will be removed from context and 51 | * will trigger the methods annotated with {@link ContextPageReset} or with signature 52 | * "void contextReset()" 53 | * 54 | * @see ContextPageReset 55 | */ 56 | public static final String CONTEXT_PAGE_RESET_MARKER = "exanpe.context-page-reset-marker"; 57 | 58 | /** 59 | * Google Maps API V3 - Business client ID 60 | */ 61 | public static final String GMAP_V3_BUSINESS_CLIENT_ID = "exanpe.gmap-v3-client-id"; 62 | 63 | /** 64 | * Google Maps API V3 - version 65 | */ 66 | public static final String GMAP_V3_VERSION = "exanpe.gmap-v3-version"; 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/components/SlideShowItem.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.components; 18 | 19 | import org.apache.tapestry5.Asset; 20 | import org.apache.tapestry5.BindingConstants; 21 | import org.apache.tapestry5.annotations.Parameter; 22 | import org.apache.tapestry5.annotations.Property; 23 | import org.apache.tapestry5.annotations.SetupRender; 24 | import org.apache.tapestry5.ioc.annotations.Inject; 25 | import org.apache.tapestry5.services.Environment; 26 | 27 | import fr.exanpe.t5.lib.model.SlideShowInternalModel; 28 | 29 | /** 30 | * Item displayed inside a {@link SlideShow}.
    31 | * The content of this item can be either an image with its associated title or the body of the 32 | * component.
    33 | * 34 | * @see SlideShow 35 | * @author jmaupoux 36 | */ 37 | public class SlideShowItem 38 | { 39 | 40 | /** 41 | * Image displayed as part of the item 42 | */ 43 | @Property 44 | @Parameter(required = false, defaultPrefix = BindingConstants.ASSET) 45 | @SuppressWarnings("unused") 46 | private Asset image; 47 | 48 | /** 49 | * Title of the image displayed as part of the item 50 | */ 51 | @Property 52 | @Parameter(required = false, defaultPrefix = BindingConstants.MESSAGE) 53 | @SuppressWarnings("unused") 54 | private String title; 55 | 56 | @Inject 57 | private Environment environment; 58 | 59 | @Property 60 | @SuppressWarnings("unused") 61 | private int height; 62 | 63 | @SetupRender 64 | public void validate() 65 | { 66 | SlideShowInternalModel marker = environment.peek(SlideShowInternalModel.class); 67 | 68 | if (marker == null) { throw new IllegalStateException("SlideShowItem must be nested into a SlideShow component"); } 69 | 70 | height = marker.getHeight(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/Index.tml: -------------------------------------------------------------------------------- 1 | 2 |
      3 |
    • Accordion
    • 4 |
    • HideablePanel
    • 5 |
    • SecurePassword
    • 6 |
    • Border
    • 7 |
    • Slider
    • 8 |
    • SlideShow
    • 9 |
    • TabView
    • 10 |
    • TapestrySkin
    • 11 |
    • Tooltip
    • 12 |
    • Dialog
    • 13 |
    • AjaxLoader
    • 14 |
    • ColorPicker
    • 15 |
    • SelectLoader
    • 16 |
    • Menu
    • 17 |
    • PasswordStrengthChecker
    • 18 |
    • AjaxValidation
    • 19 |
    • VerticalMenu
    • 20 |
    • Authorize
    • 21 |
    • AuthorizeMixin
    • 22 |
    • AuthorizeAnnotationTest
    • 23 |
    • GoogleMap
    • 24 |
    • ListSorter
    • 25 |
    • RichTextEditor
    • 26 |
    • ContextPageReset
    • 27 |
    • LocaleSession
    • 28 |
    • BinaryImg
    • 29 |
    • Resizable
    • 30 |
    31 |
    32 |
      33 |
    • AccordionBug
    • 34 |
    35 |
    36 | -------------------------------------------------------------------------------- /src/site/xdoc/getting_started.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Getting Started - Exanpe T5 Lib 8 | Exanpe 9 | 10 | 11 | 12 | 13 |
    14 | Use of the library requires nothing more than a standard Tapestry 5 application : 15 |
      16 |
    • Java 1.5 (as Tapestry 5 do)
    • 17 |
    • Tapestry 5.2.x or 5.3.x
    • 18 |
    • Maven 2+
    • 19 |
    • Internet Explorer 7+ / Firefox 3.5+ / Chrome 13+ / Safari 5+
    • 20 |
    21 |
    22 | 23 |
    24 | 25 |

    26 | Setting up exanpe-t5-lib requires 2 minutes :
    27 |

    28 |
      29 |
    • Open the pom.xml in your library project
    • 30 |
    • Declare a Tapestry 5 dependency (obviously we do not import one)
    • 31 |
    • Paste the following configuration is your Maven descriptor : 32 | 33 | 34 | 36 | fr.exanpe 37 | exanpe-t5-lib 38 | ${project.version} 39 | 40 | ]]> 41 | 42 |
    • 43 |
    • 44 | Annotate your Module class with : 45 | 46 | @SubModule(ExanpeLibraryModule.class) 47 | 48 |
    • 49 |
    50 | 51 |
    52 | 53 |
    54 | The TML integration is as simple as the previous step.
    55 | Open your TML and add in the root tag :
    56 | 57 | 59 | ]]> 60 | 61 | 62 |
    63 | 64 |
    65 | Your are now ready to take advantage of all the components provided by the library
    66 | Have a look at our Demo and at the Reference page detailing each component usage. 67 |
    68 | 69 | 70 | 71 |
    72 | -------------------------------------------------------------------------------- /src/site/xdoc/user_guide.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Architecture - Exanpe T5 Lib 8 | Exanpe 9 | 10 | 11 | 12 | 13 |
    14 | Here are some rules that you should seriously respect to avoid any problem using the library : 15 |
      16 |
    • To all components (except Border), define an id using the t:id attribute.
    • 17 |
    • Two css files are present : a core one and skin one. 18 | Although the attributes defined in the skin file can be overridden without impacting the component layout, we do not guarantee any modification in the core one.
    • 19 |
    20 |
    21 | 22 |
    23 | A strict relationship between the different languages was established to design each component, to ensure coherence and increase the development process.
    24 | Based on the t:id given to the component, here are the norms you can rely on :
    25 |
      26 |
    • 27 | If a JavaScript class is defined for the component, an instance is available through the id provided, allowing action on the component via JavaScript. 28 |
    • 29 |
    • If the JavaScript component uses a YUI one, the YUI instance is available through a yui var contained inside the JavaScript Exanpe component instance
    • 30 |
    • The root HTML tag id is the id given to the component.
    • 31 |
    • Some parameters of the components can be automatically injected via properties files, based on the component id suffixed (see each component documentation).
    • 32 |
    33 |
    34 | 35 |
    36 | CSS properties have been split between core ones (deciding the positionning) and skin ones (declaring the rendering).
    37 | Two CSS files are present : 38 |
      39 |
    • exanpe-t5-lib-core.css
    • 40 |
    • exanpe-t5-lib-skin.css
    • 41 |
    42 | To customize our components rendering, we strongly advise you to check the skin file and override any of the CSS class that match your needs. 43 |
    44 | 45 | 46 |
    47 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/PasswordStrengthCheckerTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | /** 18 | * 19 | */ 20 | package exanpe.t5.lib.demo.pages.comp; 21 | 22 | import org.apache.tapestry5.EventConstants; 23 | import org.apache.tapestry5.annotations.ActivationRequestParameter; 24 | import org.apache.tapestry5.annotations.Import; 25 | import org.apache.tapestry5.annotations.OnEvent; 26 | import org.apache.tapestry5.annotations.Property; 27 | 28 | import fr.exanpe.t5.lib.constants.ExanpeEventConstants; 29 | import fr.exanpe.t5.lib.constants.PasswordStrengthCheckerTypeEnum; 30 | import fr.exanpe.t5.lib.mixins.PasswordStrengthChecker; 31 | 32 | /** 33 | * The demo page for the {@link PasswordStrengthChecker} mixin. 34 | * 35 | * @author lguerin 36 | */ 37 | @Import(library = "PasswordStrengthCheckerTest.js") 38 | public class PasswordStrengthCheckerTest 39 | { 40 | @ActivationRequestParameter("param1") 41 | private String param1; 42 | 43 | @Property 44 | private String pwd; 45 | 46 | @Property 47 | private String pwd2; 48 | 49 | @Property 50 | private String password; 51 | 52 | @OnEvent(value = EventConstants.ACTIVATE) 53 | void init() 54 | { 55 | System.out.println("Activation request param: " + param1); 56 | } 57 | 58 | @OnEvent(value = ExanpeEventConstants.PASSWORDSTRENGTHCHECKER_EVENT) 59 | PasswordStrengthCheckerTypeEnum checkPassword(String pwd) 60 | { 61 | System.out.println("Check password:" + pwd); 62 | Integer size = pwd.length(); 63 | PasswordStrengthCheckerTypeEnum result = PasswordStrengthCheckerTypeEnum.VERYWEAK; 64 | if (size >= 5) 65 | { 66 | result = PasswordStrengthCheckerTypeEnum.WEAK; 67 | } 68 | if (size >= 6) 69 | { 70 | result = PasswordStrengthCheckerTypeEnum.STRONG; 71 | } 72 | if (size >= 7) 73 | { 74 | result = PasswordStrengthCheckerTypeEnum.STRONGEST; 75 | } 76 | return result; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/constants/ExanpeEventConstants.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | /** 18 | * 19 | */ 20 | package fr.exanpe.t5.lib.constants; 21 | 22 | import org.apache.tapestry5.SelectModel; 23 | 24 | import fr.exanpe.t5.lib.components.AjaxLoader; 25 | import fr.exanpe.t5.lib.components.Slider; 26 | import fr.exanpe.t5.lib.components.VerticalMenu; 27 | import fr.exanpe.t5.lib.mixins.AjaxValidation; 28 | import fr.exanpe.t5.lib.mixins.PasswordStrengthChecker; 29 | import fr.exanpe.t5.lib.mixins.SelectLoader; 30 | 31 | /** 32 | * This class contains the events triggered by the Exanpe T5 Lib. 33 | * 34 | * @author lguerin 35 | */ 36 | public class ExanpeEventConstants 37 | { 38 | /** 39 | * Event triggered when the {@link Slider} component is used. 40 | */ 41 | public static final String SLIDER_EVENT = "sliderEventAction"; 42 | 43 | /** 44 | * Event triggered when {@link AjaxLoader} load a content. 45 | */ 46 | public static final String AJAXLOADER_EVENT = "ajaxLoaderAction"; 47 | 48 | /** 49 | * Event triggered when load a {@link SelectLoader} content.
    50 | * A method handling this event have to return a class of type {@link SelectModel} 51 | */ 52 | public static final String SELECTLOADER_EVENT = "selectLoaderAction"; 53 | 54 | /** 55 | * Event triggered when {@link PasswordStrengthChecker} validate a password.
    56 | * A method handling this event have to return a class of type 57 | * {@link PasswordStrengthCheckerTypeEnum} 58 | */ 59 | public static final String PASSWORDSTRENGTHCHECKER_EVENT = "passwordStrengthCheckerAction"; 60 | 61 | /** 62 | * Event triggered when validating from a {@link AjaxValidation} mixin.
    63 | * A method handling this event have to return a class of type {@link AjaxValidationResult} 64 | */ 65 | public static final String AJAXVALIDATION_EVENT = "ajaxValidationAction"; 66 | 67 | /** 68 | * Event triggered when a {@link VerticalMenu} item is selected. 69 | */ 70 | public static final String VERTICALMENU_EVENT = "selectVerticalMenuItem"; 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/SelectLoaderTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import java.util.List; 20 | 21 | import org.apache.tapestry5.SelectModel; 22 | import org.apache.tapestry5.ValueEncoder; 23 | import org.apache.tapestry5.annotations.OnEvent; 24 | import org.apache.tapestry5.annotations.Persist; 25 | import org.apache.tapestry5.annotations.Property; 26 | import org.apache.tapestry5.annotations.SetupRender; 27 | import org.apache.tapestry5.internal.OptionModelImpl; 28 | import org.apache.tapestry5.internal.SelectModelImpl; 29 | import org.apache.tapestry5.ioc.annotations.Inject; 30 | import org.apache.tapestry5.services.SelectModelFactory; 31 | 32 | import exanpe.t5.lib.demo.bean.Country; 33 | import exanpe.t5.lib.demo.encoders.CountryEncoder; 34 | import exanpe.t5.lib.demo.services.DataService; 35 | import fr.exanpe.t5.lib.constants.ExanpeEventConstants; 36 | 37 | public class SelectLoaderTest 38 | { 39 | @Inject 40 | private SelectModelFactory selectModelFactory; 41 | 42 | @Property 43 | private SelectModel countryModel; 44 | 45 | @Property 46 | private String countryValue; 47 | 48 | @Property 49 | @Persist 50 | private SelectModel cityModel; 51 | 52 | @Property 53 | private String cityValue; 54 | 55 | @Inject 56 | private DataService dataService; 57 | 58 | @SetupRender 59 | public void ini() 60 | { 61 | // invoke my service to find all countries, e.g. in the database 62 | List countries = dataService.getCountryList(); 63 | 64 | // create a SelectModel from my list of countries 65 | countryModel = selectModelFactory.create(countries, "name"); 66 | 67 | // init cityModel 68 | cityModel = new SelectModelImpl(new OptionModelImpl[0]); 69 | } 70 | 71 | @OnEvent(value = ExanpeEventConstants.SELECTLOADER_EVENT) 72 | public SelectModel populateSelect(String value) 73 | { 74 | cityModel = selectModelFactory.create(dataService.getCitiesFromCountry(value), "name"); 75 | return cityModel; 76 | } 77 | 78 | public ValueEncoder getCountryEncoder() 79 | { 80 | return new CountryEncoder(dataService); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/test/resources/exanpe/t5/lib/demo/pages/comp/MenuTest.tml: -------------------------------------------------------------------------------- 1 | 3 | 4 | Menubar test, with disabled elements and cat 4 not rendered :
    5 | 6 | 7 | Menu Test 8 | 9 | 10 | 11 | 12 | sub11 13 | 14 | 15 | Google Link 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | sub41 27 | 28 | 29 | Google Link 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | Index 42 | 43 | 44 | 45 | 46 | Google Link 47 | 48 | 49 | Google Link 50 | 51 | 52 | Google Link 53 | 54 | 55 | 56 | 57 | NOT RENDERED !!!!!!!!! 58 | 59 | 60 | 61 |
    62 | Menu test, with disabled elements and sub 3 not rendered :
    63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | NOT RENDERED !!!!!!!!! 86 | 87 | 88 | 89 |
    90 | -------------------------------------------------------------------------------- /src/changes/changes.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | Changes - Exanpe T5 Lib 6 | 7 | 8 | 9 | 10 | Fixed Contextual Menu position 11 | 12 | 13 | Added RichTextEditor mixin 14 | 15 | 16 | Added GoogleMap component and full set of markers 17 | 18 | 19 | Added LocaleSession service 20 | 21 | 22 | Added ListSorter component 23 | 24 | 25 | Added @ContextPageReset service 26 | 27 | 28 | Added full set of Authorization services (@Authorize) 29 | 30 | 31 | Fixing Accordion render bug 32 | 33 | 34 | Fixing MenuBar render bug 35 | 36 | 37 | 38 | 39 | TLD available for Eclipse development (see FAQ) 40 | 41 | 42 | Validated as Tapestry 5.3.0 compliant 43 | 44 | 45 | Added the AjaxValidation mixin 46 | 47 | 48 | Updated the Dialog mixin with rich render 49 | 50 | 51 | Added MenuBar and Menu components 52 | 53 | 54 | Added VerticalMenu component 55 | 56 | 57 | Added PasswordStrengthChecker mixin 58 | 59 | 60 | Added JavaScript events handler 61 | 62 | 63 | 64 | 65 | 66 | Initialization of the first version of the library 67 | 68 | 69 | Initialization of the first version of the library 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/main/java/fr/exanpe/t5/lib/services/impl/AuthorizeBusinessServiceImpl.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package fr.exanpe.t5.lib.services.impl; 18 | 19 | import org.apache.commons.lang.ArrayUtils; 20 | import org.apache.tapestry5.ioc.annotations.Inject; 21 | import org.apache.tapestry5.services.RequestGlobals; 22 | 23 | import fr.exanpe.t5.lib.services.AuthorizeBusinessService; 24 | 25 | /** 26 | * Implementation of the interface {@link AuthorizeBusinessService} 27 | * 28 | * @author jmaupoux 29 | */ 30 | public class AuthorizeBusinessServiceImpl implements AuthorizeBusinessService 31 | { 32 | @Inject 33 | private RequestGlobals request; 34 | 35 | /* 36 | * (non-Javadoc) 37 | * @see fr.exanpe.t5.lib.services.AuthorizeBusinessService#applyAny(java.lang.String[]) 38 | */ 39 | public boolean applyAny(String[] any) 40 | { 41 | if (ArrayUtils.isEmpty(any)) { return true; } 42 | 43 | String[] roles = any; 44 | for (String r : roles) 45 | { 46 | if (r != null && request.getHTTPServletRequest().isUserInRole(r.trim())) { return true; } 47 | } 48 | 49 | return false; 50 | } 51 | 52 | /* 53 | * (non-Javadoc) 54 | * @see fr.exanpe.t5.lib.services.AuthorizeBusinessService#applyAll(java.lang.String[]) 55 | */ 56 | public boolean applyAll(String[] all) 57 | { 58 | if (ArrayUtils.isEmpty(all)) { return true; } 59 | 60 | String[] roles = all; 61 | for (String r : roles) 62 | { 63 | if (r != null && !request.getHTTPServletRequest().isUserInRole(r.trim())) { return false; } 64 | } 65 | 66 | return true; 67 | } 68 | 69 | /* 70 | * (non-Javadoc) 71 | * @see fr.exanpe.t5.lib.services.AuthorizeBusinessService#applyNot(java.lang.String[]) 72 | */ 73 | public boolean applyNot(String[] not) 74 | { 75 | if (ArrayUtils.isEmpty(not)) { return true; } 76 | 77 | String[] roles = not; 78 | for (String r : roles) 79 | { 80 | if (r != null && request.getHTTPServletRequest().isUserInRole(r.trim())) { return false; } 81 | } 82 | 83 | return true; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/test/java/exanpe/t5/lib/demo/pages/comp/AuthorizeAnnotationTest.java: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2011 EXANPE 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | package exanpe.t5.lib.demo.pages.comp; 18 | 19 | import org.apache.tapestry5.EventConstants; 20 | import org.apache.tapestry5.PersistenceConstants; 21 | import org.apache.tapestry5.annotations.OnEvent; 22 | import org.apache.tapestry5.annotations.Persist; 23 | import org.apache.tapestry5.annotations.Property; 24 | import org.apache.tapestry5.ioc.annotations.Inject; 25 | import org.springframework.context.ApplicationContext; 26 | import org.springframework.security.authentication.AuthenticationManager; 27 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 28 | import org.springframework.security.core.Authentication; 29 | import org.springframework.security.core.context.SecurityContextHolder; 30 | 31 | import fr.exanpe.t5.lib.annotation.Authorize; 32 | 33 | public class AuthorizeAnnotationTest 34 | { 35 | 36 | @Inject 37 | private ApplicationContext applicationContext; 38 | 39 | private AuthenticationManager authenticationManager; 40 | 41 | void onActivate() 42 | { 43 | authenticationManager = (AuthenticationManager) applicationContext.getBean(applicationContext.getBeanNamesForType(AuthenticationManager.class)[0]); 44 | } 45 | 46 | public void onActionFromUser() 47 | { 48 | 49 | authenticate("USER"); 50 | } 51 | 52 | public void onActionFromAdmin() 53 | { 54 | authenticate("ADMIN"); 55 | } 56 | 57 | private void authenticate(String role) 58 | { 59 | Authentication request = new UsernamePasswordAuthenticationToken(role, role); 60 | Authentication result = authenticationManager.authenticate(request); 61 | SecurityContextHolder.getContext().setAuthentication(result); 62 | } 63 | 64 | @Persist(PersistenceConstants.FLASH) 65 | @Property 66 | private String roleInvoked; 67 | 68 | @Authorize(all = "ROLE_USER") 69 | @OnEvent(value = EventConstants.ACTION, component = "act") 70 | public void invokeUser() 71 | { 72 | roleInvoked = "USER"; 73 | } 74 | 75 | @Authorize(all = "ROLE_ADMIN") 76 | @OnEvent(value = EventConstants.ACTION, component = "act") 77 | public void invokeAdmin() 78 | { 79 | roleInvoked = "ADMIN"; 80 | } 81 | 82 | } 83 | --------------------------------------------------------------------------------