Package org.cyclos.db
Class BasicPopulator
- java.lang.Object
-
- org.cyclos.db.AbstractDatabasePopulator
-
- org.cyclos.db.BasicPopulator
-
- All Implemented Interfaces:
DatabasePopulator,CustomBean
public class BasicPopulator extends AbstractDatabasePopulator
Contains very basic data for population: a single system administrator with access to the main web channel
-
-
Field Summary
-
Fields inherited from class org.cyclos.db.AbstractDatabasePopulator
configurationHandler, conversionHandler, entityManagerHandler, entityServiceLocalService, invokerHandler, random, rawEntityManagerHandler
-
-
Constructor Summary
Constructors Constructor Description BasicPopulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassignProductToBasicGroup(Product product, BasicGroup group)protected voidcreateGlobalAdmin()protected List<ProductMyProfileFieldDTO>createProductMyBasicProfileFields()protected ProductMyProfileFieldDTOcreateProductMyProfileField(ProfileField profileField, boolean enabled, boolean visible, boolean editable, boolean editableAtRegistration, boolean managePrivacy)protected ProductUserProfileFieldDTOcreateProductUserProfileField(Collection<ProductUserProfileFieldDTO> existing, ProfileField profileField, boolean visible, boolean editable, boolean keywords)protected List<ProductUserProfileFieldDTO>createProductUserProfileFields(Collection<ProductUserProfileFieldDTO> existing, boolean manager, UserCustomField... customFields)StringgetDisplayName()Should a descriptive name for the kind of database is being createdprotected intgetLoginPasswordMinLength()Return the min length required for the login passwordprotected StringloadContentAndImportImages(String resource, SystemImageCategory category)Loads the content of the given resource, processing all tags [[imageName]] as system custom images, importing the content of those file names (relative to the original resource) as system custom imagesprotected StringloadGroovyScript(String scriptPath)It loads an optional script.protected StringloadGroovyScript(String scriptPath, boolean isOptional)It loads a Groovy script file.voidpopulate()Populates the database with dataprotected <T> voidset(ConfigurationDTO configuration, Property<T,? super ConfigurationDTO> property, T value)Sets a configuration DTO property, marking it as definedprotected ChannelConfigurationsetChannelConfiguration(Configuration configuration, Channel channel, UserChannelAccess userAccess, PasswordType accessPassword, PasswordType confirmationPassword, TimeInterval sessionTimeout)protected voidsetGroupConfiguration(BasicGroup group, Configuration configuration)-
Methods inherited from class org.cyclos.db.AbstractDatabasePopulator
createPossibleValues, createProductNotifications, createProductNotifications, find, from, intRange, listAll, persist, random, save, setDashboardActions, setRandomValue
-
-
-
-
Field Detail
-
DEFAULT_USERNAME_LENGTH_MIN
public static final int DEFAULT_USERNAME_LENGTH_MIN
- See Also:
- Constant Field Values
-
DEFAULT_USERNAME_LENGTH_MAX
public static final int DEFAULT_USERNAME_LENGTH_MAX
- See Also:
- Constant Field Values
-
DEFAULT_GENERATED_USERNAME_LENGTH
public static final int DEFAULT_GENERATED_USERNAME_LENGTH
- See Also:
- Constant Field Values
-
configurationService
@Autowired protected ConfigurationServiceLocal configurationService
-
channelService
@Autowired protected ChannelServiceLocal channelService
-
groupService
@Autowired protected GroupServiceLocal groupService
-
groupProductsService
@Autowired protected ProductsGroupServiceLocal groupProductsService
-
languageService
@Autowired protected LanguageServiceLocal languageService
-
themeService
@Autowired protected ThemeServiceLocal themeService
-
voucherTemplateService
@Autowired protected VoucherTemplateServiceLocal voucherTemplateService
-
userService
@Autowired protected UserServiceLocal userService
-
productService
@Autowired protected ProductServiceLocal productService
-
systemCustomImageService
@Autowired protected SystemCustomImageServiceLocal systemCustomImageService
-
systemImageCategoryService
@Autowired protected SystemImageCategoryServiceLocal systemImageCategoryService
-
staticContentService
@Autowired protected StaticContentServiceLocal staticContentService
-
mobilePageService
@Autowired protected MobilePageServiceLocal mobilePageService
-
dataTranslationService
@Autowired protected DataTranslationServiceLocal dataTranslationService
-
translationHandler
@Autowired protected TranslationHandler translationHandler
-
username
protected BuiltInPrincipalType username
-
email
protected BuiltInPrincipalType email
-
mobilePhone
protected BuiltInPrincipalType mobilePhone
-
accountNumber
protected BuiltInPrincipalType accountNumber
-
trustedDevice
protected BuiltInPrincipalType trustedDevice
-
loginPassword
protected PasswordType loginPassword
-
transactionPassword
protected PasswordType transactionPassword
-
pin
protected PasswordType pin
-
oneTimePassword
protected PasswordType oneTimePassword
-
english
protected Language english
-
languagesByTemplate
protected Map<BuiltinLanguage,Language> languagesByTemplate
-
mainChannel
protected Channel mainChannel
-
webServicesChannel
protected Channel webServicesChannel
-
oidcChannel
protected Channel oidcChannel
-
smsChannel
protected Channel smsChannel
-
posChannel
protected Channel posChannel
-
mobileChannel
protected Channel mobileChannel
-
ticketChannel
protected Channel ticketChannel
-
easyInvoiceChannel
protected Channel easyInvoiceChannel
-
csv
protected ExportFormat csv
-
xlsx
protected ExportFormat xlsx
-
pdf
protected ExportFormat pdf
-
globalDefaultConfig
protected Configuration globalDefaultConfig
-
globalDefaultMainChannel
protected ChannelConfiguration globalDefaultMainChannel
-
globalDefaultWebServicesChannel
protected ChannelConfiguration globalDefaultWebServicesChannel
-
globalDefaultOidcChannel
protected ChannelConfiguration globalDefaultOidcChannel
-
globalDefaultSmsChannel
protected ChannelConfiguration globalDefaultSmsChannel
-
globalDefaultPosChannel
protected ChannelConfiguration globalDefaultPosChannel
-
globalDefaultMobileChannel
protected ChannelConfiguration globalDefaultMobileChannel
-
globalDefaultTicketChannel
protected ChannelConfiguration globalDefaultTicketChannel
-
globalDefaultEasyInvoiceChannel
protected ChannelConfiguration globalDefaultEasyInvoiceChannel
-
globalAdminsGroup
protected AdminGroup globalAdminsGroup
-
globalImgCat
protected SystemImageCategory globalImgCat
-
admin
protected User admin
-
defaultMainWebTheme
protected Theme defaultMainWebTheme
-
defaultMobileTheme
protected Theme defaultMobileTheme
-
defaultPayTheme
protected Theme defaultPayTheme
-
defaultAppTheme
protected Theme defaultAppTheme
-
-
Method Detail
-
getDisplayName
public String getDisplayName()
Description copied from interface:DatabasePopulatorShould a descriptive name for the kind of database is being created
-
populate
public void populate()
Description copied from interface:DatabasePopulatorPopulates the database with data
-
assignProductToBasicGroup
protected void assignProductToBasicGroup(Product product, BasicGroup group)
-
createGlobalAdmin
protected void createGlobalAdmin()
-
createProductMyBasicProfileFields
protected List<ProductMyProfileFieldDTO> createProductMyBasicProfileFields()
-
createProductMyProfileField
protected ProductMyProfileFieldDTO createProductMyProfileField(ProfileField profileField, boolean enabled, boolean visible, boolean editable, boolean editableAtRegistration, boolean managePrivacy)
-
createProductUserProfileField
protected ProductUserProfileFieldDTO createProductUserProfileField(Collection<ProductUserProfileFieldDTO> existing, ProfileField profileField, boolean visible, boolean editable, boolean keywords)
-
createProductUserProfileFields
protected List<ProductUserProfileFieldDTO> createProductUserProfileFields(Collection<ProductUserProfileFieldDTO> existing, boolean manager, UserCustomField... customFields)
-
getLoginPasswordMinLength
protected int getLoginPasswordMinLength()
Return the min length required for the login password
-
loadContentAndImportImages
protected String loadContentAndImportImages(String resource, SystemImageCategory category)
Loads the content of the given resource, processing all tags [[imageName]] as system custom images, importing the content of those file names (relative to the original resource) as system custom images
-
loadGroovyScript
protected String loadGroovyScript(String scriptPath, boolean isOptional)
It loads a Groovy script file. If the script's path doesn't end with the corresponding extension ('groovy') then it's appended- Returns:
- if it's an optional script then the script's code or null if the file was not found. Otherwise the code
or
#IllegalStateException
-
set
protected <T> void set(ConfigurationDTO configuration, Property<T,? super ConfigurationDTO> property, T value)
Sets a configuration DTO property, marking it as defined
-
setChannelConfiguration
protected ChannelConfiguration setChannelConfiguration(Configuration configuration, Channel channel, UserChannelAccess userAccess, PasswordType accessPassword, PasswordType confirmationPassword, TimeInterval sessionTimeout)
-
setGroupConfiguration
protected void setGroupConfiguration(BasicGroup group, Configuration configuration)
-
-