diff --git a/core/src/main/java/com/exadel/etoolbox/linkinspector/core/services/data/UiConfigService.java b/core/src/main/java/com/exadel/etoolbox/linkinspector/core/services/data/UiConfigService.java index 69819ae7..0fbcb103 100644 --- a/core/src/main/java/com/exadel/etoolbox/linkinspector/core/services/data/UiConfigService.java +++ b/core/src/main/java/com/exadel/etoolbox/linkinspector/core/services/data/UiConfigService.java @@ -12,6 +12,6 @@ public interface UiConfigService { String[] getExcludedProperties(); String getLinksType(); boolean isExcludeTags(); - Integer[] getStatusCodes(); - Integer getThreadsPerCore(); + int[] getStatusCodes(); + int getThreadsPerCore(); } diff --git a/core/src/main/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/GridResourcesGeneratorImpl.java b/core/src/main/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/GridResourcesGeneratorImpl.java index ae0fe194..671dde61 100644 --- a/core/src/main/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/GridResourcesGeneratorImpl.java +++ b/core/src/main/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/GridResourcesGeneratorImpl.java @@ -268,7 +268,7 @@ private boolean isExcludedPath(String path) { } private boolean isAllowedErrorCode(int linkStatusCode) { - Integer[] allowedStatusCodes = uiConfigService.getStatusCodes(); + int[] allowedStatusCodes = uiConfigService.getStatusCodes(); if (ArrayUtils.isEmpty(allowedStatusCodes) || (allowedStatusCodes.length == 1 && allowedStatusCodes[0] < 0)) { diff --git a/core/src/main/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/UiConfigServiceImpl.java b/core/src/main/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/UiConfigServiceImpl.java index 2ea221d4..9bdc58a6 100644 --- a/core/src/main/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/UiConfigServiceImpl.java +++ b/core/src/main/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/UiConfigServiceImpl.java @@ -15,7 +15,7 @@ @Component(service = UiConfigService.class) public class UiConfigServiceImpl implements UiConfigService { - private static final String CONFIG_PATH = "/content/etoolbox-link-inspector/data/config"; + private static final String CONFIG_PATH = "/conf/etoolbox-link-inspector/data/config"; private static final String PN_FILTER = "filter"; private static final String PN_EXCLUDED_PATHS = "excludedPaths"; private static final String PN_ACTIVATED_CONTENT = "activatedContent"; @@ -83,12 +83,12 @@ public boolean isExcludeTags() { } @Override - public Integer[] getStatusCodes() { - return getProperty(PN_STATUS_CODES, Integer[].class).orElse(new Integer[]{}); + public int[] getStatusCodes() { + return getProperty(PN_STATUS_CODES, int[].class).orElse(new int[]{}); } @Override - public Integer getThreadsPerCore() { + public int getThreadsPerCore() { return getProperty(PN_THREADS_PER_CORE, Integer.class).orElse(DEFAULT_THREADS_PER_CORE); } diff --git a/core/src/test/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/DataFeedServiceImplTest.java b/core/src/test/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/DataFeedServiceImplTest.java index 4bbefb49..120b53c3 100644 --- a/core/src/test/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/DataFeedServiceImplTest.java +++ b/core/src/test/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/DataFeedServiceImplTest.java @@ -188,7 +188,7 @@ private GridResourcesGeneratorImpl getGridResourcesGenerator() throws NoSuchFiel when(uiConfigService.getExcludedPaths()).thenReturn(new String[0]); when(uiConfigService.getExcludedProperties()).thenReturn(new String[0]); when(uiConfigService.getLinksType()).thenReturn(GenerationStatsProps.REPORT_LINKS_TYPE_ALL); - when(uiConfigService.getStatusCodes()).thenReturn(new Integer[]{HttpStatus.SC_NOT_FOUND}); + when(uiConfigService.getStatusCodes()).thenReturn(new int[]{HttpStatus.SC_NOT_FOUND}); when(uiConfigService.getThreadsPerCore()).thenReturn(60); PrivateAccessor.setField(gridResourcesGenerator, UI_CONFIG_FIELD, uiConfigService); diff --git a/core/src/test/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/GridResourcesGeneratorImplTest.java b/core/src/test/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/GridResourcesGeneratorImplTest.java index 9207df2b..ace67c71 100644 --- a/core/src/test/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/GridResourcesGeneratorImplTest.java +++ b/core/src/test/java/com/exadel/etoolbox/linkinspector/core/services/data/impl/GridResourcesGeneratorImplTest.java @@ -148,7 +148,7 @@ void setup() throws NoSuchFieldException { when(uiConfigService.getExcludedProperties()).thenReturn(new String[]{TEST_EXCLUDED_PROPERTY}); when(uiConfigService.getLinksType()).thenReturn(GenerationStatsProps.REPORT_LINKS_TYPE_ALL); when(uiConfigService.isExcludeTags()).thenReturn(true); - when(uiConfigService.getStatusCodes()).thenReturn(new Integer[]{HttpStatus.SC_NOT_FOUND}); + when(uiConfigService.getStatusCodes()).thenReturn(new int[]{HttpStatus.SC_NOT_FOUND}); when(uiConfigService.getThreadsPerCore()).thenReturn(60); PrivateAccessor.setField(fixture, UI_CONFIG_FIELD, uiConfigService); } @@ -198,7 +198,7 @@ void testAllowedStatusCodes() throws IOException, URISyntaxException { @Test void testAllowedStatusCodes_emptyConfig() throws IOException, URISyntaxException, NoSuchFieldException { - when(uiConfigService.getStatusCodes()).thenReturn(new Integer[]{}); + when(uiConfigService.getStatusCodes()).thenReturn(new int[]{}); context.load().json(TEST_RESOURCES_TREE_PATH, TEST_FOLDER_PATH); when(externalLinkChecker.checkLink(anyString())).thenReturn(HttpStatus.SC_BAD_REQUEST); diff --git a/ui.apps/src/main/content/jcr_root/apps/etoolbox-link-inspector/clientlibs/link-inspector-ui/.content.xml b/ui.apps/src/main/content/jcr_root/apps/etoolbox-link-inspector/clientlibs/link-inspector-ui/.content.xml index 1de7ac89..aefc2485 100644 --- a/ui.apps/src/main/content/jcr_root/apps/etoolbox-link-inspector/clientlibs/link-inspector-ui/.content.xml +++ b/ui.apps/src/main/content/jcr_root/apps/etoolbox-link-inspector/clientlibs/link-inspector-ui/.content.xml @@ -16,4 +16,5 @@ xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="cq:ClientLibraryFolder" allowProxy="{Boolean}true" - categories="[link-inspector-ui]"/> \ No newline at end of file + categories="[link-inspector-ui]" + jsProcessor="[min:gcc;languageIn=ECMASCRIPT_2015,compilationLevel=advanced,languageOut=ECMASCRIPT5]"/> \ No newline at end of file diff --git a/ui.apps/src/main/content/jcr_root/apps/etoolbox-link-inspector/clientlibs/link-inspector-ui/js/console-ui.filter.js b/ui.apps/src/main/content/jcr_root/apps/etoolbox-link-inspector/clientlibs/link-inspector-ui/js/console-ui.filter.js index 1092fa90..41b9e89d 100644 --- a/ui.apps/src/main/content/jcr_root/apps/etoolbox-link-inspector/clientlibs/link-inspector-ui/js/console-ui.filter.js +++ b/ui.apps/src/main/content/jcr_root/apps/etoolbox-link-inspector/clientlibs/link-inspector-ui/js/console-ui.filter.js @@ -61,11 +61,11 @@ $updateBtn.appendTo(dialog.footer); const $rootPathField = $(''); - $('

').text("Path(The content path for searching broken links. The search path should be located under /content)").appendTo(dialog.content); + $('

').text("Path (The content path for searching broken links. The search path should be located under /content)").appendTo(dialog.content); $rootPathField.appendTo(dialog.content); const excludedPathsMultifield = createMultifield(); - $('

').text("Excluded Paths(The list of paths excluded from processing. The specified path and all its children are excluded. The excluded path should not end with slash. Can be specified as a regex)").appendTo(dialog.content); + $('

').text("Excluded Paths (The list of paths excluded from processing. The specified path and all its children are excluded. The excluded path should not end with slash. Can be specified as a regex)").appendTo(dialog.content); dialog.content.appendChild(excludedPathsMultifield); const $activatedContentCheckbox = $('Activated Content(If checked, links will be retrieved from activated content only)'); @@ -75,7 +75,7 @@ $skipContentAfterActivationCheckbox.appendTo(dialog.content); const filterMultifield = createMultifield(); - $('

').text("Excluded links patterns(Links are excluded from processing if match any of the specified regex patterns)").appendTo(dialog.content); + $('

').text("Excluded links patterns (Links are excluded from processing if match any of the specified regex patterns)").appendTo(dialog.content); dialog.content.appendChild(filterMultifield); const $lastModifiedContentField = $(''); @@ -83,7 +83,7 @@ $lastModifiedContentField.appendTo(dialog.content); const excludedPropertiesMultifield = createMultifield(); - $('

').text("Excluded Properties(The list of properties excluded from processing. Each value can be specified as a regex)").appendTo(dialog.content); + $('

').text("Excluded Properties (The list of properties excluded from processing. Each value can be specified as a regex)").appendTo(dialog.content); dialog.content.appendChild(excludedPropertiesMultifield); const linksTypeSelect = new Coral.Select().set({ @@ -110,7 +110,7 @@ value: "EXTERNAL", disabled: false }); - $('

').text("Links type(The type of links in the report)").appendTo(dialog.content); + $('

').text("Links type (The type of links in the report)").appendTo(dialog.content); dialog.content.appendChild(linksTypeSelect); const $excludeTagsCheckbox = $('Exclude tags(If checked, the internal links starting with /content/cq:tags will be excluded)'); @@ -126,7 +126,7 @@ $.ajax({ type: "GET", - url: "/content/etoolbox-link-inspector/data/config.json" + url: "/conf/etoolbox-link-inspector/data/config.json" }).done(function (data){ populateMultifield(filterMultifield, data.filter); $rootPathField.val(data.path); @@ -173,7 +173,7 @@ function onSubmit(){ $.ajax({ type: "POST", - url: "/content/etoolbox-link-inspector/data/config", + url: "/conf/etoolbox-link-inspector/data/config", data: { 'jcr:primaryType': "nt:unstructured", "filter": getMultifieldValues(filterMultifield), diff --git a/ui.content/src/main/content/META-INF/vault/filter.xml b/ui.content/src/main/content/META-INF/vault/filter.xml index b74dbb17..86ab76ff 100644 --- a/ui.content/src/main/content/META-INF/vault/filter.xml +++ b/ui.content/src/main/content/META-INF/vault/filter.xml @@ -17,5 +17,5 @@ - + \ No newline at end of file diff --git a/ui.content/src/main/content/jcr_root/conf/etoolbox-link-inspector/.content.xml b/ui.content/src/main/content/jcr_root/conf/etoolbox-link-inspector/.content.xml new file mode 100644 index 00000000..6827225c --- /dev/null +++ b/ui.content/src/main/content/jcr_root/conf/etoolbox-link-inspector/.content.xml @@ -0,0 +1,16 @@ + + + \ No newline at end of file diff --git a/ui.content/src/main/content/jcr_root/conf/etoolbox-link-inspector/data/.content.xml b/ui.content/src/main/content/jcr_root/conf/etoolbox-link-inspector/data/.content.xml new file mode 100644 index 00000000..6827225c --- /dev/null +++ b/ui.content/src/main/content/jcr_root/conf/etoolbox-link-inspector/data/.content.xml @@ -0,0 +1,16 @@ + + + \ No newline at end of file diff --git a/ui.content/src/main/content/jcr_root/content/etoolbox-link-inspector/data/config/.content.xml b/ui.content/src/main/content/jcr_root/conf/etoolbox-link-inspector/data/config/.content.xml similarity index 100% rename from ui.content/src/main/content/jcr_root/content/etoolbox-link-inspector/data/config/.content.xml rename to ui.content/src/main/content/jcr_root/conf/etoolbox-link-inspector/data/config/.content.xml diff --git a/ui.content/src/main/content/jcr_root/conf/etoolbox-link-inspector/data/config/_rep_policy.xml b/ui.content/src/main/content/jcr_root/conf/etoolbox-link-inspector/data/config/_rep_policy.xml new file mode 100644 index 00000000..ecb2b363 --- /dev/null +++ b/ui.content/src/main/content/jcr_root/conf/etoolbox-link-inspector/data/config/_rep_policy.xml @@ -0,0 +1,21 @@ + + + + + \ No newline at end of file