dataView.setCurrentPage(0);
}
});
add(dataView);
add(new PagingNavigator("appNavigator", dataView));
FeedbackPanel feedback = new FeedbackPanel("feedback");
feedback.setEscapeModelStrings(false);
add(feedback);
final DataView<PortletDefinitionBean> portletListView = new DataView<PortletDefinitionBean>(PORTLET_TABLE, portletListDataProvider)
{
private static final long serialVersionUID = 1L;
protected void populateItem(final Item<PortletDefinitionBean> item)
{
final PortletDefinitionBean portletDefinitionBean = item.getModelObject();
Link<PortletDefinitionBean> link = new Link<PortletDefinitionBean>("nameLink", item.getModel())
{
private static final long serialVersionUID = 1L;
@Override
public void onClick()
{
try
{
PortletMessaging.publish(
((AbstractAdminWebApplication) getApplication()).getPortletRequest(),
ApplicationsListApplication.PRM_TOPIC,
ApplicationsListApplication.SELECTED_PORTLET_EVENT,
portletDefinitionBean
);
PortletMessaging
.publish(
((AbstractAdminWebApplication) getApplication()).getPortletRequest(),
ApplicationsListApplication.PRM_TOPIC,
ApplicationsListApplication.SELECTED_APPLICATION_EVENT,
new ApplicationBean(
locator.getPortletRegistry()
.getPortletApplication(portletDefinitionBean.getApplicationName()),
locator
.getPortletFactory()
.isPortletApplicationRegistered(
locator
.getPortletRegistry()
.getPortletApplication(
portletDefinitionBean
.getApplicationName()))));
}
catch (NotSerializableException e)
{
logger.error("Message to publish is not serializable.", e);
}
}
};
link.add(new Label("nameLabel", portletDefinitionBean.getDisplayName()));
item.add(link);
item.add(new CloneStatusPanel("status", item.getModel()));
item.add(new PortletActionPanel("actions", item.getModel()));
}
};
portletListView.setItemsPerPage(((AbstractAdminWebApplication) getApplication()).getPreferenceValueAsInteger("portletRows"));
add(new OrderByBorder("plOrderByDisplayName", "name", portletListDataProvider)
{
private static final long serialVersionUID = 1L;
protected void onSortChanged()
{
if (portletListDataProvider.getOrderBy() == PortletOrderBy.DISPLAY_NAME_ASC)
{
portletListDataProvider.setOrderBy(PortletOrderBy.DISPLAY_NAME_DESC);
}
else
{
portletListDataProvider.setOrderBy(PortletOrderBy.DISPLAY_NAME_ASC);
}
portletListDataProvider.sort();
dataView.setCurrentPage(0);
}
});
add(portletListView);
add(new PagingNavigator("plNavigator", portletListView));
CloneModalWindow modalWindow = new CloneModalWindow("modalwindow");
add(modalWindow);
Label modalWindowCloseScript = new Label("modalWindowCloseScript", new PropertyModel<String>(this, "currentModalWindowCloseScript"));