init(selectButtonLabel, ureq, withCancel, enableDirectLaunch, limitType, limitUser);
}
private void init(String selectButtonLabel, UserRequest ureq, boolean withCancel, boolean enableDirectLaunch, String limitType, String limitUser) {
translator = new PackageTranslator(PACKAGE, ureq.getLocale());
Roles roles = ureq.getUserSession().getRoles();
vc = new VelocityContainer("reposearch", VELOCITY_ROOT + "/search.html", translator, this);
Manager secMgr = ManagerFactory.getManager();
SecurityGroup usermanagerGroup = secMgr.findSecurityGroupByName(Constants.GROUP_USERMANAGERS);
boolean isUserManager = secMgr.isIdentityInSecurityGroup(ureq.getIdentity(), usermanagerGroup);
searchForm = new SearchForm("searchform", translator, withCancel, isUserManager||roles.isOLATAdmin(), limitType, limitUser);
searchForm.addListener(this);
searchForm.setVisible(false);
vc.put("searchform",searchForm);
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
if (selectButtonLabel != null) tableConfig.setPreferencesOffered(true, "repositorySearchResult");
tableCtr = new TableController(tableConfig, ureq, getWindowControl(), translator, this);
repoTableModel = new RepositoryTableModel(translator);
repoTableModel.addColumnDescriptors(tableCtr, selectButtonLabel, enableDirectLaunch);
tableCtr.addMultiSelectAction("resource.table.select", ACTION_MULTI_SELECT);
tableCtr.setMultiSelect(true);
tableCtr.setTableDataModel(repoTableModel);
tableCtr.setSortColumn(2, true);
vc.put("repotable", tableCtr.getInitialComponent());
vc.contextPut("isAuthor", Boolean.valueOf(roles.isAuthor()));
vc.contextPut("withCancel", Boolean.valueOf(withCancel));
enableBackToSearchFormLink(false); // default, must be enabled explicitly
enableSearchforAllReferencalbeInSearchForm(false); // default
setInitialComponent(vc);