}
public OverviewPage() {
super(OverviewPage.class);
IRequestParameters params = getRequestCycle().getRequest().getQueryParameters();
String pw = pasteService.getAdminPassword();
if(pw == null || params.getParameterValue("pw").isEmpty() ||
!params.getParameterValue("pw").toString().equals(pw)) {
throw new RestartResponseException(AccessDeniedPage.class);
}
itemsPerPage = params.getParameterValue("itemsPerPage").toInt(ITEMS_PER_PAGE);
/*
if(!params.getParameterValue("itemsPerPage").isEmpty()) {
} else {
itemsPerPage = ITEMS_PER_PAGE;
}
*/
final HistoryDataProvider historyDataProvider = new HistoryDataProvider(pasteService);
final WebMarkupContainer historyDataViewContainer = new WebMarkupContainer("historyContainer");
historyDataView = new DataView<PasteItem>("history", historyDataProvider, itemsPerPage) {
protected void populateItem(Item<PasteItem> item) {
final PasteItem pasteItem = item.getModelObject();
PageParameters params = new PageParameters();
params.add("0", pasteItem.getItemId());
item.add(new BookmarkablePageLink<Void>("viewLink", ViewPublicPage.class, params));
item.add(new AjaxLink<Void>("increaseAbuseCount") {
@Override
public void onClick(AjaxRequestTarget target) {