Skip to content

Commit 2eccbaa

Browse files
Hardeninig
1 parent 5fccfd6 commit 2eccbaa

File tree

17 files changed

+63
-53
lines changed

17 files changed

+63
-53
lines changed

core/src/main/java/dev/vml/es/acm/core/code/CodeMetadata.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public class CodeMetadata implements Serializable {
2323
Pattern.compile("(?m)^\\s*\\*?\\s*@(\\w+)\\s+(.+?)(?=(?m)^\\s*\\*?\\s*@\\w+|\\*/|$)", Pattern.DOTALL);
2424
private static final Pattern NEWLINE_AFTER_COMMENT = Pattern.compile("^\\s*\\n[\\s\\S]*");
2525
private static final Pattern BLANK_LINE_AFTER_COMMENT = Pattern.compile("^\\s*\\n\\s*\\n[\\s\\S]*");
26-
private static final Pattern IMPORT_OR_PACKAGE_BEFORE = Pattern.compile("[\\s\\S]*(import|package)[\\s\\S]*\\n\\s*\\n\\s*$");
26+
private static final Pattern IMPORT_OR_PACKAGE_BEFORE =
27+
Pattern.compile("[\\s\\S]*(import|package)[\\s\\S]*\\n\\s*\\n\\s*$");
2728
private static final Pattern FIRST_TAG_PATTERN = Pattern.compile("(?m)^\\s*\\*?\\s*@\\w+");
2829
private static final Pattern LEADING_ASTERISK = Pattern.compile("(?m)^\\s*\\*\\s?");
2930
private static final Pattern DOC_MARKERS = Pattern.compile("^/\\*\\*|\\*/$");
@@ -109,14 +110,16 @@ private static Map<String, Object> parseDocComment(String docComment) {
109110

110111
if (firstTagMatcher.find()) {
111112
int firstTagIndex = firstTagMatcher.start();
112-
String description = LEADING_ASTERISK.matcher(content.substring(0, firstTagIndex))
113+
String description = LEADING_ASTERISK
114+
.matcher(content.substring(0, firstTagIndex))
113115
.replaceAll("")
114116
.trim();
115117
if (!description.isEmpty()) {
116118
result.put("description", description);
117119
}
118120
} else {
119-
String description = LEADING_ASTERISK.matcher(content).replaceAll("").trim();
121+
String description =
122+
LEADING_ASTERISK.matcher(content).replaceAll("").trim();
120123
if (!description.isEmpty()) {
121124
result.put("description", description);
122125
}

ui.content.example/src/main/content/jcr_root/conf/acm/settings/script/automatic/example/ACME-100_acl.groovy

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* This script creates content author groups for each tenant-country-language combination.
3+
*
4+
* The groups are named in the format: `{tenant}-{country}-{language}-content-authors`.
5+
* Each group is granted read, write, and replicate permissions on the corresponding content and DAM paths.
6+
*/
7+
18
def scheduleRun() {
29
return schedules.cron("0 10 * ? * * *") // every hour at minute 10
310
}

ui.content.example/src/main/content/jcr_root/conf/acm/settings/script/manual/example/ACM-1_classes_jms.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* - print the list (for debugging purposes),
77
* - save it directly in the repository in expected path.
88
*
9-
* @author <krystian.panek@vml.com>
9+
* @author <john.doe@acme.com>
1010
*/
1111

1212
import dev.vml.es.acm.core.assist.JavaDictionary

ui.content.example/src/main/content/jcr_root/conf/acm/settings/script/manual/example/ACM-1_classes_rtjar.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* - print the list (for debugging purposes),
77
* - save it directly in the repository in expected path.
88
*
9-
* @author <krystian.panek@vml.com>
9+
* @author <john.doe@acme.com>
1010
*/
1111

1212
import dev.vml.es.acm.core.assist.JavaDictionary

ui.content.example/src/main/content/jcr_root/conf/acm/settings/script/manual/example/ACME-200_hello-world.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/**
22
* Prints "Hello World!" to the console.
3+
*
4+
* @author <john.doe@acme.com>
35
*/
46

57
boolean canRun() {

ui.content.example/src/main/content/jcr_root/conf/acm/settings/script/manual/example/ACME-201_inputs.groovy

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
/**
2-
* Prints animal information to the console based on user input.
3-
* This is an example of AEM Content Manager script with inputs.
2+
* Prints animal information to the console based on user input.
43
*
5-
* @author <krystian.panek@vml.com>
4+
* @author <john.doe@acme.com>
65
*/
76
void describeRun() {
87
inputs.string("animalName") { value = "Whiskers";

ui.content.example/src/main/content/jcr_root/conf/acm/settings/script/manual/example/ACME-202_page-thumbnail.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Deletes the existing thumbnails and saves a new one.
44
* File must be a JPEG image.
55
*
6-
* @author <krystian.panek@vml.com>
6+
* @author <john.doe@acme.com>
77
*/
88
void describeRun() {
99
inputs.path("pagePath") { rootPathExclusive = '/' }

ui.content.example/src/main/content/jcr_root/conf/acm/settings/script/manual/example/ACME-203_output-csv.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import java.util.Random
33

44
/**
55
* @description Generates a CSV report of users with random names and birth dates.
6-
* @author <krystian.panek@vml.com>
6+
* @author <john.doe@acme.com>
77
*/
88
void describeRun() {
99
inputs.integerNumber("count") { label = "Users to generate"; min = 1; value = 10000 }

ui.content.example/src/main/content/jcr_root/conf/acm/settings/script/manual/example/ACME-203_output-xls.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import java.util.Random
77

88
/**
99
* @description Generates an XLS report of users with random names and birth dates.
10-
* @author <krystian.panek@vml.com>
10+
* @author <john.doe@acme.com>
1111
*/
1212
void describeRun() {
1313
inputs.integerNumber("count") { label = "Users to generate"; min = 1; value = 100000 }

ui.frontend/src/components/ExecutableMetadata.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { Badge, Content, ContextualHelp, Flex, Heading, LabeledValue, View } from '@adobe/react-spectrum';
1+
import { Badge, Content, ContextualHelp, Flex, Heading, LabeledValue, Text, View } from '@adobe/react-spectrum';
22
import { Field } from '@react-spectrum/label';
33
import DataUnavailable from '@spectrum-icons/workflow/DataUnavailable';
4-
import { Text } from '@adobe/react-spectrum';
54
import React from 'react';
65
import { ExecutableMetadata as ExecutableMetadataType } from '../types/executable';
76
import Markdown from './Markdown';
@@ -26,14 +25,16 @@ const ExecutableMetadata: React.FC<ExecutableMetadataProps> = ({ metadata }) =>
2625
<View marginBottom="size-100">
2726
<Text>Use a JavaDoc or GroovyDoc comment block at the top of your script file:</Text>
2827
</View>
29-
<pre><small>
30-
{`/**
28+
<pre>
29+
<small>
30+
{`/**
3131
* Explain purpose here
3232
*
3333
* @author <john.doe@acme.com>
3434
* @version 1.0
3535
*/`}
36-
</small></pre>
36+
</small>
37+
</pre>
3738
<View marginTop="size-100">
3839
<Text>The comment must be followed by a blank line. Description is extracted from text before any @tags.</Text>
3940
</View>
@@ -46,19 +47,17 @@ const ExecutableMetadata: React.FC<ExecutableMetadataProps> = ({ metadata }) =>
4647
}
4748

4849
return (
49-
<>
50+
<Flex direction="column" gap="size-200">
5051
{Object.entries(metadata).map(([key, value]) => {
5152
const label = key.charAt(0).toUpperCase() + key.slice(1);
5253

5354
if (Array.isArray(value)) {
54-
return value.map((item, index) => (
55-
<LabeledValue key={`${key}-${index}`} label={label} value={<Markdown code={item} />} />
56-
));
55+
return value.map((item, index) => <LabeledValue key={`${key}-${index}`} label={label} value={<Markdown code={item} />} />);
5756
}
5857

5958
return <LabeledValue key={key} label={label} value={<Markdown code={value} />} />;
6059
})}
61-
</>
60+
</Flex>
6261
);
6362
};
6463

0 commit comments

Comments
 (0)