Search in sources :

Example 6 with Link

use of de.micromata.opengis.kml.v_2_2_0.Link in project tapestry5-hotel-booking by ccordenier.

the class AuthenticationFilter method dispatchedToLoginPage.

private boolean dispatchedToLoginPage(String pageName) throws IOException {
    if (authenticator.isLoggedIn()) {
        // Logged user should not go back to Signin or Signup
        if (signinPage.equalsIgnoreCase(pageName) || signupPage.equalsIgnoreCase(pageName)) {
            Link link = renderLinkSource.createPageRenderLink(defaultPage);
            response.sendRedirect(link);
            return true;
        }
        return false;
    }
    Component page = componentSource.getPage(pageName);
    if (page.getClass().isAnnotationPresent(AnonymousAccess.class)) {
        return false;
    }
    Link link = renderLinkSource.createPageRenderLink("Signin");
    response.sendRedirect(link);
    return true;
}
Also used : Component(org.apache.tapestry5.runtime.Component) Link(org.apache.tapestry5.Link)

Aggregations

NetworkLink (de.micromata.opengis.kml.v_2_2_0.NetworkLink)4 Kml (de.micromata.opengis.kml.v_2_2_0.Kml)3 Link (de.micromata.opengis.kml.v_2_2_0.Link)3 UriBuilder (javax.ws.rs.core.UriBuilder)3 Handlebars (com.github.jknack.handlebars.Handlebars)2 Template (com.github.jknack.handlebars.Template)2 IOException (java.io.IOException)2 LineString (com.vividsolutions.jts.geom.LineString)1 MetacardImpl (ddf.catalog.data.impl.MetacardImpl)1 SourceInfoResponse (ddf.catalog.operation.SourceInfoResponse)1 SourceInfoRequestEnterprise (ddf.catalog.operation.impl.SourceInfoRequestEnterprise)1 SourceDescriptor (ddf.catalog.source.SourceDescriptor)1 SourceUnavailableException (ddf.catalog.source.SourceUnavailableException)1 Folder (de.micromata.opengis.kml.v_2_2_0.Folder)1 Placemark (de.micromata.opengis.kml.v_2_2_0.Placemark)1 TimeSpan (de.micromata.opengis.kml.v_2_2_0.TimeSpan)1 MalformedURLException (java.net.MalformedURLException)1 URI (java.net.URI)1 UnknownHostException (java.net.UnknownHostException)1 DateFormat (java.text.DateFormat)1