Files
ofbiz-framework/framework/webtools/groovyScripts/service/Services.groovy
T
Jacques Le Roux b94b6aecaf Fixed: Webtools Service Logs ‘Service Name’ column always empty (OFBIZ-12625)
rs.getModelService().getName() should be used
instead of
rs.getModelService().name

The rest of changes is only non functional formatting and such

Thanks: Emad Radwan for reporting
2022-05-26 11:27:55 +02:00

46 lines
1.7 KiB
Groovy

/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import org.apache.ofbiz.base.util.UtilMisc
import org.apache.ofbiz.base.util.UtilProperties
import org.apache.ofbiz.service.ServiceDispatcher
import org.apache.ofbiz.service.engine.GenericEngine
uiLabelMap = UtilProperties.getResourceBundleMap("WebtoolsUiLabels", locale)
uiLabelMap.addBottomResourceBundle("CommonUiLabels")
log = ServiceDispatcher.getServiceLogMap()
serviceList = []
log.each { rs, value ->
service = [:]
service.serviceName = rs.getModelService().getName()
service.localName = rs.getLocalName()
service.startTime = rs.getStartStamp()
service.endTime = rs.getEndStamp()
service.modeStr = rs.getMode() == GenericEngine.SYNC_MODE ? uiLabelMap.WebtoolsSync : uiLabelMap.WebtoolsAsync
serviceList.add(service)
}
sortField = parameters.sortField
if (sortField) {
context.services = UtilMisc.sortMaps(serviceList, UtilMisc.toList(sortField))
} else {
context.services = serviceList
}