protected void populateItem(final ListItem item)
{
final Repository repo = (Repository) item.getModelObject();
item.add(new Label("name", repo.getName()));
item.add(new Label("url", repo.getConfigPath()));
item.add(new AjaxLink("edit", item.getModel())
{
@Override
public void onClick(AjaxRequestTarget target)
{
metaDataModalWindow.setContent(new RepositoryPanel(
metaDataModalWindow.getContentId(), repo,
tableGroup));
metaDataModalWindow.show(target);
}
});
item.add(new AjaxLink("remove", item.getModel()){
@Override
public void onClick(AjaxRequestTarget target)
{
try
{
getPortletRequest().getPreferences().reset(repo.getName());
getRepositoryManager().reload(RemotePortletAppDeployer.getReposList(getPortletRequest()));
target.addComponent(tableGroup);
} catch (ReadOnlyException e)
{
logger.error("The preference is read-only: {}", repo.getName());
}
}
});
}
};
listview.setOutputMarkupId(true);
tableGroup.setOutputMarkupId(true);
tableGroup.add(new PagingNavigator("navigator", listview));
tableGroup.add(listview);
add(metaDataModalWindow);
add(tableGroup);
add(new AjaxLink("newRepo"){
@Override
public void onClick(AjaxRequestTarget target)
{
metaDataModalWindow.setContent(new RepositoryPanel(