Example usage for org.apache.wicket Session getMetaData

List of usage examples for org.apache.wicket Session getMetaData

Introduction

In this page you can find the example usage for org.apache.wicket Session getMetaData.

Prototype

public synchronized final <M extends Serializable> M getMetaData(final MetaDataKey<M> key) 

Source Link

Document

Gets metadata for this session using the given key.

Usage

From source file:org.geoserver.web.translator.controller.TranslationController.java

License:Open Source License

public static TranslationSession getTranslationSession(final Session session) {
    TranslationSession translationSession = (TranslationSession) session.getMetaData(TRANSLATION_BEAN);
    if (translationSession == null) {
        translationSession = new TranslationSession();
        session.setMetaData(TRANSLATION_BEAN, translationSession);
    }/*w  w  w .ja  v  a  2  s.  c  om*/
    return translationSession;
}

From source file:org.onexus.ui.authentication.persona.SessionHelper.java

License:Apache License

/**
 * @param session the current web session
 * @return the authentication data. May be {@code null}.
 */// w  w w . j a  va2  s  .  com
public static BrowserId getBrowserId(final Session session) {

    Args.notNull(session, "session");

    BrowserId browserId = session.getMetaData(KEY);

    return browserId;
}

From source file:org.qi4j.sample.dcicargo.sample_a.infrastructure.wicket.prevnext.PrevNext.java

License:Apache License

public static void addId(Session session, String id) {
    if (id == null || id.isEmpty()) {
        throw new RuntimeException("Can't register empty id.");
    }/*  www  .  j a va2s.c  om*/

    ArrayList<String> ids = session.getMetaData(PREV_NEXT_PANEL_KEY);
    if (ids == null || ids.isEmpty()) {
        ids = new ArrayList<String>();
    }

    ids.add(id);
    session.setMetaData(PREV_NEXT_PANEL_KEY, ids);
    session.bind();
}