@SuppressWarnings("serial")
protected void addDatabaseActionsMenu()
{
// Data-base actions
final ContentMenuEntryPanel databaseActionsMenu = new ContentMenuEntryPanel(getNewContentMenuChildId(),
getString("system.admin.group.title.databaseActions"));
addContentMenuEntry(databaseActionsMenu);
// Update all user preferences
final Link<Void> updateUserPrefsLink = new Link<Void>(ContentMenuEntryPanel.LINK_ID) {
@Override
public void onClick()
{
updateUserPrefs();
}
};
final ContentMenuEntryPanel updateUserPrefsLinkMenuItem = new ContentMenuEntryPanel(databaseActionsMenu.newSubMenuChildId(),
updateUserPrefsLink, getString("system.admin.button.updateUserPrefs"))
.setTooltip(getString("system.admin.button.updateUserPrefs.tooltip"));
databaseActionsMenu.addSubMenuEntry(updateUserPrefsLinkMenuItem);
// Create missing data-base indices.
final Link<Void> createMissingDatabaseIndicesLink = new Link<Void>(ContentMenuEntryPanel.LINK_ID) {
@Override
public void onClick()
{
createMissingDatabaseIndices();
}
};
final ContentMenuEntryPanel createMissingDatabaseIndicesLinkMenuItem = new ContentMenuEntryPanel(
databaseActionsMenu.newSubMenuChildId(), createMissingDatabaseIndicesLink,
getString("system.admin.button.createMissingDatabaseIndices"))
.setTooltip(getString("system.admin.button.createMissingDatabaseIndices.tooltip"));
databaseActionsMenu.addSubMenuEntry(createMissingDatabaseIndicesLinkMenuItem);
// Fix data-base history entries.
final Link<Void> fixDBHistoryEntriesLink = new Link<Void>(ContentMenuEntryPanel.LINK_ID) {
@Override
public void onClick()
{
fixDBHistoryEntries();
}
};
final ContentMenuEntryPanel fixDBHistoryEntriesLinkMenuItem = new ContentMenuEntryPanel(databaseActionsMenu.newSubMenuChildId(),
fixDBHistoryEntriesLink, getString("system.admin.button.fixDBHistoryEntries"))
.setTooltip(getString("system.admin.button.fixDBHistoryEntries.tooltip"));
databaseActionsMenu.addSubMenuEntry(fixDBHistoryEntriesLinkMenuItem);
{
// Dump data-base.
final Link<Void> dumpDatabaseLink = new Link<Void>(ContentMenuEntryPanel.LINK_ID) {
@Override
public void onClick()
{
dump();
}
};
final ContentMenuEntryPanel dumpDatabaseLinkMenuItem = new ContentMenuEntryPanel(databaseActionsMenu.newSubMenuChildId(),
dumpDatabaseLink, getString("system.admin.button.dump")).setTooltip(getString("system.admin.button.dump.tooltip"));
databaseActionsMenu.addSubMenuEntry(dumpDatabaseLinkMenuItem);
dumpDatabaseLink.add(WicketUtils.javaScriptConfirmDialogOnClick(getString("system.admin.button.dump.question")));
}
{
// Schema export.
final Link<Void> schemaExportLink = new Link<Void>(ContentMenuEntryPanel.LINK_ID) {
@Override
public void onClick()
{
schemaExport();
}
};
final ContentMenuEntryPanel schemaExportLinkMenuItem = new ContentMenuEntryPanel(databaseActionsMenu.newSubMenuChildId(),
schemaExportLink, getString("system.admin.button.schemaExport"))
.setTooltip(getString("system.admin.button.schemaExport.tooltip"));
databaseActionsMenu.addSubMenuEntry(schemaExportLinkMenuItem);
}
}