use of com.hack23.cia.model.internal.application.system.impl.LanguageData in project cia by Hack23.
the class ConfigurationManagerImpl method getUserConfiguration.
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public UserConfiguration getUserConfiguration(final String url, final String locale) {
final Agency agency = agencyDAO.getAll().get(0);
Portal usePortal = null;
final LanguageData languageData = findLanguage(locale);
for (final Portal portal : agency.getPortals()) {
if (usePortal == null && PortalType.DEFAULT == portal.getPortalType() || url.contains(portal.getPortalName())) {
usePortal = portal;
}
}
return new UserConfigurationImpl(agency, usePortal, languageData);
}
use of com.hack23.cia.model.internal.application.system.impl.LanguageData in project cia by Hack23.
the class AdminLanguagePageModContentFactoryImpl method createContent.
@Secured({ "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
final VerticalLayout content = createPanelContent();
final String pageId = getPageId(parameters);
final int pageNr = getPageNr(parameters);
getMenuItemFactory().createMainPageMenuBar(menuBar);
LabelFactory.createHeader2Label(content, ADMIN_LANGUAGE);
final DataContainer<LanguageData, Long> dataContainer = getApplicationManager().getDataContainer(LanguageData.class);
final List<LanguageData> pageOrderBy = dataContainer.getPageOrderBy(pageNr, DEFAULT_RESULTS_PER_PAGE, LanguageData_.languageName);
createPagingControls(content, NAME, pageId, dataContainer.getSize(), pageNr, DEFAULT_RESULTS_PER_PAGE);
getGridFactory().createBasicBeanItemGrid(content, LanguageData.class, pageOrderBy, LANGUAGE_DATA, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null);
if (pageId != null && !pageId.isEmpty()) {
final LanguageData languageData = dataContainer.load(Long.valueOf(pageId));
if (languageData != null) {
getFormFactory().addFormPanelTextFields(content, languageData, LanguageData.class, AS_LIST);
}
}
getPageActionEventHelper().createPageEvent(ViewAction.VISIT_ADMIN_LANGUAGE_VIEW, ApplicationEventGroup.ADMIN, NAME, null, pageId);
return content;
}
Aggregations