All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.efaps.ui.wicket.pages.info.GatherInfoPage Maven / Gradle / Ivy

Go to download

eFaps WebApp provides a web interface as the User Interface for eFaps which can be easily expanded and altered.

There is a newer version: 3.2.0
Show newest version
/*
 * Copyright 2003 - 2011 The eFaps Team
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Revision:        $Rev: 7613 $
 * Last Changed:    $Date: 2012-06-09 12:34:55 -0500 (Sat, 09 Jun 2012) $
 * Last Changed By: $Author: [email protected] $
 */

package org.efaps.ui.wicket.pages.info;

import org.apache.wicket.AttributeModifier;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.html.WebComponent;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.pages.BrowserInfoForm;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.request.cycle.RequestCycle;
import org.efaps.admin.dbproperty.DBProperties;
import org.efaps.ui.wicket.resources.EFapsContentReference;
import org.efaps.ui.wicket.resources.AbstractEFapsHeaderItem;

/**
 * TODO comment!
 *
 * @author The eFaps Team
 * @version $Id: GatherInfoPage.java 7613 2012-06-09 17:34:55Z [email protected] $
 */
public class GatherInfoPage
    extends WebPage
{
    /**
     * Needed for serialization.
     */
    private static final long serialVersionUID = 1L;

    /**
     * Reference to the StyleSheet for this Page.
     */
    private static final EFapsContentReference CSS = new EFapsContentReference(GatherInfoPage.class,
                    "GatherInfoPage.css");


    /**
     * Constructor.
     */
    public GatherInfoPage()
    {
        final WebComponent meta = new WebComponent("meta");

        final IModel urlModel = new LoadableDetachableModel()
        {
            private static final long serialVersionUID = 1L;

            @Override
            protected String load()
            {
                final CharSequence url = urlFor(GatherInfoPage.class, null);
                return url.toString();
            }
        };

        meta.add(AttributeModifier.replace("content", new AbstractReadOnlyModel()
        {
            private static final long serialVersionUID = 1L;

            @Override
            public String getObject()
            {
                return "0; url=" + urlModel.getObject();
            }

        }));
        add(meta);

        add(new Label("pageTitle", DBProperties.getProperty("Logo.Version.Label")));

        add(new Label("label", DBProperties.getProperty("gatherInfoPage.message")).setEscapeModelStrings(false));

        add(new BrowserInfoForm("postback")
        {
            private static final long serialVersionUID = 1L;

            /**
             * @see org.apache.wicket.markup.html.pages.BrowserInfoForm#afterSubmit()
             */
            @Override
            protected void afterSubmit()
            {
                RequestCycle.get().setResponsePage(WebApplication.get().getHomePage());
            }
        });
    }

    @Override
    public void renderHead(final IHeaderResponse _response)
    {
        super.renderHead(_response);
        _response.render(AbstractEFapsHeaderItem.forCss(GatherInfoPage.CSS));
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy