Skip to content

Commit

Permalink
Merge pull request #2167 from openturing/0.3.9
Browse files Browse the repository at this point in the history
0.3.9
  • Loading branch information
alegauss authored Oct 10, 2024
2 parents f1e822c + a3aff81 commit 613d6b5
Show file tree
Hide file tree
Showing 79 changed files with 1,373 additions and 551 deletions.
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.10.0</version>
<version>3.10.1</version>
<configuration>
<!-- Default configuration for all reports -->
<noqualifier>all</noqualifier>
<doclint>all,-missing</doclint>
</configuration>
<executions>
<execution>
Expand Down
2 changes: 1 addition & 1 deletion turing-aem/aem-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations-jakarta</artifactId>
<version>2.2.24</version>
<version>2.2.25</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion turing-aem/aem-cli-indexer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.viglet.turing.connector.aem.TurAemIndexerTool</mainClass>
<mainClass>com.viglet.turing.connector.aem.cli.TurAemIndexerTool</mainClass>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.viglet.turing.connector.aem;
package com.viglet.turing.connector.aem.cli;

import ch.qos.logback.classic.Level;
import com.beust.jcommander.JCommander;
Expand All @@ -30,24 +30,25 @@
import com.viglet.turing.commons.cache.TurCustomClassCache;
import com.viglet.turing.commons.exception.TurRuntimeException;
import com.viglet.turing.commons.sn.field.TurSNFieldName;
import com.viglet.turing.connector.aem.cli.conf.AemHandlerConfiguration;
import com.viglet.turing.connector.aem.cli.persistence.TurAemIndexing;
import com.viglet.turing.connector.aem.cli.persistence.TurAemIndexingDAO;
import com.viglet.turing.connector.aem.cli.persistence.TurAemSystem;
import com.viglet.turing.connector.aem.cli.persistence.TurAemSystemDAO;
import com.viglet.turing.connector.aem.commons.TurAemAttrProcess;
import com.viglet.turing.connector.aem.commons.TurAemCommonsUtils;
import com.viglet.turing.connector.aem.commons.TurAemObject;
import com.viglet.turing.connector.aem.commons.context.TurAemSourceContext;
import com.viglet.turing.connector.aem.commons.ext.TurAemExtDeltaDate;
import com.viglet.turing.connector.aem.commons.ext.TurAemExtDeltaDateInterface;
import com.viglet.turing.connector.aem.conf.AemHandlerConfiguration;
import com.viglet.turing.connector.aem.persistence.TurAemIndexing;
import com.viglet.turing.connector.aem.persistence.TurAemIndexingDAO;
import com.viglet.turing.connector.aem.persistence.TurAemSystem;
import com.viglet.turing.connector.aem.persistence.TurAemSystemDAO;
import com.viglet.turing.connector.cms.beans.TurCmsTargetAttrValueMap;
import com.viglet.turing.connector.cms.mappers.TurCmsContentDefinitionProcess;
import com.viglet.turing.connector.cms.mappers.TurCmsModel;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -117,7 +118,7 @@ public class TurAemIndexerTool {

public static void main(String... argv) {
jCommander.getConsole().println("Viglet Turing AEM Indexer Tool. " +
TurAemIndexerTool.class.getPackage().getImplementationVersion() );
TurAemIndexerTool.class.getPackage().getImplementationVersion());
TurAemIndexerTool turAEMIndexerTool = new TurAemIndexerTool();
jCommander.addObject(turAEMIndexerTool);
try {
Expand Down Expand Up @@ -282,12 +283,17 @@ public static String ordinal(int i) {

private void getNodeFromJson(String nodePath, JSONObject jsonObject, TurAemSourceContext turAemSourceContext,
long start) {
if (isTypeEqualContentType(jsonObject, turAemSourceContext)) {
turCmsContentDefinitionProcess.findByNameFromModelWithDefinition(turAemSourceContext.getContentType())
.ifPresent(model ->
prepareIndexObject(model, new TurAemObject(nodePath, jsonObject),
turCmsContentDefinitionProcess.getTargetAttrDefinitions(), turAemSourceContext, start));
}
TurAemObject aemObject = new TurAemObject(nodePath, jsonObject);
Optional.of(aemObject).ifPresentOrElse(o -> {
if (isTypeEqualContentType(jsonObject, turAemSourceContext)) {
turCmsContentDefinitionProcess.findByNameFromModelWithDefinition(turAemSourceContext.getContentType())
.ifPresent(model ->
prepareIndexObject(model, new TurAemObject(nodePath, jsonObject),
turCmsContentDefinitionProcess.getTargetAttrDefinitions(), turAemSourceContext, start));
}
}, () -> log.info("AEM object ({}) is null deltaId = {}",
turAemSourceContext.getId(), deltaId));

getChildrenFromJson(nodePath, jsonObject, turAemSourceContext, start);
}

Expand Down Expand Up @@ -405,13 +411,14 @@ private static Date defaultDeltaDate(TurAemObject aemObject, TurAemSourceContext
turAemSourceContext);
}

private boolean ddlNeedBeReIndexed(TurAemObject aemObject, TurAemSourceContext turAemSourceContext, Date deltaDate) {
private boolean ddlNeedBeReIndexed(TurAemObject aemObject, TurAemSourceContext turAemSourceContext,
Date deltaDate) {
return !StringUtils.isEmpty(aemObject.getPath()) &&
turAemIndexingDAO.existsByAemIdAndGroupAndDateNotEqual(aemObject.getPath(),
turAemSourceContext.getId(), deltaDate);
}

private void indexObject(TurAemObject aemObject, TurCmsModel turCmsModel,
private void indexObject(@NotNull TurAemObject aemObject, TurCmsModel turCmsModel,
List<TurSNAttributeSpec> turSNAttributeSpecList,
TurAemSourceContext turAemSourceContext,
Long start) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.viglet.turing.connector.aem.conf;
package com.viglet.turing.connector.aem.cli.conf;

import com.viglet.turing.connector.aem.commons.context.TurAemLocalePathContext;
import com.viglet.turing.connector.cms.config.IHandlerConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.viglet.turing.connector.aem.persistence;
package com.viglet.turing.connector.aem.cli.persistence;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.viglet.turing.connector.aem.persistence;
package com.viglet.turing.connector.aem.cli.persistence;

import com.sun.istack.NotNull;
import com.viglet.turing.commons.exception.TurRuntimeException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.viglet.turing.connector.aem.persistence;
package com.viglet.turing.connector.aem.cli.persistence;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.viglet.turing.connector.aem.persistence;
package com.viglet.turing.connector.aem.cli.persistence;

import lombok.extern.slf4j.Slf4j;

Expand Down
2 changes: 1 addition & 1 deletion turing-aem/aem-cli-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.0</version>
<version>3.5.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
*
* Copyright (C) 2016-2024 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.viglet.turing.connector.aem.sample.beans;

import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
*
* Copyright (C) 2016-2024 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.viglet.turing.connector.aem.sample.ext;

import com.viglet.turing.connector.aem.commons.TurAemObject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
*
* Copyright (C) 2016-2024 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.viglet.turing.connector.aem.sample.ext;

import com.viglet.turing.connector.aem.commons.TurAemCommonsUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
*
* Copyright (C) 2016-2024 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.viglet.turing.connector.aem.commons;

import com.viglet.turing.client.sn.TurMultiValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
*
* Copyright (C) 2016-2024 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.viglet.turing.connector.aem.commons;

import com.fasterxml.jackson.core.JsonProcessingException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
*
* Copyright (C) 2016-2024 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.viglet.turing.connector.aem.commons;

import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
*
* Copyright (C) 2016-2024 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.viglet.turing.connector.aem.commons.bean;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
*
* Copyright (C) 2016-2024 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.viglet.turing.connector.aem.commons.bean;

import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
*
* Copyright (C) 2016-2024 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.viglet.turing.connector.aem.commons.bean;

import com.fasterxml.jackson.core.JsonProcessingException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
*
* Copyright (C) 2016-2024 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package com.viglet.turing.connector.aem.commons.bean;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
Expand Down
Loading

0 comments on commit 613d6b5

Please sign in to comment.