idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
145,400
private void saveToPropertyVfsBundle ( ) throws CmsException { for ( Locale l : m_changedTranslations ) { SortedProperties props = m_localizations . get ( l ) ; LockedFile f = m_lockedBundleFiles . get ( l ) ; if ( ( null != props ) && ( null != f ) ) { try { ByteArrayOutputStream outputStream = new ByteArrayOutputStre...
Saves messages to a propertyvfsbundle file .
145,401
private void saveToXmlVfsBundle ( ) throws CmsException { if ( m_lockedBundleFiles . get ( null ) != null ) { for ( Locale l : m_locales ) { SortedProperties props = m_localizations . get ( l ) ; if ( null != props ) { if ( m_xmlBundle . hasLocale ( l ) ) { m_xmlBundle . removeLocale ( l ) ; } m_xmlBundle . addLocale (...
Saves messages to a xmlvfsbundle file .
145,402
private void setResourceInformation ( ) { String sitePath = m_cms . getSitePath ( m_resource ) ; int pathEnd = sitePath . lastIndexOf ( '/' ) + 1 ; String baseName = sitePath . substring ( pathEnd ) ; m_sitepath = sitePath . substring ( 0 , pathEnd ) ; switch ( CmsMessageBundleEditorTypes . BundleType . toBundleType ( ...
Extract site path base name and locale from the resource opened with the editor .
145,403
private void unmarshalDescriptor ( ) throws CmsXmlException , CmsException { if ( null != m_desc ) { m_descContent = CmsXmlContentFactory . unmarshal ( m_cms , m_cms . readFile ( m_desc ) ) ; CmsProperty bundleProp = m_cms . readPropertyObject ( m_desc , PROPERTY_BUNDLE_DESCRIPTOR_LOCALIZATION , true ) ; if ( ! ( bundl...
Unmarshals the descriptor content .
145,404
private void updateBundleDescriptorContent ( ) throws CmsXmlException { if ( m_descContent . hasLocale ( Descriptor . LOCALE ) ) { m_descContent . removeLocale ( Descriptor . LOCALE ) ; } m_descContent . addLocale ( m_cms , Descriptor . LOCALE ) ; int i = 0 ; Property < Object > descProp ; String desc ; Property < Obje...
Update the descriptor content with values from the editor .
145,405
protected void removeInvalidChildren ( ) { if ( getLoadState ( ) == LoadState . LOADED ) { List < CmsSitemapTreeItem > toDelete = new ArrayList < CmsSitemapTreeItem > ( ) ; for ( int i = 0 ; i < getChildCount ( ) ; i ++ ) { CmsSitemapTreeItem item = ( CmsSitemapTreeItem ) getChild ( i ) ; CmsUUID id = item . getEntryId...
Helper method to remove invalid children that don t have a corresponding CmsSitemapClientEntry .
145,406
@ UiHandler ( "m_everyDay" ) void onEveryDayChange ( ValueChangeEvent < String > event ) { if ( handleChange ( ) ) { m_controller . setInterval ( m_everyDay . getFormValueAsString ( ) ) ; } }
Handle interval change .
145,407
private String getApiKey ( CmsObject cms , String sitePath ) throws CmsException { String res = cms . readPropertyObject ( sitePath , CmsPropertyDefinition . PROPERTY_GOOGLE_API_KEY_WORKPLACE , true ) . getValue ( ) ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( res ) ) { res = cms . readPropertyObject ( sitePath , C...
Get the correct google api key . Tries to read a workplace key first .
145,408
private void propagateFacetNames ( ) { Collection < String > facetNames = new ArrayList < String > ( ) ; Collection < I_CmsSearchConfigurationFacet > facetConfigs = new ArrayList < I_CmsSearchConfigurationFacet > ( ) ; facetNames . addAll ( m_fieldFacets . keySet ( ) ) ; facetConfigs . addAll ( m_fieldFacets . values (...
Propagates the names of all facets to each single facet .
145,409
private int getDaysToNextMatch ( WeekDay weekDay ) { for ( WeekDay wd : m_weekDays ) { if ( wd . compareTo ( weekDay ) > 0 ) { return wd . toInt ( ) - weekDay . toInt ( ) ; } } return ( m_weekDays . iterator ( ) . next ( ) . toInt ( ) + ( m_interval * I_CmsSerialDateValue . NUM_OF_WEEKDAYS ) ) - weekDay . toInt ( ) ; }
Returns the number of days from the given weekday to the next weekday the event should occur .
145,410
public static I_CmsMacroResolver newWorkplaceLocaleResolver ( final CmsObject cms ) { CmsMacroResolver resolver = new CmsMacroResolver ( ) ; resolver . setCmsObject ( cms ) ; CmsUserSettings userSettings = new CmsUserSettings ( cms . getRequestContext ( ) . getCurrentUser ( ) ) ; CmsMultiMessages multimessages = new Cm...
Returns a new macro resolver that loads message keys from the workplace bundle in the user setting s language .
145,411
protected static List < String > parseMandatoryStringValues ( JSONObject json , String key ) throws JSONException { List < String > list = null ; JSONArray array = json . getJSONArray ( key ) ; list = new ArrayList < String > ( array . length ( ) ) ; for ( int i = 0 ; i < array . length ( ) ; i ++ ) { try { String entr...
Helper for reading a mandatory String value list - throwing an Exception if parsing fails .
145,412
protected Boolean getEscapeQueryChars ( ) { Boolean isEscape = parseOptionalBooleanValue ( m_configObject , JSON_KEY_ESCAPE_QUERY_CHARACTERS ) ; return ( null == isEscape ) && ( m_baseConfig != null ) ? Boolean . valueOf ( m_baseConfig . getGeneralConfig ( ) . getEscapeQueryChars ( ) ) : isEscape ; }
Returns the flag indicating if the characters in the query string that are commands to Solr should be escaped .
145,413
protected String getExtraSolrParams ( ) { try { return m_configObject . getString ( JSON_KEY_EXTRASOLRPARAMS ) ; } catch ( JSONException e ) { if ( null == m_baseConfig ) { if ( LOG . isInfoEnabled ( ) ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_NO_EXTRA_PARAMETERS_0 ) , e ) ; } return ""...
Returns the configured extra parameters that should be given to Solr or the empty string if no parameters are configured .
145,414
protected Boolean getIgnoreExpirationDate ( ) { Boolean isIgnoreExpirationDate = parseOptionalBooleanValue ( m_configObject , JSON_KEY_IGNORE_EXPIRATION_DATE ) ; return ( null == isIgnoreExpirationDate ) && ( m_baseConfig != null ) ? Boolean . valueOf ( m_baseConfig . getGeneralConfig ( ) . getIgnoreExpirationDate ( ) ...
Returns a flag indicating if also expired resources should be found .
145,415
protected Boolean getIgnoreQuery ( ) { Boolean isIgnoreQuery = parseOptionalBooleanValue ( m_configObject , JSON_KEY_IGNORE_QUERY ) ; return ( null == isIgnoreQuery ) && ( m_baseConfig != null ) ? Boolean . valueOf ( m_baseConfig . getGeneralConfig ( ) . getIgnoreQueryParam ( ) ) : isIgnoreQuery ; }
Returns a flag indicating if the query given by the parameters should be ignored .
145,416
protected Boolean getIgnoreReleaseDate ( ) { Boolean isIgnoreReleaseDate = parseOptionalBooleanValue ( m_configObject , JSON_KEY_IGNORE_RELEASE_DATE ) ; return ( null == isIgnoreReleaseDate ) && ( m_baseConfig != null ) ? Boolean . valueOf ( m_baseConfig . getGeneralConfig ( ) . getIgnoreReleaseDate ( ) ) : isIgnoreRel...
Returns a flag indicating if also unreleased resources should be found .
145,417
protected List < Integer > getPageSizes ( ) { try { return Collections . singletonList ( Integer . valueOf ( m_configObject . getInt ( JSON_KEY_PAGESIZE ) ) ) ; } catch ( JSONException e ) { List < Integer > result = null ; String pageSizesString = null ; try { pageSizesString = m_configObject . getString ( JSON_KEY_PA...
Returns the configured page sizes or the default page size if no core is configured .
145,418
protected String getQueryModifier ( ) { String queryModifier = parseOptionalStringValue ( m_configObject , JSON_KEY_QUERY_MODIFIER ) ; return ( null == queryModifier ) && ( null != m_baseConfig ) ? m_baseConfig . getGeneralConfig ( ) . getQueryModifier ( ) : queryModifier ; }
Returns the optional query modifier .
145,419
protected String getQueryParam ( ) { String param = parseOptionalStringValue ( m_configObject , JSON_KEY_QUERYPARAM ) ; if ( param == null ) { return null != m_baseConfig ? m_baseConfig . getGeneralConfig ( ) . getQueryParam ( ) : DEFAULT_QUERY_PARAM ; } else { return param ; } }
Returns the configured request parameter for the query string or the default parameter if no core is configured .
145,420
protected Boolean getSearchForEmptyQuery ( ) { Boolean isSearchForEmptyQuery = parseOptionalBooleanValue ( m_configObject , JSON_KEY_SEARCH_FOR_EMPTY_QUERY ) ; return ( isSearchForEmptyQuery == null ) && ( null != m_baseConfig ) ? Boolean . valueOf ( m_baseConfig . getGeneralConfig ( ) . getSearchForEmptyQueryParam ( )...
Returns a flag indicating if search should be performed using a wildcard if the empty query is given .
145,421
protected List < I_CmsSearchConfigurationSortOption > getSortOptions ( ) { List < I_CmsSearchConfigurationSortOption > options = new LinkedList < I_CmsSearchConfigurationSortOption > ( ) ; try { JSONArray sortOptions = m_configObject . getJSONArray ( JSON_KEY_SORTOPTIONS ) ; for ( int i = 0 ; i < sortOptions . length (...
Returns the list of the configured sort options or the empty list if no sort options are configured .
145,422
protected void init ( String configString , I_CmsSearchConfiguration baseConfig ) throws JSONException { m_configObject = new JSONObject ( configString ) ; m_baseConfig = baseConfig ; }
Initialization that parses the String to a JSON object .
145,423
protected I_CmsFacetQueryItem parseFacetQueryItem ( JSONObject item ) { String query ; try { query = item . getString ( JSON_KEY_QUERY_FACET_QUERY_QUERY ) ; } catch ( JSONException e ) { return null ; } String label = parseOptionalStringValue ( item , JSON_KEY_QUERY_FACET_QUERY_LABEL ) ; return new CmsFacetQueryItem ( ...
Parses a single query item for the query facet .
145,424
protected List < I_CmsFacetQueryItem > parseFacetQueryItems ( JSONObject queryFacetObject ) throws JSONException { JSONArray items = queryFacetObject . getJSONArray ( JSON_KEY_QUERY_FACET_QUERY ) ; List < I_CmsFacetQueryItem > result = new ArrayList < I_CmsFacetQueryItem > ( items . length ( ) ) ; for ( int i = 0 ; i <...
Parses the list of query items for the query facet .
145,425
protected I_CmsSearchConfigurationFacetField parseFieldFacet ( JSONObject fieldFacetObject ) { try { String field = fieldFacetObject . getString ( JSON_KEY_FACET_FIELD ) ; String name = parseOptionalStringValue ( fieldFacetObject , JSON_KEY_FACET_NAME ) ; String label = parseOptionalStringValue ( fieldFacetObject , JSO...
Parses the field facet configurations .
145,426
protected I_CmsSearchConfigurationFacetRange parseRangeFacet ( JSONObject rangeFacetObject ) { try { String range = rangeFacetObject . getString ( JSON_KEY_RANGE_FACET_RANGE ) ; String name = parseOptionalStringValue ( rangeFacetObject , JSON_KEY_FACET_NAME ) ; String label = parseOptionalStringValue ( rangeFacetObject...
Parses the query facet configurations .
145,427
protected I_CmsSearchConfigurationSortOption parseSortOption ( JSONObject json ) { try { String solrValue = json . getString ( JSON_KEY_SORTOPTION_SOLRVALUE ) ; String paramValue = parseOptionalStringValue ( json , JSON_KEY_SORTOPTION_PARAMVALUE ) ; paramValue = ( paramValue == null ) ? solrValue : paramValue ; String ...
Returns a single sort option configuration as configured via the methods parameter or null if the parameter does not specify a sort option .
145,428
private Map < String , String > mergeItem ( String item , Map < String , String > localeValues , Map < String , String > resultLocaleValues ) { if ( resultLocaleValues . get ( item ) != null ) { if ( localeValues . get ( item ) != null ) { localeValues . put ( item , localeValues . get ( item ) + " " + resultLocaleValu...
Merges the item from the resultLocaleValues into the corresponding item of the localeValues .
145,429
public static CmsGalleryTabConfiguration resolve ( String configStr ) { CmsGalleryTabConfiguration tabConfig ; if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( configStr ) ) { configStr = "*sitemap,types,galleries,categories,vfstree,search,results" ; } if ( DEFAULT_CONFIGURATIONS != null ) { tabConfig = DEFAULT_CONFIGURA...
Given a string which is either the name of a predefined tab configuration or a configuration string returns the corresponding tab configuration .
145,430
private void forward ( ) { Set < String > selected = new HashSet < > ( ) ; for ( CheckBox checkbox : m_componentCheckboxes ) { CmsSetupComponent component = ( CmsSetupComponent ) ( checkbox . getData ( ) ) ; if ( checkbox . getValue ( ) . booleanValue ( ) ) { selected . add ( component . getId ( ) ) ; } } String error ...
Moves to the next step .
145,431
private void initComponents ( List < CmsSetupComponent > components ) { for ( CmsSetupComponent component : components ) { CheckBox checkbox = new CheckBox ( ) ; checkbox . setValue ( component . isChecked ( ) ) ; checkbox . setCaption ( component . getName ( ) + " - " + component . getDescription ( ) ) ; checkbox . se...
Initializes the components .
145,432
protected void addFacetPart ( CmsSolrQuery query ) { query . set ( "facet" , "true" ) ; String excludes = "" ; if ( m_config . getIgnoreAllFacetFilters ( ) || ( ! m_state . getCheckedEntries ( ) . isEmpty ( ) && ! m_config . getIsAndFacet ( ) ) ) { excludes = "{!ex=" + m_config . getIgnoreTags ( ) + "}" ; } for ( I_Cms...
Add query part for the facet without filters .
145,433
protected void convertSearchResults ( final Collection < CmsSearchResource > searchResults ) { m_foundResources = new ArrayList < I_CmsSearchResourceBean > ( ) ; for ( final CmsSearchResource searchResult : searchResults ) { m_foundResources . add ( new CmsSearchResourceBean ( searchResult , m_cmsObject ) ) ; } }
Converts the search results from CmsSearchResource to CmsSearchResourceBean .
145,434
public void addAliasToConfigSite ( String alias , String redirect , String offset ) { long timeOffset = 0 ; try { timeOffset = Long . parseLong ( offset ) ; } catch ( Throwable e ) { } CmsSiteMatcher siteMatcher = new CmsSiteMatcher ( alias , timeOffset ) ; boolean redirectVal = new Boolean ( redirect ) . booleanValue ...
Adds an alias to the currently configured site .
145,435
private void addServer ( CmsSiteMatcher matcher , CmsSite site ) { Map < CmsSiteMatcher , CmsSite > siteMatcherSites = new HashMap < CmsSiteMatcher , CmsSite > ( m_siteMatcherSites ) ; siteMatcherSites . put ( matcher , site ) ; setSiteMatcherSites ( siteMatcherSites ) ; }
Adds a new Site matcher object to the map of server names .
145,436
private void updateLetsEncrypt ( ) { getReport ( ) . println ( Messages . get ( ) . container ( Messages . RPT_STARTING_LETSENCRYPT_UPDATE_0 ) ) ; CmsLetsEncryptConfiguration config = OpenCms . getLetsEncryptConfig ( ) ; if ( ( config == null ) || ! config . isValidAndEnabled ( ) ) { return ; } CmsSiteConfigToLetsEncry...
Updates LetsEncrypt configuration .
145,437
private String getDynamicAttributeValue ( CmsFile file , I_CmsXmlContentValue value , String attributeName , CmsEntity editedLocalEntity ) { if ( ( null != editedLocalEntity ) && ( editedLocalEntity . getAttribute ( attributeName ) != null ) ) { getSessionCache ( ) . setDynamicValue ( attributeName , editedLocalEntity ...
Returns the value that has to be set for the dynamic attribute .
145,438
public void setMonth ( String monthStr ) { final Month month = Month . valueOf ( monthStr ) ; if ( ( m_model . getMonth ( ) == null ) || ! m_model . getMonth ( ) . equals ( monthStr ) ) { removeExceptionsOnChange ( new Command ( ) { public void execute ( ) { m_model . setMonth ( month ) ; onValueChange ( ) ; } } ) ; } ...
Set the month .
145,439
public void setPatternScheme ( final boolean isWeekDayBased ) { if ( isWeekDayBased ^ ( null != m_model . getWeekDay ( ) ) ) { removeExceptionsOnChange ( new Command ( ) { public void execute ( ) { if ( isWeekDayBased ) { m_model . setWeekDay ( getPatternDefaultValues ( ) . getWeekDay ( ) ) ; m_model . setWeekOfMonth (...
Set the pattern scheme .
145,440
public void setWeekDay ( String weekDayStr ) { final WeekDay weekDay = WeekDay . valueOf ( weekDayStr ) ; if ( ( m_model . getWeekDay ( ) != null ) || ! m_model . getWeekDay ( ) . equals ( weekDay ) ) { removeExceptionsOnChange ( new Command ( ) { public void execute ( ) { m_model . setWeekDay ( weekDay ) ; onValueChan...
Set the week day .
145,441
public void setWeekOfMonth ( String weekOfMonthStr ) { final WeekOfMonth weekOfMonth = WeekOfMonth . valueOf ( weekOfMonthStr ) ; if ( ( null == m_model . getWeekOfMonth ( ) ) || ! m_model . getWeekOfMonth ( ) . equals ( weekOfMonth ) ) { removeExceptionsOnChange ( new Command ( ) { public void execute ( ) { m_model . ...
Set the week of month .
145,442
public static String getLocalizedKey ( Map < String , ? > propertiesMap , String key , Locale locale ) { List < String > localizedKeys = CmsLocaleManager . getLocaleVariants ( key , locale , true , false ) ; for ( String localizedKey : localizedKeys ) { if ( propertiesMap . containsKey ( localizedKey ) ) { return local...
Returns the key for the best matching local - specific property version .
145,443
private List < CmsSearchField > getFields ( ) { CmsSearchManager manager = OpenCms . getSearchManager ( ) ; I_CmsSearchFieldConfiguration fieldConfig = manager . getFieldConfiguration ( getParamFieldconfiguration ( ) ) ; List < CmsSearchField > result ; if ( fieldConfig != null ) { result = fieldConfig . getFields ( ) ...
Returns the configured fields of the current field configuration .
145,444
public static Function < String , String > createStringTemplateSource ( I_CmsFormatterBean formatter , Supplier < CmsXmlContent > contentSupplier ) { return key -> { String result = null ; if ( formatter != null ) { result = formatter . getAttributes ( ) . get ( key ) ; } if ( result == null ) { CmsXmlContent content =...
Helper method to create a string template source for a given formatter and content .
145,445
private Map < String , String > getContentsByContainerName ( CmsContainerElementBean element , Collection < CmsContainer > containers ) { CmsFormatterConfiguration configs = getFormatterConfiguration ( element . getResource ( ) ) ; Map < String , String > result = new HashMap < String , String > ( ) ; for ( CmsContaine...
Returns the rendered element content for all the given containers .
145,446
public void setWorkConnection ( CmsSetupDb db ) { db . setConnection ( m_setupBean . getDbDriver ( ) , m_setupBean . getDbWorkConStr ( ) , m_setupBean . getDbConStrParams ( ) , m_setupBean . getDbWorkUser ( ) , m_setupBean . getDbWorkPwd ( ) ) ; }
Set work connection .
145,447
private void updateDb ( String dbName , String webapp ) { m_mainLayout . removeAllComponents ( ) ; m_setupBean . setDatabase ( dbName ) ; CmsDbSettingsPanel panel = new CmsDbSettingsPanel ( m_setupBean ) ; m_panel [ 0 ] = panel ; panel . initFromSetupBean ( webapp ) ; m_mainLayout . addComponent ( panel ) ; }
Switches DB type .
145,448
public void removeExpiration ( ) { if ( getFilterQueries ( ) != null ) { for ( String fq : getFilterQueries ( ) ) { if ( fq . startsWith ( CmsSearchField . FIELD_DATE_EXPIRED + ":" ) || fq . startsWith ( CmsSearchField . FIELD_DATE_RELEASED + ":" ) ) { removeFilterQuery ( fq ) ; } } } m_ignoreExpiration = true ; }
Removes the expiration flag .
145,449
public Map < String , CmsJspCategoryAccessBean > getReadAllSubCategories ( ) { if ( null == m_allSubCategories ) { m_allSubCategories = CmsCollectionsGenericWrapper . createLazyMap ( new Transformer ( ) { public Object transform ( Object categoryPath ) { try { List < CmsCategory > categories = CmsCategoryService . getI...
Reads all sub - categories below the provided category .
145,450
public Map < String , CmsCategory > getReadCategory ( ) { if ( null == m_categories ) { m_categories = CmsCollectionsGenericWrapper . createLazyMap ( new Transformer ( ) { public Object transform ( Object categoryPath ) { try { CmsCategoryService catService = CmsCategoryService . getInstance ( ) ; return catService . l...
Transforms the category path of a category to the category .
145,451
public Map < String , CmsJspCategoryAccessBean > getReadResourceCategories ( ) { if ( null == m_resourceCategories ) { m_resourceCategories = CmsCollectionsGenericWrapper . createLazyMap ( new Transformer ( ) { public Object transform ( Object resourceName ) { try { CmsResource resource = m_cms . readResource ( getRequ...
Reads the categories assigned to a resource .
145,452
public Map < String , String > getSitePath ( ) { if ( m_sitePaths == null ) { m_sitePaths = CmsCollectionsGenericWrapper . createLazyMap ( new Transformer ( ) { public Object transform ( Object rootPath ) { if ( rootPath instanceof String ) { return getRequestContext ( ) . removeSiteRoot ( ( String ) rootPath ) ; } ret...
Transforms root paths to site paths .
145,453
public Map < String , String > getTitleLocale ( ) { if ( m_localeTitles == null ) { m_localeTitles = CmsCollectionsGenericWrapper . createLazyMap ( new Transformer ( ) { public Object transform ( Object inputLocale ) { Locale locale = null ; if ( null != inputLocale ) { if ( inputLocale instanceof Locale ) { locale = (...
Get the title and read the Title property according the provided locale .
145,454
protected String getLocaleSpecificTitle ( Locale locale ) { String result = null ; try { if ( isDetailRequest ( ) ) { CmsResource res = getDetailContent ( ) ; CmsFile file = m_cms . readFile ( res ) ; CmsXmlContent content = CmsXmlContentFactory . unmarshal ( m_cms , file ) ; result = content . getHandler ( ) . getTitl...
Returns the title according to the given locale .
145,455
public void setStringValue ( String value ) { if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( value ) ) { try { m_editValue = CmsLocationValue . parse ( value ) ; m_currentValue = m_editValue . cloneValue ( ) ; displayValue ( ) ; if ( ( m_popup != null ) && m_popup . isVisible ( ) ) { m_popupContent . displayValues (...
Sets the location value as string .
145,456
public static byte [ ] hashPassword ( String password ) throws InvalidKeyException , NoSuchAlgorithmException { PasswordEncryptor encryptor = new PasswordEncryptor ( ) ; return encryptor . generateEncryptedPassword ( password , null , PasswordEncryptor . MD4 , null , null ) ; }
Computes an MD4 hash for the password .
145,457
public void setHeader ( String header , String value ) { StringValidator . throwIfEmptyOrNull ( "header" , header ) ; StringValidator . throwIfEmptyOrNull ( "value" , value ) ; if ( headers == null ) { headers = new HashMap < String , String > ( ) ; } headers . put ( header , value ) ; }
Sets a request header with the given name and value . If a header with the specified name has already been set then the new value overwrites the current value .
145,458
protected List < CmsResource > getTopFolders ( List < CmsResource > folders ) { List < String > folderPaths = new ArrayList < String > ( ) ; List < CmsResource > topFolders = new ArrayList < CmsResource > ( ) ; Map < String , CmsResource > foldersByPath = new HashMap < String , CmsResource > ( ) ; for ( CmsResource fol...
Gives the roots of a list of folders i . e . the list of folders which are not descendants of any other folders in the original list
145,459
public void setDates ( SortedSet < Date > dates ) { if ( ! m_model . getIndividualDates ( ) . equals ( dates ) ) { m_model . setIndividualDates ( dates ) ; onValueChange ( ) ; } }
Set the individual dates .
145,460
public static CmsSolrSpellchecker getInstance ( CoreContainer container ) { if ( null == instance ) { synchronized ( CmsSolrSpellchecker . class ) { if ( null == instance ) { @ SuppressWarnings ( "resource" ) SolrCore spellcheckCore = container . getCore ( CmsSolrSpellchecker . SPELLCHECKER_INDEX_CORE ) ; if ( spellche...
Return an instance of this class .
145,461
public void getSpellcheckingResult ( final HttpServletResponse res , final ServletRequest servletRequest , final CmsObject cms ) throws CmsPermissionViolationException , IOException { performPermissionCheck ( cms ) ; setResponeHeaders ( res ) ; CmsSpellcheckingRequest cmsSpellcheckingRequest = null ; try { String reque...
Performs spellchecking using Solr and returns the spellchecking results using JSON .
145,462
public void parseAndAddDictionaries ( CmsObject cms ) throws CmsRoleViolationException { OpenCms . getRoleManager ( ) . checkRole ( cms , CmsRole . ROOT_ADMIN ) ; CmsSpellcheckDictionaryIndexer . parseAndAddZippedDictionaries ( m_solrClient , cms ) ; CmsSpellcheckDictionaryIndexer . parseAndAddDictionaries ( m_solrClie...
Parses and adds dictionaries to the Solr index .
145,463
private JSONObject getConvertedResponseAsJson ( SpellCheckResponse response ) { if ( null == response ) { return null ; } final JSONObject suggestions = new JSONObject ( ) ; final Map < String , Suggestion > solrSuggestions = response . getSuggestionMap ( ) ; for ( final String key : solrSuggestions . keySet ( ) ) { bo...
Converts the suggestions from the Solrj format to JSON format .
145,464
private JSONObject getJsonFormattedSpellcheckResult ( CmsSpellcheckingRequest request ) { final JSONObject response = new JSONObject ( ) ; try { if ( null != request . m_id ) { response . put ( JSON_ID , request . m_id ) ; } response . put ( JSON_RESULT , request . m_wordSuggestions ) ; } catch ( Exception e ) { try { ...
Returns the result of the performed spellcheck formatted in JSON .
145,465
private String getRequestBody ( ServletRequest request ) throws IOException { final StringBuilder sb = new StringBuilder ( ) ; String line = request . getReader ( ) . readLine ( ) ; while ( null != line ) { sb . append ( line ) ; line = request . getReader ( ) . readLine ( ) ; } return sb . toString ( ) ; }
Returns the body of the request . This method is used to read posted JSON data .
145,466
private CmsSpellcheckingRequest parseHttpRequest ( final ServletRequest req , final CmsObject cms ) { if ( ( null != cms ) && OpenCms . getRoleManager ( ) . hasRole ( cms , CmsRole . ROOT_ADMIN ) ) { try { if ( null != req . getParameter ( HTTP_PARAMETER_CHECKREBUILD ) ) { if ( CmsSpellcheckDictionaryIndexer . updating...
Parse parameters from this request using HTTP .
145,467
private CmsSpellcheckingRequest parseJsonRequest ( JSONObject jsonRequest ) { final String id = jsonRequest . optString ( JSON_ID ) ; final JSONObject params = jsonRequest . optJSONObject ( JSON_PARAMS ) ; if ( null == params ) { LOG . debug ( "Invalid JSON request: No field \"params\" defined. " ) ; return null ; } fi...
Parse JSON parameters from this request .
145,468
private void performPermissionCheck ( CmsObject cms ) throws CmsPermissionViolationException { if ( cms . getRequestContext ( ) . getCurrentUser ( ) . isGuestUser ( ) ) { throw new CmsPermissionViolationException ( null ) ; } }
Perform a security check against OpenCms .
145,469
private SpellCheckResponse performSpellcheckQuery ( CmsSpellcheckingRequest request ) { if ( ( null == request ) || ! request . isInitialized ( ) ) { return null ; } final String [ ] wordsToCheck = request . m_wordsToCheck ; final ModifiableSolrParams params = new ModifiableSolrParams ( ) ; params . set ( "spellcheck" ...
Performs the actual spell check query using Solr .
145,470
private void sendResponse ( final HttpServletResponse res , final CmsSpellcheckingRequest request ) throws IOException { final PrintWriter pw = res . getWriter ( ) ; final JSONObject response = getJsonFormattedSpellcheckResult ( request ) ; pw . println ( response . toString ( ) ) ; pw . close ( ) ; }
Sends the JSON - formatted spellchecking results to the client .
145,471
private void setResponeHeaders ( HttpServletResponse response ) { response . setHeader ( "Cache-Control" , "no-store, no-cache" ) ; response . setHeader ( "Pragma" , "no-cache" ) ; response . setDateHeader ( "Expires" , System . currentTimeMillis ( ) ) ; response . setContentType ( "text/plain; charset=utf-8" ) ; respo...
Sets the appropriate headers to response of this request .
145,472
public static int toIntWithDefault ( String value , int defaultValue ) { int result = defaultValue ; try { result = Integer . parseInt ( value ) ; } catch ( @ SuppressWarnings ( "unused" ) Exception e ) { } return result ; }
Parses int value and returns the provided default if the value can t be parsed .
145,473
public void init ( NamedList args ) { Object regex = args . remove ( PARAM_REGEX ) ; if ( null == regex ) { throw new SolrException ( ErrorCode . SERVER_ERROR , "Missing required init parameter: " + PARAM_REGEX ) ; } try { m_regex = Pattern . compile ( regex . toString ( ) ) ; } catch ( PatternSyntaxException e ) { thr...
Read the parameters on initialization .
145,474
String getDefaultReturnFields ( ) { StringBuffer fields = new StringBuffer ( "" ) ; fields . append ( CmsSearchField . FIELD_PATH ) ; fields . append ( ',' ) ; fields . append ( CmsSearchField . FIELD_INSTANCEDATE ) . append ( '_' ) . append ( getSearchLocale ( ) . toString ( ) ) . append ( "_dt" ) ; fields . append ( ...
The fields returned by default . Typically the output is done via display formatters and hence nearly no field is necessary . Returning all fields might cause performance problems .
145,475
private Map < String , I_CmsSearchConfigurationFacetField > getDefaultFieldFacets ( boolean categoryConjunction ) { Map < String , I_CmsSearchConfigurationFacetField > fieldFacets = new HashMap < String , I_CmsSearchConfigurationFacetField > ( ) ; fieldFacets . put ( CmsListManager . FIELD_CATEGORIES , new CmsSearchCon...
The default field facets .
145,476
public static String stripHtml ( String html ) { if ( html == null ) { return null ; } Element el = DOM . createDiv ( ) ; el . setInnerHTML ( html ) ; return el . getInnerText ( ) ; }
Returns the text content to any HTML .
145,477
public void setUserInfo ( String username , String infoName , String value ) throws CmsException { CmsUser user = m_cms . readUser ( username ) ; user . setAdditionalInfo ( infoName , value ) ; m_cms . writeUser ( user ) ; }
Sets a string - valued additional info entry on the user .
145,478
public void setTimewarpInt ( String timewarp ) { try { m_userSettings . setTimeWarp ( Long . valueOf ( timewarp ) . longValue ( ) ) ; } catch ( Exception e ) { m_userSettings . setTimeWarp ( - 1 ) ; } }
Sets the timewarp setting from a numeric string
145,479
String buildSelect ( String htmlAttributes , SelectOptions options ) { return buildSelect ( htmlAttributes , options . getOptions ( ) , options . getValues ( ) , options . getSelectedIndex ( ) ) ; }
Builds the HTML code for a select widget given a bean containing the select options
145,480
private String getValueFromProp ( final String propValue ) { String value = propValue ; value = value . trim ( ) ; if ( ( value . startsWith ( "\"" ) && value . endsWith ( "\"" ) ) || ( value . startsWith ( "'" ) && value . endsWith ( "'" ) ) ) { value = value . substring ( 1 , value . length ( ) - 1 ) ; } return value...
Helper to read a line from the config file .
145,481
public String getDynamicValue ( String attribute ) { return null == m_dynamicValues ? null : m_dynamicValues . get ( attribute ) ; }
Get cached value that is dynamically loaded by the Acacia content editor .
145,482
public void setDynamicValue ( String attribute , String value ) { if ( null == m_dynamicValues ) { m_dynamicValues = new ConcurrentHashMap < String , String > ( ) ; } m_dynamicValues . put ( attribute , value ) ; }
Set cached value for the attribute . Used for dynamically loaded values in the Acacia content editor .
145,483
public static CmsPair < String , Map < String , String > > parseEmbeddedGalleryOptions ( String configuration ) { final Map < String , String > galleryOptions = Maps . newHashMap ( ) ; String resultConfig = CmsStringUtil . substitute ( PATTERN_EMBEDDED_GALLERY_CONFIG , configuration , new I_CmsRegexSubstitution ( ) { p...
Parses and removes embedded gallery configuration strings .
145,484
private void updateScaling ( ) { List < I_CmsTransform > transforms = new ArrayList < > ( ) ; CmsCroppingParamBean crop = m_croppingProvider . get ( ) ; CmsImageInfoBean info = m_imageInfoProvider . get ( ) ; double wv = m_image . getElement ( ) . getParentElement ( ) . getOffsetWidth ( ) ; double hv = m_image . getEle...
Sets up the coordinate transformations between the coordinate system of the parent element of the image element and the native coordinate system of the original image .
145,485
public static String getEncoding ( CmsObject cms , CmsResource file ) { CmsProperty encodingProperty = CmsProperty . getNullProperty ( ) ; try { encodingProperty = cms . readPropertyObject ( file , CmsPropertyDefinition . PROPERTY_CONTENT_ENCODING , true ) ; } catch ( CmsException e ) { LOG . debug ( e . getLocalizedMe...
Returns the encoding of the file . Encoding is read from the content - encoding property and defaults to the systems default encoding . Since properties can change without rewriting content the actual encoding can differ .
145,486
public String getEditorParameter ( CmsObject cms , String editor , String param ) { String path = OpenCms . getSystemInfo ( ) . getConfigFilePath ( cms , "editors/" + editor + ".properties" ) ; CmsVfsMemoryObjectCache cache = CmsVfsMemoryObjectCache . getVfsMemoryObjectCache ( ) ; CmsParameterConfiguration config = ( C...
Gets the value of a global editor configuration parameter .
145,487
public Date getEnd ( ) { if ( null != m_explicitEnd ) { return isWholeDay ( ) ? adjustForWholeDay ( m_explicitEnd , true ) : m_explicitEnd ; } if ( ( null == m_end ) && ( m_series . getInstanceDuration ( ) != null ) ) { m_end = new Date ( m_start . getTime ( ) + m_series . getInstanceDuration ( ) . longValue ( ) ) ; } ...
Returns the end time of the event .
145,488
public void setEnd ( Date endDate ) { if ( ( null == endDate ) || getStart ( ) . after ( endDate ) ) { m_explicitEnd = null ; } else { m_explicitEnd = endDate ; } }
Explicitly set the end time of the event .
145,489
private Date adjustForWholeDay ( Date date , boolean isEnd ) { Calendar result = new GregorianCalendar ( ) ; result . setTime ( date ) ; result . set ( Calendar . HOUR_OF_DAY , 0 ) ; result . set ( Calendar . MINUTE , 0 ) ; result . set ( Calendar . SECOND , 0 ) ; result . set ( Calendar . MILLISECOND , 0 ) ; if ( isEn...
Adjust the date according to the whole day options .
145,490
private boolean isSingleMultiDay ( ) { long duration = getEnd ( ) . getTime ( ) - getStart ( ) . getTime ( ) ; if ( duration > I_CmsSerialDateValue . DAY_IN_MILLIS ) { return true ; } if ( isWholeDay ( ) && ( duration <= I_CmsSerialDateValue . DAY_IN_MILLIS ) ) { return false ; } Calendar start = new GregorianCalendar ...
Returns a flag indicating if the current event is a multi - day event . The method is only called if the single event has an explicitely set end date or an explicitely changed whole day option .
145,491
public static void checkCreateUpload ( CmsObject cms , CmsUgcConfiguration config , String name , long size ) throws CmsUgcException { if ( ! config . getUploadParentFolder ( ) . isPresent ( ) ) { String message = Messages . get ( ) . container ( Messages . ERR_NO_UPLOADS_ALLOWED_0 ) . key ( cms . getRequestContext ( )...
Checks whether an uploaded file can be created in the VFS and throws an exception otherwise .
145,492
protected void addFacetPart ( CmsSolrQuery query ) { StringBuffer value = new StringBuffer ( ) ; value . append ( "{!key=" ) . append ( m_config . getName ( ) ) ; addFacetOptions ( value ) ; if ( m_config . getIgnoreAllFacetFilters ( ) || ( ! m_state . getCheckedEntries ( ) . isEmpty ( ) && ! m_config . getIsAndFacet (...
Generate query part for the facet without filters .
145,493
private void setFittingWeekDay ( Calendar date ) { date . set ( Calendar . DAY_OF_MONTH , 1 ) ; int weekDayFirst = date . get ( Calendar . DAY_OF_WEEK ) ; int firstFittingWeekDay = ( ( ( m_weekDay . toInt ( ) + I_CmsSerialDateValue . NUM_OF_WEEKDAYS ) - weekDayFirst ) % I_CmsSerialDateValue . NUM_OF_WEEKDAYS ) + 1 ; in...
Adjusts the day in the provided month that it fits the specified week day . If there s no match for that provided month the next possible month is checked .
145,494
public VerticalLayout getEmptyLayout ( ) { m_emptyLayout = CmsVaadinUtils . getInfoLayout ( CmsOuTreeType . USER . getEmptyMessageKey ( ) ) ; setVisible ( size ( ) > 0 ) ; m_emptyLayout . setVisible ( size ( ) == 0 ) ; return m_emptyLayout ; }
Layout which gets displayed if table is empty .
145,495
public List < CmsUser > getVisibleUser ( ) { if ( ! m_fullyLoaded ) { return m_users ; } if ( size ( ) == m_users . size ( ) ) { return m_users ; } List < CmsUser > directs = new ArrayList < CmsUser > ( ) ; for ( CmsUser user : m_users ) { if ( ! m_indirects . contains ( user ) ) { directs . add ( user ) ; } } return d...
Gets currently visible user .
145,496
String getStatus ( CmsUser user , boolean disabled , boolean newUser ) { if ( disabled ) { return CmsVaadinUtils . getMessageText ( Messages . GUI_USERMANAGEMENT_USER_DISABLED_0 ) ; } if ( newUser ) { return CmsVaadinUtils . getMessageText ( Messages . GUI_USERMANAGEMENT_USER_INACTIVE_0 ) ; } if ( OpenCms . getLoginMan...
Returns status message .
145,497
String getStatusHelp ( CmsUser user , boolean disabled , boolean newUser ) { if ( disabled ) { return CmsVaadinUtils . getMessageText ( Messages . GUI_USERMANAGEMENT_USER_DISABLED_HELP_0 ) ; } if ( newUser ) { return CmsVaadinUtils . getMessageText ( Messages . GUI_USERMANAGEMENT_USER_INACTIVE_HELP_0 ) ; } if ( isUserP...
Returns status help message .
145,498
boolean isUserPasswordReset ( CmsUser user ) { if ( USER_PASSWORD_STATUS . containsKey ( user . getId ( ) ) ) { if ( ! USER_PASSWORD_STATUS . get ( user . getId ( ) ) . booleanValue ( ) ) { return false ; } if ( m_checkedUserPasswordReset . contains ( user . getId ( ) ) ) { return true ; } } CmsUser currentUser = user ...
Is the user password reset?
145,499
public CmsSolrQuery getQuery ( CmsObject cms ) { final CmsSolrQuery query = new CmsSolrQuery ( ) ; query . setCategories ( m_categories ) ; if ( null != m_containerTypes ) { query . addFilterQuery ( CmsSearchField . FIELD_CONTAINER_TYPES , m_containerTypes , false , false ) ; } query . addFilterQuery ( CmsSearchUtil . ...
Returns a CmsSolrQuery representation of this class .