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;
}
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));
}
Aggregations