idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
21,500
private void fillToolBar ( final I_CmsAppUIContext context ) { context . setAppTitle ( m_messages . key ( Messages . GUI_APP_TITLE_0 ) ) ; Component publishBtn = createPublishButton ( ) ; m_saveBtn = createSaveButton ( ) ; m_saveExitBtn = createSaveExitButton ( ) ; Component closeBtn = createCloseButton ( ) ; context ....
Adds Editor specific UI components to the toolbar .
21,501
private void handleChange ( Object propertyId ) { if ( ! m_saveBtn . isEnabled ( ) ) { m_saveBtn . setEnabled ( true ) ; m_saveExitBtn . setEnabled ( true ) ; } m_model . handleChange ( propertyId ) ; }
Handle a value change .
21,502
private void initFieldFactories ( ) { if ( m_model . hasMasterMode ( ) ) { TranslateTableFieldFactory masterFieldFactory = new CmsMessageBundleEditorTypes . TranslateTableFieldFactory ( m_table , m_model . getEditableColumns ( CmsMessageBundleEditorTypes . EditMode . MASTER ) ) ; masterFieldFactory . registerKeyChangeL...
Initialize the field factories for the messages table .
21,503
private void initStyleGenerators ( ) { if ( m_model . hasMasterMode ( ) ) { m_styleGenerators . put ( CmsMessageBundleEditorTypes . EditMode . MASTER , new CmsMessageBundleEditorTypes . TranslateTableCellStyleGenerator ( m_model . getEditableColumns ( CmsMessageBundleEditorTypes . EditMode . MASTER ) ) ) ; } m_styleGen...
Initialize the style generators for the messages table .
21,504
private boolean keyAlreadyExists ( String newKey ) { Collection < ? > itemIds = m_table . getItemIds ( ) ; for ( Object itemId : itemIds ) { if ( m_table . getItem ( itemId ) . getItemProperty ( TableProperty . KEY ) . getValue ( ) . equals ( newKey ) ) { return true ; } } return false ; }
Checks if a key already exists .
21,505
public void uploadFields ( final Set < String > fields , final Function < Map < String , String > , Void > filenameCallback , final I_CmsErrorCallback errorCallback ) { disableAllFileFieldsExcept ( fields ) ; final String id = CmsJsUtils . generateRandomId ( ) ; updateFormAction ( id ) ; final HandlerRegistration [ ] r...
Uploads files from the given file input fields . <p<
21,506
public static CmsJspResourceWrapper convertResource ( CmsObject cms , Object input ) throws CmsException { CmsJspResourceWrapper result ; if ( input instanceof CmsResource ) { result = CmsJspResourceWrapper . wrap ( cms , ( CmsResource ) input ) ; } else { result = CmsJspResourceWrapper . wrap ( cms , convertRawResourc...
Returns a resource wrapper created from the input .
21,507
public static List < CmsJspResourceWrapper > convertResourceList ( CmsObject cms , List < CmsResource > list ) { List < CmsJspResourceWrapper > result = new ArrayList < CmsJspResourceWrapper > ( list . size ( ) ) ; for ( CmsResource res : list ) { result . add ( CmsJspResourceWrapper . wrap ( cms , res ) ) ; } return r...
Returns a list of resource wrappers created from the input list of resources .
21,508
public static I_CmsSearchConfigurationPagination create ( String pageParam , List < Integer > pageSizes , Integer pageNavLength ) { return ( pageParam != null ) || ( pageSizes != null ) || ( pageNavLength != null ) ? new CmsSearchConfigurationPagination ( pageParam , pageSizes , pageNavLength ) : null ; }
Creates a new pagination configuration if at least one of the provided parameters is not null . Otherwise returns null .
21,509
public static String getDateCreatedTimeRangeFilterQuery ( String searchField , long startTime , long endTime ) { String sStartTime = null ; String sEndTime = null ; if ( ( startTime > Long . MIN_VALUE ) && ( startTime < Long . MAX_VALUE ) ) { sStartTime = CmsSearchUtil . getDateAsIso8601 ( new Date ( startTime ) ) ; } ...
Returns a time interval as Solr compatible query string .
21,510
public static String getSolrRangeString ( String from , String to ) { if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( from ) ) { from = "*" ; } if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( to ) ) { to = "*" ; } return String . format ( "[%s TO %s]" , from , to ) ; }
Returns a string that represents a valid Solr query range .
21,511
public static Collection < ContentStream > toContentStreams ( final String str , final String contentType ) { if ( str == null ) { return null ; } ArrayList < ContentStream > streams = new ArrayList < > ( 1 ) ; ContentStreamBase ccc = new ContentStreamBase . StringStream ( str ) ; ccc . setContentType ( contentType ) ;...
Take a string and make it an iterable ContentStream
21,512
public static String paramMapToString ( final Map < String , String [ ] > parameters ) { final StringBuffer result = new StringBuffer ( ) ; for ( final String key : parameters . keySet ( ) ) { String [ ] values = parameters . get ( key ) ; if ( null == values ) { result . append ( key ) . append ( '&' ) ; } else { for ...
Converts a parameter map to the parameter string .
21,513
String getFacetParamKey ( String facet ) { I_CmsSearchControllerFacetField fieldFacet = m_result . getController ( ) . getFieldFacets ( ) . getFieldFacetController ( ) . get ( facet ) ; if ( fieldFacet != null ) { return fieldFacet . getConfig ( ) . getParamKey ( ) ; } I_CmsSearchControllerFacetRange rangeFacet = m_res...
Returns the parameter key of the facet with the given name .
21,514
public static void closeWindow ( Component component ) { Window window = getWindow ( component ) ; if ( window != null ) { window . close ( ) ; } }
Closes the window containing the given component .
21,515
@ SuppressWarnings ( "unchecked" ) public static < T > void defaultHandleContextMenuForMultiselect ( Table table , CmsContextMenu menu , ItemClickEvent event , List < I_CmsSimpleContextMenuEntry < Collection < T > > > entries ) { if ( ! event . isCtrlKey ( ) && ! event . isShiftKey ( ) ) { if ( event . getButton ( ) . ...
Simple context menu handler for multi - select tables .
21,516
public static IndexedContainer getGroupsOfUser ( CmsObject cms , CmsUser user , String caption , String iconProp , String ou , String propStatus , Function < CmsGroup , CmsCssIcon > iconProvider ) { IndexedContainer container = new IndexedContainer ( ) ; container . addContainerProperty ( caption , String . class , "" ...
Gets container with alls groups of a certain user .
21,517
public static IndexedContainer getPrincipalContainer ( CmsObject cms , List < ? extends I_CmsPrincipal > list , String captionID , String descID , String iconID , String ouID , String icon , List < FontIcon > iconList ) { IndexedContainer res = new IndexedContainer ( ) ; res . addContainerProperty ( captionID , String ...
Get container for principal .
21,518
public static void setFilterBoxStyle ( TextField searchBox ) { searchBox . setIcon ( FontOpenCms . FILTER ) ; searchBox . setPlaceholder ( org . opencms . ui . apps . Messages . get ( ) . getBundle ( UI . getCurrent ( ) . getLocale ( ) ) . key ( org . opencms . ui . apps . Messages . GUI_EXPLORER_FILTER_0 ) ) ; searchB...
Configures a text field to look like a filter box for a table .
21,519
protected ZipEntry getZipEntry ( String filename ) throws ZipException { ZipEntry entry = getZipFile ( ) . getEntry ( filename ) ; if ( ( entry == null ) && filename . startsWith ( "/" ) ) { entry = m_zipFile . getEntry ( filename . substring ( 1 ) ) ; } if ( entry == null ) { throw new ZipException ( Messages . get ( ...
Returns the zip entry for a file in the archive .
21,520
protected void appenHtmlFooter ( StringBuffer buffer ) { if ( m_configuredFooter != null ) { buffer . append ( m_configuredFooter ) ; } else { buffer . append ( " </body>\r\n" + "</html>" ) ; } }
Append the html - code to finish a html mail message to the given buffer .
21,521
public void openReport ( String newState , A_CmsReportThread thread , String label ) { setReport ( newState , thread ) ; m_labels . put ( thread , label ) ; openSubView ( newState , true ) ; }
Changes to a new sub - view and stores a report to be displayed by that subview . <p<
21,522
public static CmsUUID readId ( JSONObject obj , String key ) { String strValue = obj . optString ( key ) ; if ( ! CmsUUID . isValidUUID ( strValue ) ) { return null ; } return new CmsUUID ( strValue ) ; }
Reads a UUID from a JSON object .
21,523
public void setSiteRoot ( String siteRoot ) { if ( siteRoot != null ) { siteRoot = siteRoot . replaceFirst ( "/$" , "" ) ; } m_siteRoot = siteRoot ; }
Sets the site root .
21,524
public JSONObject toJson ( ) throws JSONException { JSONObject result = new JSONObject ( ) ; if ( m_detailId != null ) { result . put ( JSON_DETAIL , "" + m_detailId ) ; } if ( m_siteRoot != null ) { result . put ( JSON_SITEROOT , m_siteRoot ) ; } if ( m_structureId != null ) { result . put ( JSON_STRUCTUREID , "" + m_...
Converts this object to JSON .
21,525
public String updateContextAndGetFavoriteUrl ( CmsObject cms ) throws CmsException { CmsResourceFilter filter = CmsResourceFilter . IGNORE_EXPIRATION ; CmsProject project = null ; switch ( getType ( ) ) { case explorerFolder : CmsResource folder = cms . readResource ( getStructureId ( ) , filter ) ; project = cms . rea...
Prepares the CmsObject for jumping to this favorite location and returns the appropriate URL .
21,526
public static void openFavoriteDialog ( CmsFileExplorer explorer ) { try { CmsExplorerFavoriteContext context = new CmsExplorerFavoriteContext ( A_CmsUI . getCmsObject ( ) , explorer ) ; CmsFavoriteDialog dialog = new CmsFavoriteDialog ( context , new CmsFavoriteDAO ( A_CmsUI . getCmsObject ( ) ) ) ; Window window = Cm...
Opens the favorite dialog .
21,527
public static CmsResource getDescriptor ( CmsObject cms , String basename ) { CmsSolrQuery query = new CmsSolrQuery ( ) ; query . setResourceTypes ( CmsMessageBundleEditorTypes . BundleType . DESCRIPTOR . toString ( ) ) ; query . setFilterQueries ( "filename:\"" + basename + CmsMessageBundleEditorTypes . Descriptor . P...
Returns the bundle descriptor for the bundle with the provided base name .
21,528
static void showWarning ( final String caption , final String description ) { Notification warning = new Notification ( caption , description , Type . WARNING_MESSAGE , true ) ; warning . setDelayMsec ( - 1 ) ; warning . show ( UI . getCurrent ( ) . getPage ( ) ) ; }
Displays a localized warning .
21,529
public void setDateOnly ( boolean dateOnly ) { if ( m_dateOnly != dateOnly ) { m_dateOnly = dateOnly ; if ( m_dateOnly ) { m_time . removeFromParent ( ) ; m_am . removeFromParent ( ) ; m_pm . removeFromParent ( ) ; } else { m_timeField . add ( m_time ) ; m_timeField . add ( m_am ) ; m_timeField . add ( m_pm ) ; } } }
Sets the value if the date only should be shown .
21,530
@ UiHandler ( "m_addButton" ) void addButtonClick ( ClickEvent e ) { if ( null != m_newDate . getValue ( ) ) { m_dateList . addDate ( m_newDate . getValue ( ) ) ; m_newDate . setValue ( null ) ; if ( handleChange ( ) ) { m_controller . setDates ( m_dateList . getDates ( ) ) ; } } }
Handle click on Add button .
21,531
@ UiHandler ( "m_dateList" ) void dateListValueChange ( ValueChangeEvent < SortedSet < Date > > event ) { if ( handleChange ( ) ) { m_controller . setDates ( event . getValue ( ) ) ; } }
Handle value change event on the individual dates list .
21,532
public String remove ( Object key ) { String result = m_configurationStrings . remove ( key ) ; m_configurationObjects . remove ( key ) ; return result ; }
Removes a parameter from this configuration .
21,533
private boolean loadCustomErrorPage ( CmsObject cms , HttpServletRequest req , HttpServletResponse res , String rootPath ) { try { CmsSite errorSite = OpenCms . getSiteManager ( ) . getSiteForRootPath ( rootPath ) ; cms . getRequestContext ( ) . setSiteRoot ( errorSite . getSiteRoot ( ) ) ; String relPath = cms . getRe...
Tries to load the custom error page at the given rootPath .
21,534
private boolean tryCustomErrorPage ( CmsObject cms , HttpServletRequest req , HttpServletResponse res , int errorCode ) { String siteRoot = OpenCms . getSiteManager ( ) . matchRequest ( req ) . getSiteRoot ( ) ; CmsSite site = OpenCms . getSiteManager ( ) . getSiteForSiteRoot ( siteRoot ) ; if ( site != null ) { String...
Tries to load a site specific error page . If
21,535
private CmsVfsEntryBean buildVfsEntryBeanForQuickSearch ( CmsResource resource , Multimap < CmsResource , CmsResource > childMap , Set < CmsResource > filterMatches , Set < String > parentPaths , boolean isRoot ) throws CmsException { CmsObject cms = getCmsObject ( ) ; String title = cms . readPropertyObject ( resource...
Recursively builds the VFS entry bean for the quick filtering function in the folder tab . <p<
21,536
protected void doPurge ( Runnable afterPurgeAction ) { if ( LOG . isInfoEnabled ( ) ) { LOG . info ( org . opencms . flex . Messages . get ( ) . getBundle ( ) . key ( org . opencms . flex . Messages . LOG_FLEXCACHE_WILL_PURGE_JSP_REPOSITORY_0 ) ) ; } File d ; d = new File ( getJspRepository ( ) + CmsFlexCache . REPOSIT...
Purges the JSP repository . <p<
21,537
private void wrongUsage ( ) { String usage = "Usage: java -cp $PATH_TO_OPENCMS_JAR org.opencms.rmi.CmsRemoteShellClient\n" + " -script=[path to script] (optional) \n" + " -registryPort=[port of RMI registry] (optional, default is " + CmsRemoteShellConstants . DEFAULT_PORT + ")\n" + " -additional=[additional co...
Displays text which shows the valid command line parameters and then exits .
21,538
public void setAddContentInfo ( final Boolean doAddInfo ) { if ( ( null != doAddInfo ) && doAddInfo . booleanValue ( ) && ( null != m_addContentInfoForEntries ) ) { m_addContentInfoForEntries = Integer . valueOf ( DEFAULT_CONTENTINFO_ROWS ) ; } }
Setter for addContentInfo indicating if content information should be added .
21,539
public void setFileFormat ( String fileFormat ) { if ( fileFormat . toUpperCase ( ) . equals ( FileFormat . JSON . toString ( ) ) ) { m_fileFormat = FileFormat . JSON ; } }
Setter for the file format .
21,540
private void addContentInfo ( ) { if ( ! m_cms . getRequestContext ( ) . getCurrentProject ( ) . isOnlineProject ( ) && ( null == m_searchController . getCommon ( ) . getConfig ( ) . getSolrIndex ( ) ) && ( null != m_addContentInfoForEntries ) ) { CmsSolrQuery query = new CmsSolrQuery ( ) ; m_searchController . addQuer...
Adds the content info for the collected resources used in the This page publish dialog .
21,541
private I_CmsSearchResultWrapper getSearchResults ( ) { m_searchController . updateFromRequestParameters ( pageContext . getRequest ( ) . getParameterMap ( ) , false ) ; I_CmsSearchControllerCommon common = m_searchController . getCommon ( ) ; if ( common . getState ( ) . getQuery ( ) . isEmpty ( ) && ( ! common . getC...
Here the search query is composed and executed . The result is wrapped in an easily usable form . It is exposed to the JSP via the tag s var attribute .
21,542
public Date toDate ( Object date ) { Date d = null ; if ( null != date ) { if ( date instanceof Date ) { d = ( Date ) date ; } else if ( date instanceof Long ) { d = new Date ( ( ( Long ) date ) . longValue ( ) ) ; } else { try { long l = Long . parseLong ( date . toString ( ) ) ; d = new Date ( l ) ; } catch ( Excepti...
Converts the provided object to a date if possible .
21,543
public synchronized void stop ( ) { if ( m_thread != null ) { long timeBeforeShutdownWasCalled = System . currentTimeMillis ( ) ; JLANServer . shutdownServer ( new String [ ] { } ) ; while ( m_thread . isAlive ( ) && ( ( System . currentTimeMillis ( ) - timeBeforeShutdownWasCalled ) < MAX_SHUTDOWN_WAIT_MILLIS ) ) { try...
Tries to stop the JLAN server and return after it is stopped but will also return if the thread hasn t stopped after MAX_SHUTDOWN_WAIT_MILLIS .
21,544
public boolean needToSetCategoryFolder ( ) { if ( m_adeModuleVersion == null ) { return true ; } CmsModuleVersion categoryFolderUpdateVersion = new CmsModuleVersion ( "9.0.0" ) ; return ( m_adeModuleVersion . compareTo ( categoryFolderUpdateVersion ) == - 1 ) ; }
Checks if the categoryfolder setting needs to be updated .
21,545
public void setWeekDays ( SortedSet < WeekDay > weekDays ) { final SortedSet < WeekDay > newWeekDays = null == weekDays ? new TreeSet < WeekDay > ( ) : weekDays ; SortedSet < WeekDay > currentWeekDays = m_model . getWeekDays ( ) ; if ( ! currentWeekDays . equals ( newWeekDays ) ) { conditionallyRemoveExceptionsOnChange...
Set the weekdays at which the event should take place .
21,546
protected void switchTab ( ) { Component tab = m_tab . getSelectedTab ( ) ; int pos = m_tab . getTabPosition ( m_tab . getTab ( tab ) ) ; if ( m_isWebOU ) { if ( pos == 0 ) { pos = 1 ; } } m_tab . setSelectedTab ( pos + 1 ) ; }
Switches to the next tab .
21,547
protected void onEditTitleTextBox ( TextBox box ) { if ( m_titleEditHandler != null ) { m_titleEditHandler . handleEdit ( m_title , box ) ; return ; } String text = box . getText ( ) ; box . removeFromParent ( ) ; m_title . setText ( text ) ; m_title . setVisible ( true ) ; }
Internal method which is called when the user has finished editing the title .
21,548
public void setPatternScheme ( final boolean isByWeekDay , final boolean fireChange ) { if ( isByWeekDay ^ ( null != m_model . getWeekDay ( ) ) ) { removeExceptionsOnChange ( new Command ( ) { public void execute ( ) { if ( isByWeekDay ) { m_model . setWeekOfMonth ( getPatternDefaultValues ( ) . getWeekOfMonth ( ) ) ; ...
Set the pattern scheme to either by weekday or by day of month .
21,549
public void setWeekDay ( String dayString ) { final WeekDay day = WeekDay . valueOf ( dayString ) ; if ( m_model . getWeekDay ( ) != day ) { removeExceptionsOnChange ( new Command ( ) { public void execute ( ) { m_model . setWeekDay ( day ) ; onValueChange ( ) ; } } ) ; } }
Set the week day the event should take place .
21,550
public void weeksChange ( String week , Boolean value ) { final WeekOfMonth changedWeek = WeekOfMonth . valueOf ( week ) ; boolean newValue = ( null != value ) && value . booleanValue ( ) ; boolean currentValue = m_model . getWeeksOfMonth ( ) . contains ( changedWeek ) ; if ( newValue != currentValue ) { if ( newValue ...
Handle a change in the weeks of month .
21,551
public void validateAliases ( final CmsUUID uuid , final Map < String , String > aliasPaths , final AsyncCallback < Map < String , String > > callback ) { CmsRpcAction < Map < String , String > > action = new CmsRpcAction < Map < String , String > > ( ) { public void execute ( ) { start ( 200 , true ) ; CmsCoreProvider...
Validates aliases .
21,552
void setDayOfMonth ( String day ) { final int i = CmsSerialDateUtil . toIntWithDefault ( day , - 1 ) ; if ( m_model . getDayOfMonth ( ) != i ) { removeExceptionsOnChange ( new Command ( ) { public void execute ( ) { m_model . setDayOfMonth ( i ) ; onValueChange ( ) ; } } ) ; } }
Sets the day of the month .
21,553
private String convertOutputToHtml ( String content ) { if ( content . length ( ) == 0 ) { return "" ; } StringBuilder buffer = new StringBuilder ( ) ; for ( String line : content . split ( "\n" ) ) { buffer . append ( CmsEncoder . escapeXml ( line ) + "<br>" ) ; } return buffer . toString ( ) ; }
Converts the text stream data to HTML form .
21,554
private void writeToDelegate ( byte [ ] data ) { if ( m_delegateStream != null ) { try { m_delegateStream . write ( data ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } }
Writes data to delegate stream if it has been set .
21,555
public static String getStatusForItem ( Long lastActivity ) { if ( lastActivity . longValue ( ) < CmsSessionsTable . INACTIVE_LIMIT ) { return CmsVaadinUtils . getMessageText ( Messages . GUI_MESSAGES_BROADCAST_COLS_STATUS_ACTIVE_0 ) ; } return CmsVaadinUtils . getMessageText ( Messages . GUI_MESSAGES_BROADCAST_COLS_ST...
Gets the status text from given session .
21,556
public static void showUserInfo ( CmsSessionInfo session ) { final Window window = CmsBasicDialog . prepareWindow ( DialogWidth . wide ) ; CmsUserInfoDialog dialog = new CmsUserInfoDialog ( session , new Runnable ( ) { public void run ( ) { window . close ( ) ; } } ) ; window . setCaption ( CmsVaadinUtils . getMessageT...
Shows a dialog with user information for given session .
21,557
public void onBrowserEvent ( Event event ) { super . onBrowserEvent ( event ) ; switch ( DOM . eventGetType ( event ) ) { case Event . ONMOUSEUP : Event . releaseCapture ( m_slider . getElement ( ) ) ; m_capturedMouse = false ; break ; case Event . ONMOUSEDOWN : Event . setCapture ( m_slider . getElement ( ) ) ; m_capt...
Fired whenever a browser event is received .
21,558
private void addChildrenForGroupsNode ( I_CmsOuTreeType type , String ouItem ) { try { List < CmsGroup > groups = m_app . readGroupsForOu ( m_cms , ouItem . substring ( 1 ) , type , false ) ; for ( CmsGroup group : groups ) { Pair < String , CmsUUID > key = Pair . of ( type . getId ( ) , group . getId ( ) ) ; Item grou...
Add groups for given group parent item .
21,559
private void addChildrenForRolesNode ( String ouItem ) { try { List < CmsRole > roles = OpenCms . getRoleManager ( ) . getRoles ( m_cms , ouItem . substring ( 1 ) , false ) ; CmsRole . applySystemRoleOrder ( roles ) ; for ( CmsRole role : roles ) { String roleId = ouItem + "/" + role . getId ( ) ; Item roleItem = m_tre...
Add roles for given role parent item .
21,560
public static boolean checkConfiguredInModules ( ) { Boolean result = m_moduleCheckCache . get ( ) ; if ( result == null ) { result = Boolean . valueOf ( getConfiguredTemplateMapping ( ) != null ) ; m_moduleCheckCache . set ( result ) ; } return result . booleanValue ( ) ; }
Checks if template mapper is configured in modules .
21,561
@ SuppressWarnings ( "unused" ) public static void addTo ( AbstractSingleComponentContainer componentContainer , int scrollBarrier , int barrierMargin , String styleName ) { new CmsScrollPositionCss ( componentContainer , scrollBarrier , barrierMargin , styleName ) ; }
Adds the scroll position CSS extension to the given component
21,562
protected boolean checkvalue ( String colorvalue ) { boolean valid = validateColorValue ( colorvalue ) ; if ( valid ) { if ( colorvalue . length ( ) == 4 ) { char [ ] chr = colorvalue . toCharArray ( ) ; for ( int i = 1 ; i < 4 ; i ++ ) { String foo = String . valueOf ( chr [ i ] ) ; colorvalue = colorvalue . replaceFi...
Validates the inputed color value .
21,563
protected AllowableActions collectAllowableActions ( CmsObject cms , CmsResource file ) { try { if ( file == null ) { throw new IllegalArgumentException ( "File must not be null!" ) ; } CmsLock lock = cms . getLock ( file ) ; CmsUser user = cms . getRequestContext ( ) . getCurrentUser ( ) ; boolean canWrite = ! cms . g...
Compiles the allowable actions for a file or folder .
21,564
public static String getStatusText ( int nHttpStatusCode ) { Integer intKey = new Integer ( nHttpStatusCode ) ; if ( ! mapStatusCodes . containsKey ( intKey ) ) { return "" ; } else { return mapStatusCodes . get ( intKey ) ; } }
Returns the HTTP status text for the HTTP or WebDav status code specified by looking it up in the static mapping . This is a static function .
21,565
private boolean addType ( TypeDefinition type ) { if ( type == null ) { return false ; } if ( type . getBaseTypeId ( ) == null ) { return false ; } TypeDefinition baseType = null ; if ( type . getBaseTypeId ( ) == BaseTypeId . CMIS_DOCUMENT ) { baseType = copyTypeDefintion ( m_types . get ( DOCUMENT_TYPE_ID ) . getType...
Adds a type to collection with inheriting base type properties .
21,566
public String buildRadio ( String propName ) throws CmsException { String propVal = readProperty ( propName ) ; StringBuffer result = new StringBuffer ( "<table border=\"0\"><tr>" ) ; result . append ( "<td><input type=\"radio\" value=\"true\" onClick=\"checkNoIntern()\" name=\"" ) . append ( propName ) . append ( "\" ...
Builds the radio input to set the export and secure property .
21,567
public void setCategoryDisplayOptions ( String displayCategoriesByRepository , String displayCategorySelectionCollapsed ) { m_displayCategoriesByRepository = Boolean . parseBoolean ( displayCategoriesByRepository ) ; m_displayCategorySelectionCollapsed = Boolean . parseBoolean ( displayCategorySelectionCollapsed ) ; }
Sets the category display options that affect how the category selection dialog is shown .
21,568
protected boolean showMoreEntries ( Calendar nextDate , int previousOccurrences ) { switch ( getSerialEndType ( ) ) { case DATE : boolean moreByDate = nextDate . getTimeInMillis ( ) < m_endMillis ; boolean moreByOccurrences = previousOccurrences < CmsSerialDateUtil . getMaxEvents ( ) ; if ( moreByDate && ! moreByOccurr...
Check if the provided date or any date after it are part of the series .
21,569
private SortedSet < Date > calculateDates ( ) { if ( null == m_allDates ) { SortedSet < Date > result = new TreeSet < > ( ) ; if ( isAnyDatePossible ( ) ) { Calendar date = getFirstDate ( ) ; int previousOccurrences = 0 ; while ( showMoreEntries ( date , previousOccurrences ) ) { result . add ( date . getTime ( ) ) ; t...
Calculates all dates of the series .
21,570
private SortedSet < Date > filterExceptions ( SortedSet < Date > dates ) { SortedSet < Date > result = new TreeSet < Date > ( ) ; for ( Date d : dates ) { if ( ! m_exceptions . contains ( d ) ) { result . add ( d ) ; } } return result ; }
Filters all exceptions from the provided dates .
21,571
private void setHeaderList ( Map < String , List < String > > headers , String name , String value ) { List < String > values = new ArrayList < String > ( ) ; values . add ( SET_HEADER + value ) ; headers . put ( name , values ) ; }
Helper method to set a value in the internal header list .
21,572
public static String changeFileNameSuffixTo ( String filename , String suffix ) { int dotPos = filename . lastIndexOf ( '.' ) ; if ( dotPos != - 1 ) { return filename . substring ( 0 , dotPos + 1 ) + suffix ; } else { return filename ; } }
Changes the given filenames suffix from the current suffix to the provided suffix .
21,573
public static final long parseDuration ( String durationStr , long defaultValue ) { durationStr = durationStr . toLowerCase ( ) . trim ( ) ; Matcher matcher = DURATION_NUMBER_AND_UNIT_PATTERN . matcher ( durationStr ) ; long millis = 0 ; boolean matched = false ; while ( matcher . find ( ) ) { long number = Long . valu...
Parses a duration and returns the corresponding number of milliseconds .
21,574
public static StringTemplateGroup readStringTemplateGroup ( InputStream stream ) { try { return new StringTemplateGroup ( new InputStreamReader ( stream , "UTF-8" ) , DefaultTemplateLexer . class , new StringTemplateErrorListener ( ) { @ SuppressWarnings ( "synthetic-access" ) public void error ( String arg0 , Throwabl...
Reads a stringtemplate group from a stream .
21,575
public static void fire ( I_CmsHasDateBoxEventHandlers source , Date date , boolean isTyping ) { if ( TYPE != null ) { CmsDateBoxEvent event = new CmsDateBoxEvent ( date , isTyping ) ; source . fireEvent ( event ) ; } }
Fires the event .
21,576
protected CmsProject createAndSetModuleImportProject ( CmsObject cms , CmsModule module ) throws CmsException { CmsProject importProject = cms . createProject ( org . opencms . module . Messages . get ( ) . getBundle ( cms . getRequestContext ( ) . getLocale ( ) ) . key ( org . opencms . module . Messages . GUI_IMPORT_...
Creates the project used to import module resources and sets it on the CmsObject .
21,577
protected void deleteConflictingResources ( CmsObject cms , CmsModule module , Map < CmsUUID , CmsUUID > conflictingIds ) throws CmsException , Exception { CmsProject conflictProject = cms . createProject ( "Deletion of conflicting resources for " + module . getName ( ) , "Deletion of conflicting resources for " + modu...
Deletes and publishes resources with ID conflicts .
21,578
protected void parseLinks ( CmsObject cms ) throws CmsException { List < CmsResource > linkParseables = new ArrayList < > ( ) ; for ( CmsResourceImportData resData : m_moduleData . getResourceData ( ) ) { CmsResource importRes = resData . getImportResource ( ) ; if ( ( importRes != null ) && m_importIds . contains ( im...
Parses links for XMLContents etc .
21,579
protected void processDeletions ( CmsObject cms , List < CmsResource > toDelete ) throws CmsException { Collections . sort ( toDelete , ( a , b ) -> b . getRootPath ( ) . compareTo ( a . getRootPath ( ) ) ) ; for ( CmsResource deleteRes : toDelete ) { m_report . print ( org . opencms . importexport . Messages . get ( )...
Handles the file deletions .
21,580
protected void runImportScript ( CmsObject cms , CmsModule module ) { LOG . info ( "Executing import script for module " + module . getName ( ) ) ; m_report . println ( org . opencms . module . Messages . get ( ) . container ( org . opencms . module . Messages . RPT_IMPORT_SCRIPT_HEADER_0 ) , I_CmsReport . FORMAT_HEADL...
Runs the module import script .
21,581
public Map < String , List < Locale > > getAvailableLocales ( ) { if ( m_availableLocales == null ) { m_availableLocales = CmsCollectionsGenericWrapper . createLazyMap ( new CmsAvailableLocaleLoaderTransformer ( ) ) ; } return m_availableLocales ; }
Returns a lazily generated map from site paths of resources to the available locales for the resource .
21,582
private static CmsObject adjustSiteRootIfNecessary ( final CmsObject cms , final CmsModule module ) throws CmsException { CmsObject cmsClone ; if ( ( null == module . getSite ( ) ) || cms . getRequestContext ( ) . getSiteRoot ( ) . equals ( module . getSite ( ) ) ) { cmsClone = cms ; } else { cmsClone = OpenCms . initC...
Adjusts the site root and returns a cloned CmsObject iff the module has set an import site that differs from the site root of the CmsObject provided as argument . Otherwise returns the provided CmsObject unchanged .
21,583
public boolean shouldIncrementVersionBasedOnResources ( CmsObject cms ) throws CmsException { if ( m_checkpointTime == 0 ) { return true ; } CmsObject cmsClone = adjustSiteRootIfNecessary ( cms , this ) ; List < CmsResource > moduleResources = calculateModuleResources ( cmsClone , this ) ; for ( CmsResource resource : ...
Determines if the version should be incremented based on the module resources modification dates .
21,584
public Class < ? > getColumnType ( int c ) { for ( int r = 0 ; r < m_data . size ( ) ; r ++ ) { Object val = m_data . get ( r ) . get ( c ) ; if ( val != null ) { return val . getClass ( ) ; } } return Object . class ; }
Gets the type to use for the Vaadin table column corresponding to the c - th column in this result .
21,585
public String getCsv ( ) { StringWriter writer = new StringWriter ( ) ; try ( CSVWriter csv = new CSVWriter ( writer ) ) { List < String > headers = new ArrayList < > ( ) ; for ( String col : m_columns ) { headers . add ( col ) ; } csv . writeNext ( headers . toArray ( new String [ ] { } ) ) ; for ( List < Object > row...
Converts the results to CSV data .
21,586
protected String getBasePath ( String rootPath ) { if ( rootPath . endsWith ( INHERITANCE_CONFIG_FILE_NAME ) ) { return rootPath . substring ( 0 , rootPath . length ( ) - INHERITANCE_CONFIG_FILE_NAME . length ( ) ) ; } return rootPath ; }
Returns the base path for a given configuration file .
21,587
public static String getStringOption ( Map < String , String > configOptions , String optionKey , String defaultValue ) { String result = configOptions . get ( optionKey ) ; return null != result ? result : defaultValue ; }
Returns the value of an option or the default if the value is null or the key is not part of the map .
21,588
private String generateValue ( ) { String result = "" ; for ( CmsCheckBox checkbox : m_checkboxes ) { if ( checkbox . isChecked ( ) ) { result += checkbox . getInternalValue ( ) + "," ; } } if ( result . contains ( "," ) ) { result = result . substring ( 0 , result . lastIndexOf ( "," ) ) ; } return result ; }
Generate a string with all selected checkboxes separated with .
21,589
protected void runQuery ( ) { String pool = m_pool . getValue ( ) ; String stmt = m_script . getValue ( ) ; if ( stmt . trim ( ) . isEmpty ( ) ) { return ; } CmsStringBufferReport report = new CmsStringBufferReport ( Locale . ENGLISH ) ; List < Throwable > errors = new ArrayList < > ( ) ; CmsSqlConsoleResults result = ...
Runs the currently entered query and displays the results .
21,590
public static Resource getSetupPage ( I_SetupUiContext context , String name ) { String path = CmsStringUtil . joinPaths ( context . getSetupBean ( ) . getContextPath ( ) , CmsSetupBean . FOLDER_SETUP , name ) ; Resource resource = new ExternalResource ( path ) ; return resource ; }
Gets external resource for an HTML page in the setup - resources folder .
21,591
protected void showStep ( A_CmsSetupStep step ) { Window window = newWindow ( ) ; window . setContent ( step ) ; window . setCaption ( step . getTitle ( ) ) ; A_CmsUI . get ( ) . addWindow ( window ) ; window . center ( ) ; }
Shows the given step .
21,592
protected void updateStep ( int stepNo ) { if ( ( 0 <= stepNo ) && ( stepNo < m_steps . size ( ) ) ) { Class < ? extends A_CmsSetupStep > cls = m_steps . get ( stepNo ) ; A_CmsSetupStep step ; try { step = cls . getConstructor ( I_SetupUiContext . class ) . newInstance ( this ) ; showStep ( step ) ; m_stepNo = stepNo ;...
Moves to the step with the given number .
21,593
protected void appendFacetOption ( StringBuffer query , final String name , final String value ) { query . append ( " facet." ) . append ( name ) . append ( "=" ) . append ( value ) ; }
Appends the query part for the facet to the query string .
21,594
public void setEditedFilePath ( final String editedFilePath ) { m_filePathField . setReadOnly ( false ) ; m_filePathField . setValue ( editedFilePath ) ; m_filePathField . setReadOnly ( true ) ; }
Sets the path of the edited file in the corresponding display .
21,595
public void updateShownOptions ( boolean showModeSwitch , boolean showAddKeyOption ) { if ( showModeSwitch != m_showModeSwitch ) { m_upperLeftComponent . removeAllComponents ( ) ; m_upperLeftComponent . addComponent ( m_languageSwitch ) ; if ( showModeSwitch ) { m_upperLeftComponent . addComponent ( m_modeSwitch ) ; } ...
Update which options are shown .
21,596
void handleAddKey ( ) { String key = m_addKeyInput . getValue ( ) ; if ( m_listener . handleAddKey ( key ) ) { Notification . show ( key . isEmpty ( ) ? m_messages . key ( Messages . GUI_NOTIFICATION_MESSAGEBUNDLEEDITOR_EMPTY_KEY_SUCCESSFULLY_ADDED_0 ) : m_messages . key ( Messages . GUI_NOTIFICATION_MESSAGEBUNDLEEDITO...
Handles adding a key . Calls the registered listener and wraps it s method in some GUI adjustments .
21,597
void setLanguage ( final Locale locale ) { if ( ! m_languageSelect . getValue ( ) . equals ( locale ) ) { m_languageSelect . setValue ( locale ) ; } }
Sets the currently edited locale .
21,598
private Component createAddKeyButton ( ) { Button addKeyButton = new Button ( ) ; addKeyButton . addStyleName ( "icon-only" ) ; addKeyButton . addStyleName ( "borderless-colored" ) ; addKeyButton . setDescription ( m_messages . key ( Messages . GUI_ADD_KEY_0 ) ) ; addKeyButton . setIcon ( FontOpenCms . CIRCLE_PLUS , m_...
Creates the Add key button .
21,599
private void initModeSwitch ( final EditMode current ) { FormLayout modes = new FormLayout ( ) ; modes . setHeight ( "100%" ) ; modes . setDefaultComponentAlignment ( Alignment . MIDDLE_LEFT ) ; m_modeSelect = new ComboBox ( ) ; m_modeSelect . setCaption ( m_messages . key ( Messages . GUI_VIEW_SWITCHER_LABEL_0 ) ) ; m...
Initializes the mode switcher .