service/src/main/groovy/org/olf/templating/LabelTemplateHelpers.groovy (Line 29:2 - Line 34:11), service/src/main/groovy/org/olf/templating/LabelTemplateHelpers.groovy (Line 14:2 - Line 21:13)
(final Object context, final Object param1, final Object param2, final Options options) {
return Optional.ofNullable(Objects.toString(param1, ""))
.map({ final String param -> "(?=(?<=${regexSafe(param)}))" as String })
.map({ final String regex ->
final op = { String subject ->
return subject.replaceAll
service/src/main/groovy/org/olf/templating/LabelTemplateHelpers.groovy (Line 44:2 - Line 55:16), service/src/main/groovy/org/olf/templating/LabelTemplateHelpers.groovy (Line 18:2 - Line 29:15)
as String })
.map({ final String regex ->
final op = { String subject ->
return subject.replaceFirst(regex, Objects.toString(param2, ""))
}
return doOperation(context, op, options)
})
.orElse(null)
}
public static final CharSequence insertBeforeAll
service/src/main/groovy/org/olf/templating/LabelTemplateHelpers.groovy (Line 55:2 - Line 60:11), service/src/main/groovy/org/olf/templating/LabelTemplateHelpers.groovy (Line 42:2 - Line 47:13)
(final Object context, final Object param1, final Object param2, final Options options) {
return Optional.ofNullable(Objects.toString(param1, ""))
.map({ final String param -> "(?<=(?=${regexSafe(param)}))" as String })
.map({ final String regex ->
final op = { String subject ->
return subject.replaceAll
service/src/main/groovy/org/olf/templating/LabelTemplateHelpers.groovy (Line 57:2 - Line 68:15), service/src/main/groovy/org/olf/templating/LabelTemplateHelpers.groovy (Line 31:2 - Line 42:13)
as String })
.map({ final String regex ->
final op = { String subject ->
return subject.replaceAll(regex, Objects.toString(param2, ""))
}
return doOperation(context, op, options)
})
.orElse(null)
}
public static final CharSequence removeProtocol
service/src/main/groovy/org/olf/omission/OmissionRuleHelpers.groovy (Line 33:2 - Line 46:85), service/src/main/groovy/org/olf/recurrence/RecurrenceRuleHelpers.groovy (Line 33:2 - Line 46:91)
obj, SimpleMapDataBindingSource source) {
String patternTypeString = null
if ( source['patternType'] && RefdataValue.class.isAssignableFrom(source['patternType'].class)) {
patternTypeString = (source['patternType'] as RefdataValue).value;
} else {
patternTypeString = source['patternType']?.toString();
}
// Do the string replacement.
final String patternClassString = RGX_PATTERN_CLASS.matcher(patternTypeString)
.replaceAll{ match -> match.group(1).toUpperCase() }
final String patternClasspathString = "org.olf.omission.omissionPattern.OmissionPattern${patternClassString.capitalize()}"
service/src/main/groovy/org/olf/omission/OmissionRuleHelpers.groovy (Line 48:16 - Line 58:51), service/src/main/groovy/org/olf/recurrence/RecurrenceRuleHelpers.groovy (Line 48:18 - Line 58:53)
> rc = Class.forName(patternClasspathString)
final String currentId = source['pattern']?.getAt("id")?.toString()
def rpApi = GormUtils.gormStaticApi(rc)
T rp = currentId ? rpApi.get(currentId) : rpApi.create()
dataBinder.bind( rp, new SimpleMapDataBindingSource(source['pattern'] as Map) )
log.debug ('Binding Omission Pattern of type {} to Object {}'
service/src/main/groovy/org/olf/omission/OmissionRuleHelpers.groovy (Line 68:2 - Line 79:2), service/src/main/groovy/org/olf/recurrence/RecurrenceRuleHelpers.groovy (Line 68:2 - Line 79:2)
instance, Errors err ) {
GormValidateable rpVal = value as GormValidateable
if (!rpVal.validate(deepValidate: false)) { // Make sure this validation isn't fired again.
Errors paternErrors = rpVal.getErrors()
for( def error : paternErrors.allErrors) {
err.rejectValue('pattern', error.code, error.arguments, error.defaultMessage)
}
}
}
}
service/src/main/groovy/org/olf/combination/CombinationRuleHelpers.groovy (Line 34:2 - Line 47:94), service/src/main/groovy/org/olf/recurrence/RecurrenceRuleHelpers.groovy (Line 33:2 - Line 46:91)
obj, SimpleMapDataBindingSource source) {
String patternTypeString = null
if ( source['patternType'] && RefdataValue.class.isAssignableFrom(source['patternType'].class)) {
patternTypeString = (source['patternType'] as RefdataValue).value;
} else {
patternTypeString = source['patternType']?.toString();
}
// Do the string replacement.
final String patternClassString = RGX_PATTERN_CLASS.matcher(patternTypeString)
.replaceAll{ match -> match.group(1).toUpperCase() }
final String patternClasspathString = "org.olf.combination.combinationPattern.CombinationPattern${patternClassString.capitalize()}"
service/src/main/groovy/org/olf/combination/CombinationRuleHelpers.groovy (Line 49:19 - Line 59:54), service/src/main/groovy/org/olf/recurrence/RecurrenceRuleHelpers.groovy (Line 48:18 - Line 58:53)
> rc = Class.forName(patternClasspathString)
final String currentId = source['pattern']?.getAt("id")?.toString()
def rpApi = GormUtils.gormStaticApi(rc)
T rp = currentId ? rpApi.get(currentId) : rpApi.create()
dataBinder.bind( rp, new SimpleMapDataBindingSource(source['pattern'] as Map) )
log.debug ('Binding Combination Pattern of type {} to Object {}'
service/src/main/groovy/org/olf/combination/CombinationRuleHelpers.groovy (Line 69:2 - Line 80:2), service/src/main/groovy/org/olf/recurrence/RecurrenceRuleHelpers.groovy (Line 68:2 - Line 79:2)
instance, Errors err ) {
GormValidateable rpVal = value as GormValidateable
if (!rpVal.validate(deepValidate: false)) { // Make sure this validation isn't fired again.
Errors paternErrors = rpVal.getErrors()
for( def error : paternErrors.allErrors) {
err.rejectValue('pattern', error.code, error.arguments, error.defaultMessage)
}
}
}
}
service/grails-app/domain/org/olf/templateConfig/templateMetadataRuleFormat/ChronologyDateTMRF.groovy (Line 49:20 - Line 61:7), service/grails-app/domain/org/olf/templateConfig/templateMetadataRuleFormat/EnumerationNumericTMRF.groovy (Line 30:17 - Line 42:7)
(final int n) {
if (n >= 11 && n <= 13) {
return "th";
}
switch (n % 10) {
case 1: return "st";
case 2: return "nd";
case 3: return "rd";
default: return "th";
}
}
static
service/grails-app/domain/org/olf/templateConfig/templateMetadataRule/ChronologyTemplateMetadataRule.groovy (Line 44:2 - Line 50:2), service/grails-app/domain/org/olf/templateConfig/templateMetadataRule/EnumerationTemplateMetadataRule.groovy (Line 42:2 - Line 48:2)
scripts/secure_enable.sh (Line 1:1 - Line 50:11), scripts/secure_register.sh (Line 1:1 - Line 50:5)
## This script logs into OKAPI and then registers and enables the module
BASEDIR=$(dirname "$0")
MODULE_PORT=8076
# This script generates the module descriptor for mod-rs and posts it to a secured OKAPI control interface
# the script is controlled by a ~/.okapirc file where you need to specify the supertenant username (ST_UN)
# supertnent password (ST_PW) and the OKAPI_URL (For the rancher-desktop install, likely http://localhost:30100)
if [ -f .okapirc ]; then
. .okapirc
elif [ -f $HOME/.okapirc ]; then
. $HOME/.okapirc
else
echo You must configure \$HOME/.okapirc
echo export IS_SECURE_SUPERTENANT=Y
echo export ST_UN=sysadm
echo export ST_PW=PASSWORD_FROM_LOCAL_okapi_commander_cfg.json
echo export OKAPI_URL=http://localhost:30100
exit 0
fi
echo $BASEDIR
pushd "$BASEDIR/../service"
DIR="$BASEDIR/../"
echo "Using directory: $DIR"
# Check for decriptor target directory.
DESCRIPTORDIR="../service/build/resources/main/okapi"
if [ ! -d "$DESCRIPTORDIR" ]; then
echo "No descriptors found. Let's try building them."
./gradlew generateDescriptors
fi
# DEP_DESC=`cat ${DESCRIPTORDIR}/DeploymentDescriptor.json | jq -c ".url=\"$2\""`
DEP_DESC=`cat ${DESCRIPTORDIR}/DeploymentDescriptor.json | jq -c ".url=\"http://192.168.5.2:$MODULE_PORT/\""`
SVC_ID=`echo $DEP_DESC | jq -rc '.srvcId'`
INS_ID=`echo $DEP_DESC | jq -rc '.instId'`
AUTH_TOKEN=`../scripts/okapi-login -u $ST_UN -p $ST_PW -t supertenant`
echo "AUTH_TOKEN: $AUTH_TOKEN"
echo "SUPERTENANT UN: $ST_UN, PASSWORD: $ST_PW"
ENABLE_DOC
scripts/register_and_enable.sh (Line 14:27 - Line 29:5), scripts/register_and_enable_dev.sh (Line 14:30 - Line 29:5)