29 |
30 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/java/BasePage.java:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | import java.util.Date;
4 |
5 | import fiftyfive.wicket.shiro.markup.AuthenticationStatusPanel;
6 | import org.apache.wicket.datetime.markup.html.basic.DateLabel;
7 | import org.apache.wicket.markup.html.panel.FeedbackPanel;
8 | import org.apache.wicket.model.Model;
9 | import org.apache.wicket.request.mapper.parameter.PageParameters;
10 |
11 | /**
12 | * The common page template for this application, including a standard header and footer.
13 | * Special pages that do not require these common elements (like the login page and error
14 | * pages) should extend from {@link EmptyPage} instead.
15 | *
16 | * This template establishes its layout using a responsive
17 | * CSS Grid.
18 | * It can be useful to develop your application at first using such a grid
19 | * (in other words, do rapid prototyping). Later you can revise this markup to match your
20 | * design requirements.
21 | *
22 | * Note that this base class does not provide a page {@code
}. It is up to each
23 | * individual page to provide one, using {@code }.
24 | */
25 | public class BasePage extends EmptyPage
26 | {
27 | public BasePage()
28 | {
29 | this(null);
30 | }
31 |
32 | public BasePage(PageParameters params)
33 | {
34 | super(params);
35 |
36 | // Login/logout link
37 | add(new AuthenticationStatusPanel("authStatus"));
38 |
39 | // For general "you have been logged out", etc. messages
40 | add(new FeedbackPanel("feedback"));
41 |
42 | // Copyright year in footer
43 | add(DateLabel.forDatePattern("year", Model.of(new Date()), "yyyy"));
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/java/EmptyPage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
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 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/java/EmptyPage.js:
--------------------------------------------------------------------------------
1 | //= require jquery
2 | //= require 55_utils
3 |
4 | // If browser is a flavor of IE, add an appropriate class to the html element.
5 | // This allows conditional styling for IE.
6 | (function($) {
7 | $(function() {
8 | $("html").addClass(fiftyfive.util.getIEClass());
9 | });
10 | })(jQuery);
11 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/java/WicketMappings.java:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | import ${package}.admin.AdministrationPage;
4 | import ${package}.error.ForbiddenErrorPage;
5 | import ${package}.error.InternalServerErrorPage;
6 | import ${package}.error.NotFoundErrorPage;
7 | import ${package}.home.HomePage;
8 |
9 | import fiftyfive.wicket.js.MergedJavaScriptBuilder;
10 | import fiftyfive.wicket.mapper.PatternMountedMapper;
11 |
12 | import org.apache.wicket.Page;
13 | import org.apache.wicket.protocol.http.WebApplication;
14 | import org.apache.wicket.request.mapper.CompoundRequestMapper;
15 |
16 |
17 | /**
18 | * All custom mappings (in other words, "mount points" or "routes")
19 | * for ${project_name}.
20 | * This includes merged JavaScript and pretty URLs for all bookmarkable pages.
21 | */
22 | public class WicketMappings extends CompoundRequestMapper
23 | {
24 | public WicketMappings(WebApplication app)
25 | {
26 | // Pretty URLs for bookmarkable pages
27 | addPage("admin", AdministrationPage.class);
28 | addPage("error/403", ForbiddenErrorPage.class);
29 | addPage("error/404", NotFoundErrorPage.class);
30 | addPage("error/500", InternalServerErrorPage.class);
31 |
32 | // Common JavaScript merged together and mapped to scripts/all.js
33 | add(new MergedJavaScriptBuilder()
34 | .setPath("/scripts/all.js")
35 | .addLibrary("55_utils")
36 | .addLibrary("dump")
37 | // .addLibrary("cookies")
38 | // .addLibrary("strftime")
39 | .addJQueryUI()
40 | .addLibrary("jquery.55_utils")
41 | // .addLibrary("jquery.ui.forminputplaceholdertext")
42 | .addAssociatedScript(EmptyPage.class)
43 | .addWicketAjaxLibraries()
44 | .buildRequestMapper(app));
45 | }
46 |
47 | private void addPage(String path, Class extends Page> page)
48 | {
49 | add(new PatternMountedMapper(path, page).setExact(true));
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/java/WicketSession.java:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | import org.apache.wicket.Session;
4 | import org.apache.wicket.protocol.http.IRequestLogger.ISessionLogInfo;
5 | import org.apache.wicket.protocol.http.WebSession;
6 | import org.apache.wicket.request.Request;
7 |
8 | /**
9 | * Session information for ${project_name}.
10 | * Any variables added to this class will automatically be persisted in
11 | * the Servlet HttpSession. Each browser session gets its own instance of
12 | * this class.
13 | */
14 | public class WicketSession extends WebSession implements ISessionLogInfo
15 | {
16 | /**
17 | * Returns the instance of {@code WicketSession} associated with
18 | * the current request. This method only works inside a Wicket thread.
19 | */
20 | public static WicketSession get()
21 | {
22 | return (WicketSession) Session.get();
23 | }
24 |
25 | public WicketSession(Request request)
26 | {
27 | super(request);
28 | }
29 |
30 | /**
31 | * Additional information about this session that will automatically
32 | * be included in Wicket's request log, as well in troubleshooting
33 | * information emitted by
34 | * {@link fiftyfive.wicket.util.LoggingUtils LoggingUtils}.
35 | * Consider including things like username, if authenticated.
36 | */
37 | public Object getSessionInfo()
38 | {
39 | return "TODO: Your session info goes here";
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/java/admin/AdministrationPage.html:
--------------------------------------------------------------------------------
1 |
2 | Administration Page
3 |
4 |
5 |
6 |
7 |
Administration Page
8 |
Something top secret goes here!
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/java/admin/AdministrationPage.java:
--------------------------------------------------------------------------------
1 | package ${package}.admin;
2 |
3 | import ${package}.BasePage;
4 | import static fiftyfive.wicket.util.Shortcuts.*;
5 | import org.apache.shiro.authz.annotation.RequiresAuthentication;
6 | import org.apache.shiro.authz.annotation.RequiresRoles;
7 |
8 | /**
9 | * An example of a page that is secured via Shiro annotations.
10 | * This page can only be accessed by an authenticated user that has the "admin" role.
11 | */
12 | @RequiresAuthentication
13 | @RequiresRoles("admin")
14 | public class AdministrationPage extends BasePage
15 | {
16 | public AdministrationPage()
17 | {
18 | super();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/java/error/BaseErrorPage.java:
--------------------------------------------------------------------------------
1 | package ${package}.error;
2 |
3 | import ${package}.EmptyPage;
4 | import static fiftyfive.wicket.util.Shortcuts.*;
5 | import org.apache.wicket.request.http.WebResponse;
6 |
7 | /**
8 | * Base class for custom error pages.
9 | */
10 | public abstract class BaseErrorPage extends EmptyPage
11 | {
12 | /**
13 | * Error pages are not bookmarkable, hence no PageParameters.
14 | */
15 | protected BaseErrorPage()
16 | {
17 | super(null);
18 | getBody().add(cssClass("server-error"));
19 | }
20 |
21 | /**
22 | * Subclasses must implement to provide the HTTP status error code.
23 | * For example, 404 for the {@link NotFoundErrorPage}.
24 | */
25 | protected abstract int getErrorCode();
26 |
27 | /**
28 | * Make sure we emit the proper HTTP status.
29 | */
30 | @Override
31 | protected void configureResponse(final WebResponse response)
32 | {
33 | super.configureResponse(response);
34 | response.setStatus(getErrorCode());
35 | }
36 |
37 | /**
38 | * Returns {@code true}.
39 | */
40 | @Override
41 | public boolean isErrorPage()
42 | {
43 | return true;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/java/error/ForbiddenErrorPage.html:
--------------------------------------------------------------------------------
1 |
2 | 403 Forbidden
3 |
4 |
5 |
403 Forbidden
6 |
7 | TODO: Customize this page. (ForbiddenErrorPage.html)
8 |
35 |
36 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/java/security/LoginPage.java:
--------------------------------------------------------------------------------
1 | package ${package}.security;
2 |
3 | import ${package}.EmptyPage;
4 | import fiftyfive.wicket.shiro.markup.LoginForm;
5 | import org.apache.wicket.markup.html.panel.FeedbackPanel;
6 |
7 | /**
8 | * A simple login page containing a {@link LoginForm} and {@link FeedbackPanel}
9 | * that uses HTML5 markup. Customize the look and feel to meet the needs of your app.
10 | */
11 | public class LoginPage extends EmptyPage
12 | {
13 | public LoginPage()
14 | {
15 | super();
16 | getBody().setMarkupId("login");
17 | add(new FeedbackPanel("feedback"));
18 | add(new LoginForm("login"));
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/WicketApplication.properties:
--------------------------------------------------------------------------------
1 | # Application-wide localized strings are placed in this file.
2 | # If, for example, you want to create a French localization, you would create a
3 | # WicketApplication_fr.properties for the French translations of these messages.
4 |
5 | # Uncomment to customize these
6 | # loginRequired = You need to be logged in to continue.
7 | # loggedOut = You have been logged out.
8 | # unauthorized = Sorry, you are not allowed to access that page.
9 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/__artifactId__-context.xml:
--------------------------------------------------------------------------------
1 | #set( $symbol_pound = '#' )
2 | #set( $symbol_dollar = '$' )
3 | #set( $symbol_escape = '\' )
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/__artifactId__.properties.SAMPLE:
--------------------------------------------------------------------------------
1 | #set( $symbol_pound = '#' )
2 | #set( $symbol_dollar = '$' )
3 | #set( $symbol_escape = '\' )
4 | $symbol_pound Environment-specific settings for ${project_name}.
5 |
6 | jdbc.username = sample
7 | jdbc.password = sample
8 | jdbc.url = sample
9 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/apple-touch-icon-large.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/apple-touch-icon-large.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/apple-touch-icon-medium.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/apple-touch-icon-medium.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/apple-touch-icon-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/apple-touch-icon-small.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/favicon.ico
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/favicon.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/icon/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/icon/error.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/icon/success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/icon/success.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/icon/warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/images/icon/warning.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/log4j.properties.SAMPLE:
--------------------------------------------------------------------------------
1 | log4j.rootLogger = WARN, console
2 | log4j.logger.${package} = DEBUG
3 | log4j.logger.org.apache.wicket.DefaultExceptionMapper = FATAL
4 | log4j.logger.org.apache.wicket.util.tester = INFO
5 |
6 | # Uncomment this line to enable detailed request logging and session stats.
7 | # log4j.logger.org.apache.wicket.protocol.http.RequestLogger = INFO
8 |
9 | log4j.appender.console = org.apache.log4j.ConsoleAppender
10 | log4j.appender.console.layout = org.apache.log4j.PatternLayout
11 | log4j.appender.console.layout.conversionPattern = [%-5p] [%c{1}] %m%n
12 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/scripts/README.txt:
--------------------------------------------------------------------------------
1 | Place your custom JavaScript files in this directory so that they can be
2 | referenced using sprockets syntax within your app. For example, if you place
3 | a file in this directory called "mylib.js", your Wicket components can
4 | reference it like this:
5 |
6 | add(new JavaScriptDependency("mylib"));
7 |
8 | And your JS files can depend on it like this:
9 |
10 | //= require mylib
11 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/shiro.ini:
--------------------------------------------------------------------------------
1 | #
2 | # Configuration of Apache Shiro security framework
3 | #
4 | # Please note that Wicket and Shiro work together to secure your application
5 | # through the use of annotations on Wicket pages and components. Wicket also
6 | # has built-in support for intercepting unauthorized access. Therefore this
7 | # INI file does not need to cover any web-specific actions, like applying
8 | # security rules based on URLs; those things are more appropriately done in
9 | # Wicket code.
10 | #
11 | # Instead, the primary purpose of this INI file is to configure the internals
12 | # of Shiro, namely the "realm" that peforms the actual user authentication.
13 | # In this trivial example we specify a realm that uses hard-coded passwords.
14 | # A real app would use something like JdbcRealm to authenticate against a
15 | # "users" table in a database.
16 | #
17 | # For further documention of this INI file, refer to:
18 | # http://shiro.apache.org/configuration.html#Configuration-INISections
19 |
20 |
21 | [users]
22 | # Format is: username = password, roleName1, roleName2, ..., roleNameN
23 | admin@mycompany.com = secret, admin
24 | testaccount@mycompany.com = test
25 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/1024.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------------
2 | | 1024.css
3 | | application name v1.0
4 | | Author(s): Richa Avasthi
5 | | Created: 2011-08-30
6 | |
7 | | Styles for displays 1024px wide and up. Note that only major layout changes,
8 | | like showing or hiding a sidebar, should be in these size-specific
9 | | stylesheets. Other, smaller changes may be added into feature-specific styles
10 | | using media queries. See _home.scss for an example.
11 | ------------------------------------------------------------------------------*/
12 |
13 | @import "compass/css3";
14 | // Include variables if needed.
15 | @import "colors";
16 | @import "typography";
17 | @import "grid";
18 | @import "mixins";
19 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/1200.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------------
2 | | 1200.css
3 | | application name v1.0
4 | | Author(s): Richa Avasthi
5 | | Created: 2011-08-30
6 | |
7 | | Styles for displays 1200px wide and up. Note that only major layout changes,
8 | | like showing or hiding a sidebar, should be in these size-specific
9 | | stylesheets. Other, smaller changes may be added into feature-specific styles
10 | | using media queries. See _home.scss for an example.
11 | ------------------------------------------------------------------------------*/
12 |
13 | @import "compass/css3";
14 | // Include variables if needed.
15 | @import "colors";
16 | @import "typography";
17 | @import "grid";
18 | @import "mixins";
19 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/480.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------------
2 | | 480.css
3 | | application name v1.0
4 | | Author(s): Richa Avasthi
5 | | Created: 2011-08-30
6 | |
7 | | Styles for displays 480px wide and up. Note that only major layout changes,
8 | | like showing or hiding a sidebar, should be in these size-specific
9 | | stylesheets. Other, smaller changes may be added into feature-specific styles
10 | | using media queries. See _home.scss for an example.
11 | ------------------------------------------------------------------------------*/
12 |
13 | @import "compass/css3";
14 | // Include variables if needed.
15 | @import "colors";
16 | @import "typography";
17 | @import "grid";
18 | @import "mixins";
19 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/768.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------------
2 | | 768.css
3 | | application name v1.0
4 | | Author(s): Richa Avasthi
5 | | Created: 2011-08-30
6 | |
7 | | Styles for displays 768px wide and up. Note that only major layout changes,
8 | | like showing or hiding a sidebar, should be in these size-specific
9 | | stylesheets. Other, smaller changes may be added into feature-specific styles
10 | | using media queries. See _home.scss for an example.
11 | ------------------------------------------------------------------------------*/
12 |
13 | @import "compass/css3";
14 | // Include variables if needed.
15 | @import "colors";
16 | @import "typography";
17 | @import "grid";
18 | @import "mixins";
19 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/_cssgrid-1140-ie.scss:
--------------------------------------------------------------------------------
1 | /* =============================================================================
2 | ** The 1140px Grid V2 by Andy Taylor, IE styles
3 | ** http://cssgrid.net
4 | ** http://www.twitter.com/andytlr
5 | ** http://www.andytlr.com
6 | ** ========================================================================== */
7 |
8 | .lte9 .onecol
9 | {
10 | width: 4.7%;
11 | }
12 |
13 | .lte9 .twocol
14 | {
15 | width: 13.2%;
16 | }
17 |
18 | .lte9 .threecol
19 | {
20 | width: 22.05%;
21 | }
22 |
23 | .lte9 .fourcol
24 | {
25 | width: 30.6%;
26 | }
27 |
28 | .lte9 .fivecol
29 | {
30 | width: 39%;
31 | }
32 |
33 | .lte9 .sixcol
34 | {
35 | width: 48%;
36 | }
37 |
38 | .lte9 .sevencol
39 | {
40 | width: 56.75%;
41 | }
42 |
43 | .lte9 .eightcol
44 | {
45 | width: 61.6%;
46 | }
47 |
48 | .lte9 .ninecol
49 | {
50 | width: 74.05%;
51 | }
52 |
53 | .lte9 .tencol
54 | {
55 | width: 82%;
56 | }
57 |
58 | .lte9 .elevencol
59 | {
60 | width: 91.35%;
61 | }
62 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/_feature-1.scss:
--------------------------------------------------------------------------------
1 | /*-----[ feature 1 ]------------------------------------------------------------
2 | | Styles for an individual feature, page or section of the application/site.
3 | | Create a new stylesheet per feature or section. If the feature-specific styles
4 | | are too many to practically be in one file, create a new directory containing
5 | | styles for that feature:
6 | |
7 | | _feature-1.scss
8 | | feature-2/
9 | | _sub-feature-1.scss
10 | | _sub-feature-2.scss
11 | | _feature-3.scss
12 | */
13 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/_login.scss:
--------------------------------------------------------------------------------
1 | /*-----[ login ]----------------------------------------------------------------
2 | | Styles for the login page. See _feature-1.scss for more details on how
3 | | feature-specific styles should be organized.
4 | */
5 | #login #page
6 | {
7 | padding: $body-text-line-height $column-width;
8 |
9 | p:last-of-type,
10 | dl:last-of-type,
11 | ol:last-of-type,
12 | ul:last-of-type,
13 | {
14 | margin-bottom: 0;
15 | }
16 |
17 | form
18 | {
19 | margin-bottom: $section-spacing;
20 | }
21 |
22 | input[type=email],
23 | input[type=password]
24 | {
25 | width: 23rem;
26 | }
27 |
28 | footer
29 | {
30 | color: $secondary-text-color;
31 | font-style: italic;
32 | }
33 | }
34 |
35 | @media (min-width: 480px)
36 | {
37 | #login #page
38 | {
39 | max-width: 25rem;
40 | }
41 | }
42 |
43 | @media (min-width: 768px)
44 | {
45 | #login #page
46 | {
47 | margin: 5rem auto;
48 | border: 0.2rem solid $silver;
49 | @include border-radius(1.5rem);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/_sassybuttons.scss:
--------------------------------------------------------------------------------
1 | @import "sassy-buttons";
2 |
3 | // Sassy Button defaults
4 | // These are the base defaults for the buttons, if you are going to use similar buttons on an entire site,
5 | // overriding these can save you some time by calling the sassy button mixin with less arguments.
6 |
7 | $sb-base-color: rgba(11, 153, 194, 1);
8 | $sb-second-color: false;
9 | $sb-border-radius: 10px;
10 | $sb-padding: 0.3em 1.5em;
11 | $sb-font-size: 16px;
12 | $sb-text-color: white;
13 | $sb-text-style: "inset";
14 | $sb-gradient-style: "simple";
15 | $sb-pseudo-states: true;
16 |
17 | // Mixin that gets included when calling the sassy-button-structure if you need any
18 | // styles applied to all your sassy buttons, add it here.
19 |
20 | @mixin sassy-button-default-structure {
21 | display: inline-block;
22 | cursor: pointer;
23 | text-decoration: none;
24 | line-height: 1.5; }
25 |
26 | // * Mixin reference
27 | // * -----------------------------------------
28 | // * @include sassy-button(gradient-style, border-radius, font-size, first-color, second-color, text-color, text-style, auto-states);
29 | // * @include sassy-button-structure(-border-radius, font-size, padding);
30 | // * @include sassy-button-gradient(gradient-style, first-color, second-color, text-color, text-style, auto-states);
31 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/_server-error.scss:
--------------------------------------------------------------------------------
1 | /*-----[ server errors ]--------------------------------------------------------
2 | | Styles for the server error pages. See _feature-1.scss for more details on
3 | | how feature-specific styles should be organized.
4 | */
5 | .server-error
6 | {
7 | #page
8 | {
9 | padding: $body-text-line-height $column-width;
10 |
11 | p:last-of-type,
12 | dl:last-of-type,
13 | ol:last-of-type,
14 | ul:last-of-type
15 | {
16 | margin-bottom: 0;
17 | }
18 | }
19 | }
20 |
21 | @media (min-width: 480px)
22 | {
23 | .server-error #page
24 | {
25 | max-width: 60rem;
26 | }
27 | }
28 |
29 | @media (min-width: 768px)
30 | {
31 | .server-error #page
32 | {
33 | margin: 5rem auto;
34 | border: 0.2rem solid $silver;
35 | @include border-radius(1.5rem);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/application.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------------
2 | | application.css
3 | | application name v1.0
4 | | Author(s): Author Name
5 | | Created: yyyy-mm-dd
6 | |
7 | | This file rolls up the main styles for the entire application. You'll need to
8 | | include the IE-specific and print stylesheets, as well as the display-size-
9 | | specific styles separately in your markup. See the readme for an explanation
10 | | of the directory organization.
11 | ------------------------------------------------------------------------------*/
12 |
13 | // Reset
14 | @import "reset";
15 |
16 | // Third-party mixins
17 | @import "compass/css3";
18 | @import "sassybuttons";
19 | @import "cssgrid-1140";
20 |
21 | // Basics
22 | @import "colors";
23 | @import "typography";
24 | @import "grid";
25 |
26 | // Shared
27 | @import "mixins";
28 | @import "foundation";
29 | @import "forms";
30 | @import "header";
31 | @import "footer";
32 |
33 | // Feature-/page-specific
34 | @import "server-error";
35 | @import "login";
36 | @import "style-guide";
37 | @import "feature-1";
38 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/basics/_grid.scss:
--------------------------------------------------------------------------------
1 | /*-----[ grid ]-----------------------------------------------------------------
2 | | Style specifying the dimensions of the basic page grid and other common
3 | | measures.
4 | */
5 | $column-width : 2rem;
6 | $horizontal-nudge : $column-width / 4;
7 |
8 | $gutter-width : 1.5 * $column-width;
9 |
10 | $vertical-nudge : $body-text-line-height / 4;
11 | $section-spacing : 2 * $body-text-line-height;
12 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/basics/_typography.scss:
--------------------------------------------------------------------------------
1 | /*-----[ typography ]-----------------------------------------------------------
2 | */
3 | $body-text-family : Calibri, "Myriad Pro", Tahoma, sans-serif;
4 | $body-text-size : 1.6rem;
5 | $body-text-line-height : 2.2rem;
6 |
7 | $monospace-text-family : Consolas, Monaco, "Lucida Console", monospace;
8 | $monospace-text-size : $body-text-size;
9 |
10 | $secondary-text-size : 1.4rem;
11 | $secondary-text-line-height : 1.8rem;
12 |
13 | $page-heading-text-size : 2.4rem;
14 | $subheading-text-size : 1.8rem;
15 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/ie.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------------
2 | | ie.css
3 | | application name v1.0
4 | | Author(s): Richa Avasthi
5 | | Created: 2010-09-03
6 | |
7 | | Internet Explorer-specific styles. Now that we're using JS to tag the specific
8 | | browser version in the body class name, we can combine all those separate
9 | | stylesheets into one, where the styles to target each version are qualified
10 | | by class names.
11 | |
12 | | See
13 | | for details.
14 | ------------------------------------------------------------------------------*/
15 |
16 | @import "cssgrid-1140-ie";
17 |
18 | /*-----[ general ]--------------------------------------------------------------
19 | */
20 | .lte7 .group
21 | {
22 | zoom: 1;
23 | }
24 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/print.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------------------------------------------------
2 | | print.css
3 | | application name v1.0
4 | | Author(s): Author Name
5 | | Created: yyyy-mm-dd
6 | |
7 | | Print styles.
8 | ------------------------------------------------------------------------------*/
9 |
10 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/shared/_footer.scss:
--------------------------------------------------------------------------------
1 | /*-----[ footer ]---------------------------------------------------------------
2 | | Common page footer styles.
3 | */
4 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/shared/_header.scss:
--------------------------------------------------------------------------------
1 | /*-----[ header ]---------------------------------------------------------------
2 | | Common page header styles.
3 | */
4 | .row > header
5 | {
6 | margin-top: 2 * $body-text-line-height;
7 | margin-bottom: $body-text-line-height - 0.1rem;
8 | border-bottom: 0.1rem solid $light-stroke;
9 | padding-bottom: $body-text-line-height / 2;
10 |
11 | nav.auth-status
12 | {
13 | float: right;
14 | }
15 | }
16 |
17 | .row > footer
18 | {
19 | color: $secondary-text-color;
20 | font-style: italic;
21 | }
22 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/main/resources/styles/shared/_mixins.scss:
--------------------------------------------------------------------------------
1 | /*-----[ mixins ]---------------------------------------------------------------
2 | | Define mixins and reusable CSS rulesets here. An example:
3 | |
4 | | $silver-sand: #c1c0be;
5 | | $content-inner-bg: white;
6 | |
7 | | @mixin content-inner-border
8 | | {
9 | | @include border-radius(5px);
10 | | }
11 | |
12 | | @mixin content-shadow
13 | | {
14 | | @include single-box-shadow($silver-sand, 0, 3px, 5px);
15 | | }
16 | |
17 | | @mixin content-inner-box
18 | | {
19 | | @include content-inner-border;
20 | | @include content-shadow;
21 | | background-color: $content-inner-bg;
22 | | }
23 | */
24 |
25 | /*
26 | ** Also offer clearfix as a mixin for greater flexibility.
27 | ** Clearfix style from
28 | */
29 | @mixin clearfix
30 | {
31 | &:before,
32 | &:after
33 | {
34 | content: "";
35 | display: table;
36 | }
37 |
38 | &:after
39 | {
40 | clear: both;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/test/java/admin/AdministrationPageTest.java:
--------------------------------------------------------------------------------
1 | package ${package}.admin;
2 |
3 | import ${package}.BaseWicketUnitTest;
4 | import ${package}.home.HomePage;
5 | import ${package}.security.LoginPage;
6 |
7 | import org.apache.shiro.authz.AuthorizationException;
8 | import org.junit.Test;
9 | import static org.mockito.Mockito.doThrow;
10 | import static org.mockito.Mockito.when;
11 |
12 | /**
13 | * A simple demonstration of how to test Wicket pages that are secured via Shiro annotations.
14 | * We use the {@code mockSubject} provided by {@code BaseWicketUnitTest} to simulate whether the
15 | * user is currently logged in, and if so what role the user has. We can then verify that
16 | * the AdministrationPage allows or denies access in these different scenarios.
17 | */
18 | public class AdministrationPageTest extends BaseWicketUnitTest
19 | {
20 | @Test
21 | public void testRender_asUnauthenticated() throws Exception
22 | {
23 | doRender(false, false);
24 | this.tester.assertRenderedPage(LoginPage.class);
25 | }
26 |
27 | @Test
28 | public void testRender_asUnauthorized() throws Exception
29 | {
30 | doRender(true, false);
31 | this.tester.assertRenderedPage(HomePage.class);
32 | this.tester.assertErrorMessages("Sorry, you are not allowed to access that page.");
33 | }
34 |
35 | @Test
36 | public void testRender_asAuthorized() throws Exception
37 | {
38 | doRender(true, true);
39 | this.tester.assertRenderedPage(AdministrationPage.class);
40 | }
41 |
42 | private void doRender(boolean authenticated, boolean isAdmin)
43 | {
44 | when(this.mockSubject.isAuthenticated()).thenReturn(authenticated);
45 | if(!isAdmin)
46 | {
47 | doThrow(new AuthorizationException()).when(this.mockSubject).checkRole("admin");
48 | }
49 | this.tester.startPage(AdministrationPage.class);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-archetype/src/main/resources/archetype-resources/src/test/java/home/HomePageTest.java:
--------------------------------------------------------------------------------
1 | package ${package}.home;
2 |
3 | import ${package}.BaseWicketUnitTest;
4 | import fiftyfive.wicket.test.WicketTestUtils;
5 | import org.junit.Test;
6 | import org.mockito.Mock;
7 | import org.springframework.web.context.support.StaticWebApplicationContext;
8 |
9 | public class HomePageTest extends BaseWicketUnitTest
10 | {
11 | // @Mock MyService myService;
12 |
13 | @Override
14 | protected void initSpringContext(StaticWebApplicationContext ctx)
15 | {
16 | super.initSpringContext(ctx);
17 |
18 | // If HomePage had @SpringBean dependencies, you would mock them
19 | // (see @Mock example above), and register them with Spring here.
20 | // ctx.getBeanFactory().registerSingleton("myService", myService);
21 | }
22 |
23 | @Test
24 | public void testRender() throws Exception
25 | {
26 | this.tester.startPage(HomePage.class);
27 | this.tester.assertRenderedPage(HomePage.class);
28 | WicketTestUtils.assertValidMarkup(this.tester);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/basic/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * A simple container class, and label components for dealing with truncation,
18 | * placeholders and counts.
19 | */
20 | package fiftyfive.wicket.basic;
21 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/css/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * Utilities for merging and declaring CSS dependencies and modifying HTML class attributes.
18 | */
19 | package fiftyfive.wicket.css;
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/data/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * Custom implementation of Wicket's IDataProvider.
18 | */
19 | package fiftyfive.wicket.data;
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/feedback/GeneralFeedbackFilter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.feedback;
17 |
18 | import org.apache.wicket.feedback.FeedbackMessage;
19 | import org.apache.wicket.feedback.IFeedbackMessageFilter;
20 |
21 | /**
22 | * A filter that only shows feedback messages that are not attached to any
23 | * specific component; that is, they are general messages.
24 | *
25 | * @since 2.0.2
26 | */
27 | public class GeneralFeedbackFilter implements IFeedbackMessageFilter
28 | {
29 | /**
30 | * Returns {@code true} if the reporter of the message is {@code null}.
31 | */
32 | public boolean accept(FeedbackMessage message)
33 | {
34 | return message.getReporter() == null;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/feedback/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * Time-saving classes for styling Wicket's feedback messages.
18 | */
19 | package fiftyfive.wicket.feedback;
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/form/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * Improved radio and checkbox group components.
18 | */
19 | package fiftyfive.wicket.form;
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/link/HomeLink.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.link;
17 |
18 | import org.apache.wicket.Application;
19 | import org.apache.wicket.markup.html.link.BookmarkablePageLink;
20 |
21 | /**
22 | * A bookmarkable link to the home page. The home page is determined by the
23 | * application configuration.
24 | *
25 | * @since 2.0
26 | * @see Application#getHomePage()
27 | */
28 | public class HomeLink extends BookmarkablePageLink
29 | {
30 | public HomeLink(String id)
31 | {
32 | super(id, Application.get().getHomePage());
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/link/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * Purpose-specific Link components.
18 | */
19 | package fiftyfive.wicket.link;
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/list/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * Improvements to Wicket's ListView.
18 | */
19 | package fiftyfive.wicket.list;
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/model/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * Purpose-specific model classes.
18 | */
19 | package fiftyfive.wicket.model;
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * Improved foundation for Wicket Application configuration.
18 | */
19 | package fiftyfive.wicket;
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/prototype/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * Components intended for throw-away use during UI prototyping.
18 | */
19 | package fiftyfive.wicket.prototype;
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/resource/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * Low-level support classes for merged resources.
18 | */
19 | package fiftyfive.wicket.resource;
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/spring/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * Spring-specific classes.
18 | */
19 | package fiftyfive.wicket.spring;
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/util/HtmlUtils.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.util;
17 |
18 | import org.apache.wicket.util.string.Strings;
19 |
20 | /**
21 | * Utility methods for dealing with HTML.
22 | *
23 | * @since 2.0
24 | */
25 | public class HtmlUtils
26 | {
27 | /**
28 | * Returns a value safe for using inside an (X)HTML attribute.
29 | * Replaces {@code "} with {@code "} and {@code &} with {@code &}.
30 | */
31 | public static CharSequence escapeAttribute(CharSequence value)
32 | {
33 | return Strings.replaceAll(
34 | Strings.replaceAll(value, "&", "&"),
35 | "\"", """
36 | );
37 | }
38 |
39 | /**
40 | * Not intented to be instantiated.
41 | */
42 | private HtmlUtils()
43 | {
44 | super();
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/main/java/fiftyfive/wicket/util/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * Lots of general Wicket time-savers.
18 | */
19 | package fiftyfive.wicket.util;
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/BaseWicketTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket;
17 |
18 | import org.apache.wicket.RuntimeConfigurationType;
19 | import org.apache.wicket.request.resource.caching.NoOpResourceCachingStrategy;
20 | import org.apache.wicket.util.tester.DummyHomePage;
21 | import org.apache.wicket.util.tester.WicketTester;
22 | import org.junit.After;
23 | import org.junit.Before;
24 |
25 | public abstract class BaseWicketTest
26 | {
27 | protected WicketTester tester;
28 |
29 | @Before
30 | public void createTester()
31 | {
32 | this.tester = new WicketTester(new FoundationApplication() {
33 | public Class getHomePage()
34 | {
35 | return DummyHomePage.class;
36 | }
37 | @Override public RuntimeConfigurationType getConfigurationType()
38 | {
39 | return RuntimeConfigurationType.DEPLOYMENT;
40 | }
41 | @Override protected void init()
42 | {
43 | super.init();
44 | getResourceSettings().setCachingStrategy(
45 | NoOpResourceCachingStrategy.INSTANCE
46 | );
47 | }
48 | });
49 | }
50 |
51 | @After
52 | public void destroyTester()
53 | {
54 | if(this.tester != null)
55 | {
56 | this.tester.destroy();
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/css/1-print.css:
--------------------------------------------------------------------------------
1 | /* 1-print.css */
2 | #hello {
3 |
4 | }
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/css/1.css:
--------------------------------------------------------------------------------
1 | /* 1.css */
2 | #dummy {
3 | display: none;
4 | }
5 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/css/2-print.css:
--------------------------------------------------------------------------------
1 | /* 2-print.css */
2 | #hello {
3 |
4 | }
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/css/InternetExplorerCssTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.css;
17 |
18 | import fiftyfive.wicket.BaseWicketTest;
19 | import org.junit.Test;
20 | import static org.junit.Assert.*;
21 |
22 | public class InternetExplorerCssTest extends BaseWicketTest
23 | {
24 | @Test
25 | public void testRender() throws Exception
26 | {
27 | this.tester.startPage(InternetExplorerCssTestPage.class);
28 | this.tester.assertRenderedPage(InternetExplorerCssTestPage.class);
29 | this.tester.assertResultPage(
30 | InternetExplorerCssTestPage.class,
31 | "InternetExplorerCssTestPage-expected.html"
32 | );
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/css/InternetExplorerCssTestPage-expected.html:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
11 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/css/InternetExplorerCssTestPage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/css/InternetExplorerCssTestPage.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.css;
17 |
18 | import org.apache.wicket.markup.html.WebPage;
19 | import org.apache.wicket.request.resource.PackageResourceReference;
20 |
21 | public class InternetExplorerCssTestPage extends WebPage
22 | {
23 | public InternetExplorerCssTestPage()
24 | {
25 | add(InternetExplorerCss.getConditionalHeaderContribution(
26 | "IE 7", new PackageResourceReference(getClass(), "ie-7.css")
27 | ));
28 | add(InternetExplorerCss.getConditionalHeaderContribution(
29 | "IE 7", new PackageResourceReference(getClass(), "ie-7-print.css"),
30 | "print"
31 | ));
32 | add(InternetExplorerCss.getConditionalHeaderContribution(
33 | "IE 7", "styles/ie-7.css"
34 | ));
35 | add(InternetExplorerCss.getConditionalHeaderContribution(
36 | "IE 7", "styles/ie-7-print.css", "print"
37 | ));
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/css/IterationCssBehaviorTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.css;
17 |
18 | import fiftyfive.wicket.BaseWicketTest;
19 |
20 | import org.apache.wicket.markup.ComponentTag;
21 | import org.apache.wicket.markup.html.basic.Label;
22 | import org.apache.wicket.markup.parser.XmlTag.TagType;
23 | import org.junit.Test;
24 |
25 |
26 | public class IterationCssBehaviorTest extends BaseWicketTest
27 | {
28 | @Test
29 | public void testRender() throws Exception
30 | {
31 | this.tester.startPage(IterationCssBehaviorTestPage.class);
32 | this.tester.assertRenderedPage(IterationCssBehaviorTestPage.class);
33 | this.tester.assertResultPage(
34 | IterationCssBehaviorTestPage.class,
35 | "IterationCssBehaviorTestPage-expected.html"
36 | );
37 | }
38 |
39 | @Test(expected=UnsupportedOperationException.class)
40 | public void test_badComponent() throws Exception
41 | {
42 | Label label = new Label("hello", "world");
43 | IterationCssBehavior behavior = new IterationCssBehavior("first");
44 | behavior.onComponentTag(label, new ComponentTag("span", TagType.OPEN));
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/css/IterationCssBehaviorTestPage-expected.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | untitled
5 |
6 |
7 |
8 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/css/MergedCssBuilderTestPage.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.css;
17 |
18 | import org.apache.wicket.markup.html.IHeaderResponse;
19 | import org.apache.wicket.markup.html.WebPage;
20 |
21 | import static fiftyfive.wicket.css.MergedCssBuilderTest.*;
22 |
23 |
24 | public class MergedCssBuilderTestPage extends WebPage
25 | {
26 | public MergedCssBuilderTestPage()
27 | {
28 | super();
29 | }
30 |
31 | @Override
32 | public void renderHead(IHeaderResponse response)
33 | {
34 | super.renderHead(response);
35 | response.renderCSSReference(CSS_1);
36 | response.renderCSSReference(CSS_2);
37 | response.renderCSSReference(CSS_PRINT_1, "print");
38 | response.renderCSSReference(CSS_PRINT_2, "print");
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/css/ie-7-print.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/css/ie-7-print.css
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/css/ie-7.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/css/ie-7.css
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/data/Bean.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.data;
17 |
18 | import java.io.Serializable;
19 |
20 | public class Bean implements Serializable
21 | {
22 | private int num;
23 |
24 | public Bean(int num)
25 | {
26 | this.num = num;
27 | }
28 |
29 | public String toString()
30 | {
31 | return Integer.toString(this.num);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/data/BeanResult.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.data;
17 |
18 | import java.util.ArrayList;
19 | import java.util.List;
20 |
21 | public class BeanResult
22 | {
23 | private List beans;
24 | private int total;
25 |
26 | public BeanResult(int offset, int amount)
27 | {
28 | this.beans = new ArrayList();
29 | for(int i=0; i getBeans()
42 | {
43 | return this.beans;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/data/BeanResultProvider.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.data;
17 |
18 | import java.util.Iterator;
19 |
20 | import fiftyfive.wicket.data.DtoDataProvider;
21 |
22 | public class BeanResultProvider extends DtoDataProvider
23 | {
24 | private int loadCount = 0;
25 |
26 | public int getLoadCount()
27 | {
28 | return this.loadCount;
29 | }
30 |
31 | protected BeanResult load(int offset, int amount)
32 | {
33 | this.loadCount ++;
34 | return new BeanResult(offset, amount);
35 | }
36 |
37 | protected Iterator iterator(BeanResult result)
38 | {
39 | return result.getBeans().iterator();
40 | }
41 |
42 | protected int size(BeanResult result)
43 | {
44 | return result.getTotal();
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/data/DtoDataProviderTestPage-0-expected.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | untitled
5 |
6 |
7 |
8 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/data/DtoDataProviderTestPage.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.data;
17 |
18 | import org.apache.wicket.markup.html.WebPage;
19 | import org.apache.wicket.markup.html.navigation.paging.PagingNavigator;
20 | import org.apache.wicket.markup.repeater.Item;
21 | import org.apache.wicket.markup.repeater.data.DataView;
22 | import static fiftyfive.wicket.util.Shortcuts.label;
23 |
24 | public class DtoDataProviderTestPage extends WebPage
25 | {
26 | private BeanResultProvider provider;
27 |
28 | public DtoDataProviderTestPage()
29 | {
30 | super();
31 |
32 | this.provider = new BeanResultProvider();
33 | DataView dataView = new DataView("beans", this.provider) {
34 | protected void populateItem(Item item)
35 | {
36 | item.add(label("label", item.getModel()));
37 | }
38 | };
39 | this.provider.setPageableView(dataView);
40 | dataView.setItemsPerPage(10);
41 | add(dataView);
42 |
43 | add(new PagingNavigator("paging", dataView));
44 | }
45 |
46 | public int getLoadCount()
47 | {
48 | return this.provider.getLoadCount();
49 | }
50 |
51 | public BeanResultProvider getProvider()
52 | {
53 | return provider;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/resource/SimpleCDNTestPage-expected.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | untitled
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/resource/SimpleCDNTestPage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | untitled
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/resource/SimpleCDNTestPage.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.resource;
17 |
18 | import static fiftyfive.wicket.util.Shortcuts.*;
19 |
20 | import org.apache.wicket.markup.html.IHeaderResponse;
21 | import org.apache.wicket.markup.html.WebPage;
22 | import org.apache.wicket.request.resource.PackageResourceReference;
23 |
24 | public class SimpleCDNTestPage extends WebPage
25 | {
26 | public SimpleCDNTestPage()
27 | {
28 | }
29 |
30 | @Override
31 | public void renderHead(IHeaderResponse response)
32 | {
33 | response.renderCSSReference(
34 | new PackageResourceReference(SimpleCDNTestPage.class, "test.css"));
35 | response.renderJavaScriptReference(
36 | new PackageResourceReference(SimpleCDNTestPage.class, "test.js"));
37 |
38 | super.renderHead(response);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/resource/test.css:
--------------------------------------------------------------------------------
1 | /* hello */
2 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/resource/test.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/resource/test.gif
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/resource/test.js:
--------------------------------------------------------------------------------
1 | // hello
2 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/util/HtmlUtilsTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.util;
17 |
18 | import org.junit.Assert;
19 | import org.junit.Test;
20 |
21 | public class HtmlUtilsTest
22 | {
23 | @Test
24 | public void testEscapeAttribute_url()
25 | {
26 | String s = "http://localhost/?q=foo&c=2";
27 | Assert.assertEquals(
28 | "http://localhost/?q=foo&c=2",
29 | HtmlUtils.escapeAttribute(s).toString()
30 | );
31 | }
32 |
33 | @Test
34 | public void testEscapeAttribute_quoted()
35 | {
36 | String s = "Please click \"ok\" to continue.";
37 | Assert.assertEquals(
38 | "Please click "ok" to continue.",
39 | HtmlUtils.escapeAttribute(s).toString()
40 | );
41 | }
42 |
43 | @Test
44 | public void testEscapeAttribute_both()
45 | {
46 | String s = "The \"&\" is tricky.";
47 | Assert.assertEquals(
48 | "The "&" is tricky.",
49 | HtmlUtils.escapeAttribute(s).toString()
50 | );
51 | }
52 | }
53 |
54 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/util/ShortcutsTestPage-expected.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Page for testing shortcuts
4 |
5 |
6 |
7 |
8 |
9 |
value
10 |
value
11 |
string
12 |
value
13 |
foo
!
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/util/ShortcutsTestPage.css:
--------------------------------------------------------------------------------
1 | /* empty */
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/util/ShortcutsTestPage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Page for testing shortcuts
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 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/util/all.css:
--------------------------------------------------------------------------------
1 | /* empty */
--------------------------------------------------------------------------------
/fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/util/screen.css:
--------------------------------------------------------------------------------
1 | /* empty */
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/java/fiftyfive/wicket/js/datetime/JQueryDatePicker.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | //= require jquery-ui
17 | //= require strftime
18 |
19 | jQuery("#${component.markupId}").datepicker(
20 | { showOn: "both"
21 | , buttonImage: "${behavior.buttonImageUrl}"
22 | , buttonImageOnly: true
23 | , changeMonth: true
24 | , changeYear: true
25 | }
26 | );
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/java/fiftyfive/wicket/js/datetime/calendar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/java/fiftyfive/wicket/js/datetime/calendar.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/java/fiftyfive/wicket/js/datetime/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * A jQuery UI replacement for Wicket’s YUI DatePicker.
18 | */
19 | package fiftyfive.wicket.js.datetime;
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/java/fiftyfive/wicket/js/locator/SearchLocation.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js.locator;
17 |
18 | import org.apache.wicket.util.lang.Args;
19 |
20 | /**
21 | * Holds an immutable classpath search location, consisting of a class
22 | * (the scope) and a path relative to that class.
23 | *
24 | * @since 2.0
25 | */
26 | public class SearchLocation
27 | {
28 | private Class> scope;
29 | private String path;
30 |
31 | public SearchLocation(Class> scope, String path)
32 | {
33 | Args.notNull(scope, "scope");
34 | Args.notNull(path, "path");
35 | Args.isFalse(path.startsWith("/"), "path cannot start with \"/\": %s", path);
36 |
37 | this.scope = scope;
38 | this.path = path;
39 | }
40 |
41 | public Class> getScope()
42 | {
43 | return this.scope;
44 | }
45 |
46 | public String getPath()
47 | {
48 | return this.path;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/java/fiftyfive/wicket/js/locator/Sprocket.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js.locator;
17 |
18 | /**
19 | * Represents a sprocket
20 | * dependency reference. A dependency can either be a path relative to the current file,
21 | * or it can a path that is resolved relative to the libarary sesarch path.
22 | *
23 | * @since 2.0
24 | */
25 | public class Sprocket
26 | {
27 | private boolean library;
28 | private String path;
29 |
30 | public Sprocket(boolean isLibrary, String path)
31 | {
32 | this.library = isLibrary;
33 | this.path = path;
34 | }
35 |
36 | /**
37 | * Returns {@code true} if this is a library reference, {@code false} if
38 | * it is a file reference.
39 | */
40 | public boolean isLibrary()
41 | {
42 | return this.library;
43 | }
44 |
45 | /**
46 | * The name of the library or filename (the text between the angle brackets
47 | * or double quotes, respectively).
48 | */
49 | public String getPath()
50 | {
51 | return this.path;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/java/fiftyfive/wicket/js/locator/SprocketsParser.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js.locator;
17 |
18 | import java.io.BufferedReader;
19 | import java.io.IOException;
20 | import java.util.List;
21 |
22 | /**
23 | * @since 4.0
24 | */
25 | public interface SprocketsParser
26 | {
27 | /**
28 | * Parses the given JavaScript file and returns a list of sprocket
29 | * dependencies that are found. This method should not close the Reader.
30 | */
31 | List parseSprockets(BufferedReader javascript) throws IOException;
32 | }
33 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/java/fiftyfive/wicket/js/locator/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * Low-level implementation classes for Sprocket-style JavaScript dependency
18 | * management.
19 | */
20 | package fiftyfive.wicket.js.locator;
21 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/fiftyfive-utils/HISTORY.md:
--------------------------------------------------------------------------------
1 | # fiftyfive-util-js Version History
2 |
3 | ## 5.0
4 |
5 | * Remove Modernizr entirely, and alter dependent code accordingly.
6 |
7 |
8 | ## 4.0
9 |
10 | * Reorganize into new GitHub repository.
11 | * No functional changes since 3.1.
12 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/fiftyfive-utils/NOTICE:
--------------------------------------------------------------------------------
1 | 55 Minutes CSS3 Foundation
2 | Copyright 2012 55 Minutes
3 |
4 | This product includes software developed at 55 Minutes.
5 | (http://www.55minutes.com/).
6 |
7 | This product contains the strftime library for Javascript, licensed under the
8 | BSD license. Copyright 2008 Philip S Tellis.
9 | (http://tech.bluesmoon.info/2008/04/strftime-in-javascript.html)
10 |
11 | This product contains code from the jQuery library, licensed under the MIT
12 | license. Copyright 2011, John Resig.
13 | (http://jquery.com/)
14 |
15 | This product contains code from the jQuery UI library, licensed under the MIT
16 | license. Copyright 2011 Richard D. Worth, et al.
17 | (http://jqueryui.com/about)
18 |
19 | This product contains code from Techpatterns.com, licensed to the public
20 | domain.
21 | (http://techpatterns.com/downloads/javascript_cookies.php)
22 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/fiftyfive-utils/README.md:
--------------------------------------------------------------------------------
1 | # fiftyfive-util-js
2 |
3 | This project contains various JavaScript bits and pieces that we've authored and collected over the years to improve browser detection, cookie management, and debugging; and to fill in some gaps in jQuery and jQuery UI.
4 |
5 | ## Credits
6 |
7 | Unless otherwise noted below, the JavaScript code in this project is copyright 55 Minutes, and is made available under the Apache License v2.0.
8 |
9 | * The **strftime for Javascript** code is copyright [Philip S Tellis](mailto:philip@bluesmoon.info), distributed under the BSD license.
10 | * The **dump** code is copyright [Binny V Abraham](http://www.openjs.com/license.php), distributed under the BSD license.
11 | * The **cookies** code is in the public domain, and can be found at [techpatterns.com](http://techpatterns.com/downloads/javascript_cookies.php).
12 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/fiftyfive-utils/dump.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Function : dump()
3 | * Arguments: The data - array,hash(associative array),object
4 | * The level - OPTIONAL
5 | * Returns : The textual representation of the array.
6 | * This function was inspired by the print_r function of PHP.
7 | * This will accept some data as the argument and return a
8 | * text that will be a more readable version of the
9 | * array/hash/object that is given.
10 | * Docs: http://www.openjs.com/scripts/others/dump_function_php_print_r.php
11 | */
12 | function dump(arr,level)
13 | {
14 | var dumped_text = "";
15 | if(!level) level = 0;
16 |
17 | //The padding given at the beginning of the line.
18 | var level_padding = "";
19 | for(var j=0;j \"" + value + "\"\n";
35 | }
36 | }
37 | }
38 | else
39 | { //Stings/Chars/Numbers etc.
40 | dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
41 | }
42 | return dumped_text;
43 | }
44 |
45 |
46 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/fiftyfive-utils/feature-detect.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2012 55 Minutes (http://www.55minutes.com)
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 | | feature-detect.js
19 | | 55 Minutes JS utilities v5.0
20 | | Author(s): Richa Avasthi
21 | | Created: 2010-10-13
22 | |
23 | | Browser feature detection tests.
24 | ------------------------------------------------------------------------------*/
25 |
26 | // Establish namespace
27 | var fiftyfive = window.fiftyfive = window.fiftyfive ? window.fiftyfive : {};
28 | fiftyfive.featureDetect = fiftyfive.featureDetect ? fiftyfive.featureDetect : {};
29 |
30 | /*
31 | ** Test whether the browser supports the "placeholder" attribute on textarea
32 | ** elements and input elements.
33 | */
34 | fiftyfive.featureDetect.placeholder = function() {
35 | var i = document.createElement("input")
36 | var t = document.createElement("textarea");
37 | return ("placeholder" in i) && ("placeholder" in t);
38 | };
39 |
40 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_flat_55_fbec88_40x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_flat_55_fbec88_40x100.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_glass_85_dfeffc_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_glass_85_dfeffc_1x400.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_glass_95_fef1ec_1x400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_glass_95_fef1ec_1x400.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-icons_217bc0_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-icons_217bc0_256x240.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-icons_2e83ff_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-icons_2e83ff_256x240.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-icons_469bdd_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-icons_469bdd_256x240.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-icons_6da8d5_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-icons_6da8d5_256x240.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-icons_cd0a0a_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-icons_cd0a0a_256x240.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-icons_d8e7f3_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-icons_d8e7f3_256x240.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-icons_f9bd01_256x240.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/55minutes/fiftyfive-wicket/f20de946df2613b23046e0a61706b869998b0fd8/fiftyfive-wicket-js/src/main/resources/fiftyfive/wicket/js/lib/jquery-ui/themes/redmond/images/ui-icons_f9bd01_256x240.png
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/BaseIntegrationTestPage.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js;
17 |
18 | import org.apache.wicket.markup.html.WebPage;
19 |
20 | public class BaseIntegrationTestPage extends WebPage
21 | {
22 | protected BaseIntegrationTestPage()
23 | {
24 | super();
25 | add(new JavaScriptDependency("global.js"));
26 | add(new DomReadyScript("alert('base page init')"));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/BaseJSTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js;
17 |
18 | import org.apache.wicket.util.tester.WicketTester;
19 | import org.junit.After;
20 | import org.junit.Before;
21 | import org.mockito.MockitoAnnotations;
22 |
23 | /**
24 | * Base class for fiftyfive-wicket-js unit tests.
25 | * Sets up WicketTester and Mockito.
26 | */
27 | public abstract class BaseJSTest
28 | {
29 | protected WicketTester tester;
30 |
31 | @Before
32 | public void setUp()
33 | {
34 | this.tester = new WicketTester();
35 | MockitoAnnotations.initMocks(this);
36 | }
37 |
38 | @After
39 | public void tearDown()
40 | {
41 | if(this.tester != null) this.tester.destroy();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/DomReadyTemplateTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js;
17 |
18 | import org.apache.wicket.WicketRuntimeException;
19 | import org.apache.wicket.markup.html.IHeaderResponse;
20 | import org.junit.Assert;
21 | import org.junit.Test;
22 | import org.mockito.Mock;
23 |
24 |
25 | public class DomReadyTemplateTest extends BaseJSTest
26 | {
27 | @Mock IHeaderResponse response;
28 |
29 | @Test
30 | public void testExceptionThrownWhenNoTemplateFound()
31 | {
32 | DomReadyTemplate tmpl = new DomReadyTemplate(DomReadyTemplateTest.class);
33 | try
34 | {
35 | tmpl.renderHead(null, this.response);
36 | Assert.fail("Did not throw exception as expected.");
37 | }
38 | catch(WicketRuntimeException wre)
39 | {
40 | Assert.assertTrue(wre.getMessage().startsWith("Failed to locate JavaScript template"));
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/IntegrationTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js;
17 |
18 | import org.apache.wicket.markup.html.WebPage;
19 | import org.apache.wicket.protocol.http.WebApplication;
20 | import org.apache.wicket.request.resource.caching.NoOpResourceCachingStrategy;
21 | import org.apache.wicket.util.tester.WicketTester;
22 | import org.junit.Test;
23 |
24 | public class IntegrationTest
25 | {
26 | @Test
27 | public void testRender() throws Exception
28 | {
29 | WicketTester t = new WicketTester(new WebApplication() {
30 | @Override
31 | public Class extends WebPage> getHomePage()
32 | {
33 | return IntegrationTestPage.class;
34 | }
35 | @Override
36 | protected void init()
37 | {
38 | super.init();
39 | getResourceSettings().setCachingStrategy(
40 | NoOpResourceCachingStrategy.INSTANCE
41 | );
42 | JavaScriptDependencySettings.get()
43 | .addLibraryPath(IntegrationTest.class, "customlib");
44 | }
45 | });
46 | t.startPage(IntegrationTestPage.class);
47 | t.assertRenderedPage(IntegrationTestPage.class);
48 | t.assertResultPage(
49 | IntegrationTestPage.class,
50 | "IntegrationTestPage-expected.html"
51 | );
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/IntegrationTestPage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Integration Test Page
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/IntegrationTestPage.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js;
17 |
18 | import java.util.Date;
19 |
20 | import fiftyfive.wicket.js.datetime.JQueryDatePicker;
21 | import org.apache.wicket.datetime.markup.html.form.DateTextField;
22 | import org.apache.wicket.markup.html.form.Form;
23 | import org.apache.wicket.model.Model;
24 |
25 | public class IntegrationTestPage extends BaseIntegrationTestPage
26 | {
27 | public IntegrationTestPage()
28 | {
29 | super();
30 | add(new DomReadyScript("alert('page init')"));
31 | add(new IntegrationTestPanel("panel1"));
32 | add(new IntegrationTestTemplatePanel("panel2"));
33 |
34 | add(new Form("form")
35 | .add(DateTextField.forDatePattern("date",
36 | new Model(),
37 | "MM/dd/yyyy")
38 | .setRequired(true)
39 | .add(new JQueryDatePicker()))
40 | );
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/IntegrationTestPanel.html:
--------------------------------------------------------------------------------
1 |
2 | Test Panel
3 |
4 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/IntegrationTestPanel.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js;
17 |
18 | import org.apache.wicket.markup.html.panel.Panel;
19 |
20 | public class IntegrationTestPanel extends Panel
21 | {
22 | public IntegrationTestPanel(String id)
23 | {
24 | super(id);
25 | add(new JavaScriptDependency(IntegrationTestPanel.class));
26 | add(new DomReadyScript("alert('panel init');"));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/IntegrationTestPanel.js:
--------------------------------------------------------------------------------
1 | //= require my_custom_lib
2 | //= require ./another_file
3 |
4 | // Bundled JS for IntegrationTestPanel with deps
5 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/IntegrationTestTemplatePanel.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/IntegrationTestTemplatePanel.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js;
17 |
18 | import org.apache.wicket.markup.html.panel.Panel;
19 |
20 | public class IntegrationTestTemplatePanel extends Panel
21 | {
22 | public IntegrationTestTemplatePanel(String id)
23 | {
24 | super(id);
25 | add(new DomReadyTemplate(getClass()));
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/IntegrationTestTemplatePanel.js:
--------------------------------------------------------------------------------
1 | //= require strftime
2 | jQuery("#${component.markupId}").myfancyplugin();
3 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/JavaScriptDependencySettingsTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js;
17 |
18 | import org.junit.Assert;
19 | import org.junit.Test;
20 |
21 | public class JavaScriptDependencySettingsTest extends BaseJSTest
22 | {
23 | /**
24 | * Verify that multiple calls to get() return the same instance.
25 | */
26 | @Test
27 | public void testGet_same()
28 | {
29 | JavaScriptDependencySettings one = JavaScriptDependencySettings.get();
30 | JavaScriptDependencySettings two = JavaScriptDependencySettings.get();
31 |
32 | Assert.assertSame(one, two);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/MergedJavaScriptBuilderTestPage-expected-cdn.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/MergedJavaScriptBuilderTestPage.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js;
17 |
18 | import fiftyfive.wicket.js.JavaScriptDependency;
19 | import org.apache.wicket.markup.html.WebPage;
20 |
21 | public class MergedJavaScriptBuilderTestPage extends WebPage
22 | {
23 | public MergedJavaScriptBuilderTestPage()
24 | {
25 | super();
26 | add(new JavaScriptDependency("cookies"));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/MergedJavaScriptBuilderWithCDNTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js;
17 |
18 | import fiftyfive.wicket.resource.SimpleCDN;
19 | import org.apache.wicket.protocol.http.WebApplication;
20 | import org.apache.wicket.util.tester.WicketTester;
21 | import org.junit.Test;
22 |
23 |
24 | /**
25 | * Make sure JavaScript merging still works as expected even with SimpleCDN added
26 | * to the mix.
27 | */
28 | public class MergedJavaScriptBuilderWithCDNTest extends MergedJavaScriptBuilderTest
29 | {
30 | @Test
31 | @Override
32 | public void testRender() throws Exception
33 | {
34 | WicketTester tester = doRender(MergedJavaScriptBuilderTestPage.class);
35 | tester.assertResultPage(
36 | MergedJavaScriptBuilderTestPage.class,
37 | "MergedJavaScriptBuilderTestPage-expected-cdn.html"
38 | );
39 | }
40 |
41 | @Override
42 | protected void onAppInit(WebApplication app)
43 | {
44 | super.onAppInit(app);
45 | new SimpleCDN("http://gh23g239adgah.cloudfront.net").install(app);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/another_file.js:
--------------------------------------------------------------------------------
1 | // Sample JS file with no deps
2 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/customlib/global.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 55 Minutes (http://www.55minutes.com)
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 | //= require jquery
18 |
19 | // Sample lib that depends on jQuery
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/customlib/my_custom_lib.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 55 Minutes (http://www.55minutes.com)
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 | //= require
18 | //= require jquery.55_utils
19 |
20 | // An example custom lib that depends on jQuery UI
21 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/locator/MockJavaScriptDependencyLocator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js.locator;
17 |
18 | public class MockJavaScriptDependencyLocator
19 | implements JavaScriptDependencyLocator
20 | {
21 | private DependencyCollection libraryScripts;
22 | private DependencyCollection resourceScripts;
23 | private DependencyCollection associatedScripts;
24 |
25 | public void findLibraryScripts(String libraryName,
26 | DependencyCollection scripts)
27 | {
28 | this.libraryScripts.copyTo(scripts);
29 | }
30 |
31 | public void findResourceScripts(Class> cls,
32 | String fileName,
33 | DependencyCollection scripts)
34 | {
35 | this.resourceScripts.copyTo(scripts);
36 | }
37 |
38 | public void findAssociatedScripts(Class> cls,
39 | DependencyCollection scripts)
40 | {
41 | this.associatedScripts.copyTo(scripts);
42 | }
43 |
44 | public void setLibraryScripts(DependencyCollection libraryScripts)
45 | {
46 | this.libraryScripts = libraryScripts;
47 | }
48 |
49 | public void setResourceScripts(DependencyCollection resourceScripts)
50 | {
51 | this.resourceScripts = resourceScripts;
52 | }
53 |
54 | public void setAssociatedScripts(DependencyCollection associatedScripts)
55 | {
56 | this.associatedScripts = associatedScripts;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/v3/IntegrationTestPage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Integration Test Page
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/v3/IntegrationTestPage.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js.v3;
17 |
18 | import java.util.Date;
19 |
20 | import fiftyfive.wicket.js.BaseIntegrationTestPage;
21 | import fiftyfive.wicket.js.DomReadyScript;
22 | import fiftyfive.wicket.js.datetime.JQueryDatePicker;
23 | import org.apache.wicket.datetime.markup.html.form.DateTextField;
24 | import org.apache.wicket.markup.html.form.Form;
25 | import org.apache.wicket.model.Model;
26 |
27 | public class IntegrationTestPage extends BaseIntegrationTestPage
28 | {
29 | public IntegrationTestPage()
30 | {
31 | super();
32 | add(new DomReadyScript("alert('page init')"));
33 | add(new IntegrationTestPanel("panel1"));
34 | add(new IntegrationTestTemplatePanel("panel2"));
35 |
36 | add(new Form("form")
37 | .add(DateTextField.forDatePattern("date",
38 | new Model(),
39 | "MM/dd/yyyy")
40 | .setRequired(true)
41 | .add(new JQueryDatePicker()))
42 | );
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/v3/IntegrationTestPanel.html:
--------------------------------------------------------------------------------
1 |
2 | Test Panel
3 |
4 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/v3/IntegrationTestPanel.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js.v3;
17 |
18 | import fiftyfive.wicket.js.DomReadyScript;
19 | import fiftyfive.wicket.js.JavaScriptDependency;
20 | import org.apache.wicket.markup.html.panel.Panel;
21 |
22 | public class IntegrationTestPanel extends Panel
23 | {
24 | public IntegrationTestPanel(String id)
25 | {
26 | super(id);
27 | add(new JavaScriptDependency(IntegrationTestPanel.class));
28 | add(new DomReadyScript("alert('panel init');"));
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/v3/IntegrationTestPanel.js:
--------------------------------------------------------------------------------
1 | //= require
2 | //= require "another_file"
3 |
4 | // Bundled JS for IntegrationTestPanel with deps
5 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/v3/IntegrationTestTemplatePanel.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/v3/IntegrationTestTemplatePanel.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.js.v3;
17 |
18 | import fiftyfive.wicket.js.DomReadyTemplate;
19 | import org.apache.wicket.markup.html.panel.Panel;
20 |
21 | public class IntegrationTestTemplatePanel extends Panel
22 | {
23 | public IntegrationTestTemplatePanel(String id)
24 | {
25 | super(id);
26 | add(new DomReadyTemplate(getClass()));
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/v3/IntegrationTestTemplatePanel.js:
--------------------------------------------------------------------------------
1 | //= require
2 | jQuery("#${component.markupId}").myfancyplugin();
3 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/v3/another_file.js:
--------------------------------------------------------------------------------
1 | // Sample JS file with no deps
2 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/v3/customlib/global.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 55 Minutes (http://www.55minutes.com)
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 | //= require
18 |
19 | // Sample lib that depends on jQuery
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/js/v3/customlib/my_custom_lib.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2010 55 Minutes (http://www.55minutes.com)
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 | //= require
18 | //= require
19 |
20 | // An example custom lib that depends on jQuery UI
21 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-js/src/test/java/fiftyfive/wicket/resource:
--------------------------------------------------------------------------------
1 | ../../../../../../fiftyfive-wicket-core/src/test/java/fiftyfive/wicket/resource
--------------------------------------------------------------------------------
/fiftyfive-wicket-shiro/src/main/java/fiftyfive/wicket/shiro/markup/AuthenticationStatusPanel.html:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 | Hello, user!
21 | Log out
22 |
23 | Log in
24 |
25 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-shiro/src/main/java/fiftyfive/wicket/shiro/markup/LoginPage.html:
--------------------------------------------------------------------------------
1 |
18 |
19 |
20 |
21 | Please Log In
22 |
25 |
26 |
27 |
28 |
Please Log In
29 |
30 |
31 |
32 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-shiro/src/main/java/fiftyfive/wicket/shiro/markup/RememberMeLoginForm.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.shiro.markup;
17 |
18 | import org.apache.wicket.markup.html.form.CheckBox;
19 | import org.apache.wicket.model.Model;
20 |
21 | /**
22 | * A variation of {@link LoginForm} that includes a "remember me" checkbox.
23 | * The checkbox will be unchecked by default. Your markup must contain
24 | * {@code }.
25 | *
26 | * @since 3.0
27 | */
28 | public class RememberMeLoginForm extends LoginForm
29 | {
30 | private CheckBox rememberCheck;
31 |
32 | /**
33 | * Create a login form with a "remember me" checkbox.
34 | */
35 | public RememberMeLoginForm(String id)
36 | {
37 | super(id);
38 | add(this.rememberCheck = new CheckBox("rememberme", Model.of(false)));
39 | }
40 |
41 | /**
42 | * Returns {@code true} to enable the "remember me" feature if the
43 | * checkbox is checked.
44 | */
45 | protected boolean remember()
46 | {
47 | return this.rememberCheck.getModelObject();
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-shiro/src/main/java/fiftyfive/wicket/shiro/markup/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * Basic implementations of login/logout UI markup components that allow
18 | * you to quickly bootstrap a Shiro-Wicket project. These are scaffolding
19 | * only: when it comes time to customize the look and feel of your application,
20 | * you will probably replace or subclass these with your own versions.
21 | */
22 | package fiftyfive.wicket.shiro.markup;
23 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-shiro/src/main/java/fiftyfive/wicket/shiro/test/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | * Unit testing support for Shiro-Wicket projects.
18 | */
19 | package fiftyfive.wicket.shiro.test;
20 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-shiro/src/test/java/fiftyfive/wicket/shiro/AnnotatedUnauthorizedChildPage.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.shiro;
17 |
18 | public class AnnotatedUnauthorizedChildPage extends AnnotatedUnauthorizedPage
19 | {
20 | }
21 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-shiro/src/test/java/fiftyfive/wicket/shiro/AnnotatedUnauthorizedPage.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.shiro;
17 |
18 | import org.apache.shiro.authz.annotation.RequiresRoles;
19 |
20 | @RequiresRoles("test-role")
21 | public class AnnotatedUnauthorizedPage extends BaseTestPage
22 | {
23 | }
24 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-shiro/src/test/java/fiftyfive/wicket/shiro/AuthenticationRequiredPage.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.shiro;
17 |
18 | import org.apache.shiro.authz.annotation.RequiresAuthentication;
19 |
20 | @RequiresAuthentication
21 | public class AuthenticationRequiredPage extends BaseTestPage
22 | {
23 | }
24 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-shiro/src/test/java/fiftyfive/wicket/shiro/BaseTestPage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | untitled
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-shiro/src/test/java/fiftyfive/wicket/shiro/BaseTestPage.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.shiro;
17 |
18 | import org.apache.wicket.markup.html.WebPage;
19 |
20 | public abstract class BaseTestPage extends WebPage
21 | {
22 | public BaseTestPage()
23 | {
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-shiro/src/test/java/fiftyfive/wicket/shiro/ExceptionalPage.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.shiro;
17 |
18 | public class ExceptionalPage extends BaseTestPage
19 | {
20 | private RuntimeException exception;
21 |
22 | public ExceptionalPage(RuntimeException e)
23 | {
24 | this.exception = e;
25 | }
26 |
27 | protected void onBeforeRender()
28 | {
29 | throw this.exception;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-shiro/src/test/java/fiftyfive/wicket/shiro/markup/LoginPageTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.shiro.markup;
17 |
18 | import fiftyfive.wicket.shiro.BaseTest;
19 | import fiftyfive.wicket.test.WicketTestUtils;
20 | import org.junit.Test;
21 |
22 | public class LoginPageTest extends BaseTest
23 | {
24 | @Test
25 | public void testRedirectToHomeIfAlreadyAuthenticated() throws Exception
26 | {
27 | mockAuthenticated();
28 | this.tester.startPage(LoginPage.class);
29 | this.tester.assertRenderedPage(this.tester.getApplication().getHomePage());
30 | }
31 |
32 | @Test
33 | public void testRender() throws Exception
34 | {
35 | mockGuest();
36 | this.tester.startPage(LoginPage.class);
37 | this.tester.assertRenderedPage(LoginPage.class);
38 | WicketTestUtils.assertValidMarkup(this.tester);
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-shiro/src/test/java/fiftyfive/wicket/shiro/markup/LogoutPageTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.shiro.markup;
17 |
18 | import fiftyfive.wicket.shiro.BaseTest;
19 | import fiftyfive.wicket.test.WicketTestUtils;
20 | import org.apache.wicket.feedback.FeedbackMessage;
21 | import org.apache.wicket.request.mapper.parameter.PageParameters;
22 | import org.junit.Assert;
23 | import org.junit.Test;
24 | import static org.mockito.Mockito.verify;
25 |
26 | public class LogoutPageTest extends BaseTest
27 | {
28 | @Test
29 | public void testLogoutAndRedirectToHomeWithFeedback() throws Exception
30 | {
31 | this.tester.startPage(LogoutPage.class);
32 | verify(this.mockSubject).logout();
33 | this.tester.assertRenderedPage(this.tester.getApplication().getHomePage());
34 | Assert.assertEquals(1, this.tester.getMessages(FeedbackMessage.INFO).size());
35 | }
36 |
37 | @Test
38 | public void testRedirectToUri() throws Exception
39 | {
40 | this.tester.startPage(LogoutPage.class, new PageParameters().add("to", "login"));
41 | this.tester.assertRenderedPage(LoginPage.class);
42 | Assert.assertEquals(1, this.tester.getMessages(FeedbackMessage.INFO).size());
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-test/src/main/java/fiftyfive/wicket/test/Html5Validator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.test;
17 |
18 | import javax.xml.parsers.DocumentBuilder;
19 |
20 | import nu.validator.htmlparser.dom.HtmlDocumentBuilder;
21 |
22 | /**
23 | * Utility for parsing HTML5 documents and verifying that they are valid.
24 | * Uses code provided by validator.nu.
25 | * You should not have to use this class directly; it will be auto-selected
26 | * by helper methods in {@link WicketTestUtils}.
27 | */
28 | public class Html5Validator extends AbstractDocumentValidator
29 | {
30 | /**
31 | * Constructs and returns an HTML5 HtmlDocumentBuilder.
32 | */
33 | protected DocumentBuilder builder()
34 | {
35 | HtmlDocumentBuilder builder = new HtmlDocumentBuilder();
36 | builder.setErrorHandler(this);
37 | return builder;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-test/src/main/java/fiftyfive/wicket/test/PageWithInlineMarkup.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.test;
17 |
18 | import org.apache.wicket.markup.ContainerInfo;
19 | import org.apache.wicket.markup.IMarkupFragment;
20 | import org.apache.wicket.markup.MarkupFactory;
21 | import org.apache.wicket.markup.MarkupResourceStream;
22 | import org.apache.wicket.markup.html.WebPage;
23 | import org.apache.wicket.request.mapper.parameter.PageParameters;
24 | import org.apache.wicket.util.resource.StringResourceStream;
25 |
26 |
27 | /**
28 | * A WebPage that obtains its markup from a String passed into its
29 | * constructor, rather than an associated HTML file. Used for testing.
30 | */
31 | public class PageWithInlineMarkup extends WebPage
32 | {
33 | private String htmlMarkup;
34 |
35 | public PageWithInlineMarkup(String htmlMarkup)
36 | {
37 | this(htmlMarkup, null);
38 | }
39 |
40 | /**
41 | * @since 2.0.4
42 | */
43 | public PageWithInlineMarkup(String htmlMarkup, PageParameters parameters)
44 | {
45 | super(parameters);
46 | this.htmlMarkup = htmlMarkup;
47 | }
48 |
49 | @Override
50 | public IMarkupFragment getMarkup()
51 | {
52 | StringResourceStream stream = new StringResourceStream(this.htmlMarkup);
53 | MarkupResourceStream mrs = new MarkupResourceStream(
54 | stream, new ContainerInfo(this), null
55 | );
56 | return MarkupFactory.get().loadMarkup(this, mrs, false);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/fiftyfive-wicket-test/src/main/java/fiftyfive/wicket/test/TransientModel.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright 2014 55 Minutes (http://www.55minutes.com)
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 | package fiftyfive.wicket.test;
17 |
18 | import org.apache.wicket.model.IModel;
19 |
20 | /**
21 | * Holds a value that will not be serialized. This is helpful
22 | * in unit tests where you need to construct a quick and dirty model for a
23 | * non-serializable object, and therefore {@code Model.of()} will not work.
24 | * This class is not intended for production code.
25 | *
26 | * @since 2.0.2
27 | */
28 | public class TransientModel implements IModel
29 | {
30 | private transient T object;
31 |
32 | /**
33 | * Convience method for constructing a TransientModel instance.
34 | * These statements are equivalent:
35 | *