Search in sources :

Example 1 with DebugPageManagerProvider

use of org.apache.wicket.devutils.diskstore.DebugPageManagerProvider in project wicket by apache.

the class DataStoreHelper method getDataStore.

/**
 * @return the configured {@link DebugDiskDataStore}
 */
public static DebugDiskDataStore getDataStore() {
    DebugPageManagerProvider pageManagerProvider = (DebugPageManagerProvider) Application.get().getPageManagerProvider();
    DebugDiskDataStore dataStore = pageManagerProvider.getDataStore();
    return dataStore;
}
Also used : DebugPageManagerProvider(org.apache.wicket.devutils.diskstore.DebugPageManagerProvider) DebugDiskDataStore(org.apache.wicket.devutils.diskstore.DebugDiskDataStore)

Example 2 with DebugPageManagerProvider

use of org.apache.wicket.devutils.diskstore.DebugPageManagerProvider in project wicket by apache.

the class PageWindowColumn method populateItem.

@Override
public void populateItem(Item<ICellPopulator<PageWindowDescription>> cellItem, String componentId, IModel<PageWindowDescription> rowModel) {
    String label;
    PageWindowDescription windowDescription = rowModel.getObject();
    if ("name".equals(getPropertyExpression())) {
        int pageId = windowDescription.getId();
        DebugPageManagerProvider pageManagerProvider = (DebugPageManagerProvider) Application.get().getPageManagerProvider();
        DebugDiskDataStore dataStore = pageManagerProvider.getDataStore();
        String sessionId = windowDescription.getSessionId();
        byte[] data = dataStore.getData(sessionId, pageId);
        ISerializer serializer = Application.get().getFrameworkSettings().getSerializer();
        Object page = serializer.deserialize(data);
        label = page.getClass().getName();
    } else if ("id".equals(getPropertyExpression())) {
        label = Integer.toString(windowDescription.getId());
    } else if ("size".equals(getPropertyExpression())) {
        label = Integer.toString(windowDescription.getSize());
    } else {
        label = "unknown: " + getPropertyExpression();
    }
    cellItem.add(new Label(componentId, label));
}
Also used : Label(org.apache.wicket.markup.html.basic.Label) DebugPageManagerProvider(org.apache.wicket.devutils.diskstore.DebugPageManagerProvider) DebugDiskDataStore(org.apache.wicket.devutils.diskstore.DebugDiskDataStore) ISerializer(org.apache.wicket.serialize.ISerializer)

Aggregations

DebugDiskDataStore (org.apache.wicket.devutils.diskstore.DebugDiskDataStore)2 DebugPageManagerProvider (org.apache.wicket.devutils.diskstore.DebugPageManagerProvider)2 Label (org.apache.wicket.markup.html.basic.Label)1 ISerializer (org.apache.wicket.serialize.ISerializer)1