* @return
* @throws GWTJahiaServiceException
*/
public GWTManagerConfiguration getGWTManagerConfiguration(JCRNodeWrapper contextNode, JCRSiteNode site, JahiaUser jahiaUser, Locale locale, Locale uiLocale, HttpServletRequest request, String name) throws GWTJahiaServiceException {
try {
ManagerConfiguration config = (ManagerConfiguration) SpringContextSingleton.getBean(name);
if (config != null) {
logger.debug("Config. " + name + " found.");
GWTManagerConfiguration gwtConfig = new GWTManagerConfiguration();
gwtConfig.setName(name);
// set all properties
gwtConfig.setNodeTypes(config.getNodeTypes());
gwtConfig.setFolderTypes(config.getFolderTypes());
gwtConfig.setHideLeftPanel(config.isHideLeftPanel());
gwtConfig.setFilters(config.getFilters());
gwtConfig.setMimeTypes(config.getMimeTypes());
gwtConfig.setHiddenRegex(config.getHiddenRegex());
gwtConfig.setHiddenTypes(config.getHiddenTypes());
gwtConfig.setDefaultView(config.getDefaultView());
gwtConfig.setEnableFileDoubleClick(config.isEnableFileDoubleClick());
gwtConfig.setAllowsMultipleSelection(config.isAllowsMultipleSelection());
gwtConfig.setExpandRoot(config.isExpandRoot());
gwtConfig.setDisplaySearch(config.isDisplaySearch());
gwtConfig.setDisplaySearchInPage(config.isDisplaySearchInPage());
gwtConfig.setDisplaySearchInTag(config.isDisplaySearchInTag());
gwtConfig.setDisplaySearchInFile(config.isDisplaySearchInFile());
gwtConfig.setDisplaySearchInContent(config.isDisplaySearchInContent());
gwtConfig.setSearchInFile(config.isSearchInFile());
gwtConfig.setSearchInContent(config.isSearchInContent());
// set toolbar
gwtConfig.setToolbars(createGWTToolbarSet(contextNode, site, jahiaUser, locale, uiLocale, request, config.getToolbars()));
gwtConfig.setContextMenu(createGWTToolbar(contextNode, site, jahiaUser, locale, uiLocale, request, config.getContextMenu()));
// add table columns
for (Column item : config.getTableColumns()) {
if (checkVisibility(contextNode, jahiaUser, locale, request, item.getVisibility())) {
GWTColumn col = createGWTColumn(item, site, locale, uiLocale);
gwtConfig.addTableColumn(col);
}
}
for (Column item : config.getTreeColumns()) {
if (checkVisibility(contextNode, jahiaUser, locale, request, item.getVisibility())) {
GWTColumn col = createGWTColumn(item, site, locale, uiLocale);
gwtConfig.addTreeColumn(col);
}
}
// add accordion panels
for (Repository item : config.getRepositories()) {
if (checkVisibility(contextNode, jahiaUser, locale, request, item.getVisibility())) {
GWTRepository repository = new GWTRepository();
repository.setKey(item.getKey());
if (item.getTitleKey() != null) {
repository.setTitle(getResources(item.getTitleKey(), uiLocale != null ? uiLocale : locale, site,
jahiaUser));
} else if (item.getTitle() != null) {
repository.setTitle(item.getTitle());
} else {
repository.setTitle(item.getKey());
}
repository.setPaths(item.getPaths());
gwtConfig.addRepository(repository);
}
}
List<GWTEngineTab> tabs = createGWTEngineList(contextNode, site, jahiaUser, locale, uiLocale, request, config.getEngineTabs());
gwtConfig.setEngineTabs(tabs);
// todo : use eanUtilsBean.getInstance().cloneBean when it works. Actually it does not copy properties of the bean.
List<GWTEngineTab> managerTabs = createGWTEngineList(contextNode, site, jahiaUser, locale, uiLocale, request, config.getEngineTabs());
gwtConfig.setManagerEngineTabs(managerTabs);
return gwtConfig;
} else {
logger.error("Config. " + name + " not found.");