Skip to content

Commit

Permalink
release 2.28.0-SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
yaskoo committed May 9, 2019
1 parent de2f1d3 commit f758993
Show file tree
Hide file tree
Showing 4,694 changed files with 245,206 additions and 192,267 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ The source code is distributed under GPLv3 license (http://www.gnu.org/copyleft/
# Building

## Required tools
1. Java 1.8 JDK and JavaFX
1. Maven 3.x
2. golang 1.9
3. Docker
2. golang 1.12.x
3. Docker 18.09.5
4. nodejs 6.x
5. npm 3.x

Expand All @@ -19,7 +20,7 @@ Install `gulp` and `jspm` globally by running (this requires root or sudo permis
npm install -g gulp jspm
```

Because jspm downloads (a lot) from github.com it is very likely to hit github's rate limit. To avoid this you need to create an API token or log into github. To do so execute `jspm config registries.github` and follow the instructions.
Because jspm downloads (a lot) from github.com it is very likely to hit github's rate limit. To avoid this you need to create an API token or log into github. To do so execute `jspm config registries.github` and follow the instructions.

To build all artefacts and docker images run:
```bash
Expand All @@ -40,4 +41,4 @@ Also for graphdb to work you need to place your license file in `/etc/sep/licens
To deploy the compose file (stack) run:
```bash
NGINX_SERVER_NAME="example.com" docker stack deploy --compose-file ./docker-stack.yml sep
```
```
71 changes: 47 additions & 24 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -eu
set -euo pipefail

script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
log_file="$script_dir/build.log"
Expand Down Expand Up @@ -48,6 +48,7 @@ mvn -Dmaven.repo.local=$mvn_local_repo -q -f $script_dir/sirma-platform/bom/pom.
mvn \
-Duser.timezone=UTC \
-DtrimStackTrace=false \
-DskipTests=true \
-Dmaven.repo.local=$mvn_local_repo -q -f "$script_dir/sirma-platform/pom.xml" -T 1C clean install

echo "Building Conservation Space deployment..."
Expand Down Expand Up @@ -80,64 +81,87 @@ function build_docker_image() {
local tag="$1"
local ctx="$2"

# --quiet \
docker image build \
--rm --no-cache \
--tag $tag \
--quiet \
$ctx
}

version="$(mvn -q -N -f cs-deployment/pom.xml -Dexec.executable=echo -Dexec.args='${project.version}' exec:exec)"

echo "sep/cs version: $version"
build_docker_image "docker-reg.sirmaplatform.com/base:1" "$script_dir/docker/base/1"
build_docker_image "docker-reg.sirmaplatform.com/base:2" "$script_dir/docker/base/2"
build_docker_image "docker-reg.sirmaplatform.com/base:2.0.1" "$script_dir/docker/base/2.0.1"
build_docker_image "docker-reg.sirmaplatform.com/base:3.0.0" "$script_dir/docker/base/3.0.0"

build_docker_image "docker-reg.sirmaplatform.com/nginx:1.12.2-u2" "$script_dir/docker/nginx/1.12.2-u2"
build_docker_image "docker-reg.sirmaplatform.com/nginx:1.12.2-u5" "$script_dir/docker/nginx/1.12.2-u5"

build_docker_image "docker-reg.sirmaplatform.com/postgres:9" "$script_dir/docker/postgres/9"
build_docker_image "docker-reg.sirmaplatform.com/sep-postgres:2.0.0" "$script_dir/docker/sep-postgres/2.0.0"
build_docker_image "docker-reg.sirmaplatform.com/sep-postgres:2.24.0" "$script_dir/docker/sep-postgres/2.24.0"

build_docker_image "docker-reg.sirmaplatform.com/openjdk-jre:8" "$script_dir/docker/openjdk-jre/8"
build_docker_image "docker-reg.sirmaplatform.com/openjdk-jre:8-1" "$script_dir/docker/openjdk-jre/8-1"

build_docker_image "docker-reg.sirmaplatform.com/solr:5.5.3-u1" "$script_dir/docker/solr/5.5.3-u1"
build_docker_image "docker-reg.sirmaplatform.com/sep-solr-audit:2.12.0-u1" "$script_dir/docker/sep-solr-audit/2.12.0-u1"
build_docker_image "docker-reg.sirmaplatform.com/solr:6.5.0-u1" "$script_dir/docker/solr/6.5.0-u1"

build_docker_image "docker-reg.sirmaplatform.com/solr:6.5.0-u1" "$script_dir/docker/solr/6.5.0-u1"
build_docker_image "docker-reg.sirmaplatform.com/sep-solr-core:2.12.0-u1" "$script_dir/docker/sep-solr-core/2.12.0-u1"

build_docker_image "docker-reg.sirmaplatform.com/export:2.22.0-SNAPSHOT" "$script_dir/docker/export"
build_docker_image "docker-reg.sirmaplatform.com/compare-pdf:2.22.0-SNAPSHOT" "$script_dir/docker/compare-pdf"
build_docker_image "docker-reg.sirmaplatform.com/export:$version" "$script_dir/docker/export"
build_docker_image "docker-reg.sirmaplatform.com/compare-pdf:$version" "$script_dir/docker/compare-pdf"

build_docker_image "docker-reg.sirmaplatform.com/openjdk-jre:7-base-1" "$script_dir/docker/openjdk-jre/7-base-1"
build_docker_image "docker-reg.sirmaplatform.com/openjdk-jre:8-1" "$script_dir/docker/openjdk-jre/8-1"
build_docker_image "docker-reg.sirmaplatform.com/openjdk-jdk:7" "$script_dir/docker/openjdk-jdk/7"
build_docker_image "docker-reg.sirmaplatform.com/openjdk-jdk:8-u1" "$script_dir/docker/openjdk-jdk/8-u1"
build_docker_image "docker-reg.sirmaplatform.com/wso2idp:5" "$script_dir/docker/wso2idp/5"
build_docker_image "docker-reg.sirmaplatform.com/sep-wso2is:2.22.0-SNAPSHOT" "$script_dir/docker/sep-wso2is"
build_docker_image "docker-reg.sirmaplatform.com/sep-wso2is:$version" "$script_dir/docker/sep-wso2is"
docker image build \
--rm --no-cache \
--build-arg base_image=docker-reg.sirmaplatform.com/sep-wso2is:$version \
--tag docker-reg.sirmaplatform.com/cs-wso2is:$version \
$script_dir/docker/cs-wso2is

build_docker_image "docker-reg.sirmaplatform.com/keycloak:4.3.0-u1" "$script_dir/docker/keycloak/4.3.0-u1"
build_docker_image "docker-reg.sirmaplatform.com/sep-keycloak:$version" "$script_dir/sirma-platform/keycloak-integration"
docker image build \
--rm --no-cache \
--build-arg base_image=docker-reg.sirmaplatform.com/sep-keycloak:$version \
--tag docker-reg.sirmaplatform.com/cs-keycloak:$version \
$script_dir/docker/cs-keycloak

build_docker_image "docker-reg.sirmaplatform.com/openldap:2.4.44" "$script_dir/docker/openldap/2.4.44"
build_docker_image "docker-reg.sirmaplatform.com/sep-openldap:2.20.0" "$script_dir/docker/sep-openldap/2.20.0"
build_docker_image "docker-reg.sirmaplatform.com/sep-openldap:2.25.0" "$script_dir/docker/sep-openldap/2.25.0"

build_docker_image "docker-reg.sirmaplatform.com/graphdb:8.3.1-u2" "$script_dir/docker/graphdb/8.3.1-u2"
build_docker_image "docker-reg.sirmaplatform.com/graphdb:8.3.1-u5" "$script_dir/docker/graphdb/8.3.1-u5"

build_docker_image "docker-reg.sirmaplatform.com/ocr-service:2.22.0-SNAPSHOT" "$script_dir/docker/ocr"
build_docker_image "docker-reg.sirmaplatform.com/ocr-service:$version" "$script_dir/docker/ocr"

build_docker_image "docker-reg.sirmaplatform.com/libreoffice:5.1" "$script_dir/docker/libreoffice/5.1"
build_docker_image "docker-reg.sirmaplatform.com/content-preview:2.22.0-SNAPSHOT" "$script_dir/docker/content-preview"
build_docker_image "docker-reg.sirmaplatform.com/libreoffice:6.1-u1" "$script_dir/docker/libreoffice/6.1-u1"
build_docker_image "docker-reg.sirmaplatform.com/content-preview:$version" "$script_dir/docker/content-preview"

build_docker_image "docker-reg.sirmaplatform.com/image-processing:1.0.2" "$script_dir/docker/image-processing"

build_docker_image "docker-reg.sirmaplatform.com/iip-image-server:6.0.0" "$script_dir/docker/iip-image-server"
build_docker_image "docker-reg.sirmaplatform.com/iip-server:6.0.0" "$script_dir/docker/iip-image-server"

build_docker_image "docker-reg.sirmaplatform.com/vsftpd:3.0.3" "$script_dir/docker/vsftpd/3.0.3"

build_docker_image "docker-reg.sirmaplatform.com/apache-server:1.1" "$script_dir/docker/apache-server/1.1"

go get github.com/imdario/mergo gopkg.in/yaml.v2
mkdir -p "$script_dir/docker/http-proxy/rootfs/usr/local/bin"
go build -o "$script_dir/docker/http-proxy/rootfs/usr/local/bin/proxytpl" "$script_dir/docker/http-proxy/proxytpl.go"
build_docker_image "docker-reg.sirmaplatform.com/http-proxy:2.22.0-SNAPSHOT" "$script_dir/docker/http-proxy"
(
mkdir -p "$GOPATH/src/git.sirmaplatform.com/stash/seip"
ln -s "$script_dir/docker/http-proxy" "$GOPATH/src/git.sirmaplatform.com/stash/seip/http-proxy"
cd "$GOPATH/src/git.sirmaplatform.com/stash/seip/http-proxy"
dep ensure
mkdir -p "rootfs/usr/local/bin"
go build -o rootfs/usr/local/bin/http-proxy-linux-amd64 cli/main.go
)

build_docker_image "docker-reg.sirmaplatform.com/wildfly:9.0.2-u3" "$script_dir/docker/wildfly/9.0.2-u3"
build_docker_image "docker-reg.sirmaplatform.com/http-proxy:$version" "$script_dir/docker/http-proxy"

build_docker_image "docker-reg.sirmaplatform.com/wildfly:9.0.2-u5" "$script_dir/docker/wildfly/9.0.2-u5"

echo "Building base wildfly docker image..."
docker image build \
Expand All @@ -154,15 +178,14 @@ docker image build \
$script_dir/cs-deployment

echo "Building Alfresco docker image..."
build_docker_image "docker-reg.sirmaplatform.com/alfresco:4.2.c-u3" "$script_dir/docker/alfresco/4.2.c-u3"
docker image build \
--rm --no-cache --quiet \
--rm --no-cache \
--tag docker-reg.sirmaplatform.com/sep-alfresco:$version \
$script_dir/sirma-platform/alfresco

build_docker_image "docker-reg.sirmaplatform.com/nginx:2" "$script_dir/docker/nginx/2"

echo "Building UI docker image..."
docker image build \
--rm --no-cache --quiet \
--tag docker-reg.sirmaplatform.com/seip-ui:$version \
--tag docker-reg.sirmaplatform.com/sep-ui:$version \
$script_dir/sirma-platform/ui2
2 changes: 1 addition & 1 deletion cs-deployment/cs-eai/eai-cs-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sirma.itt.cs</groupId>
<artifactId>cs-eai</artifactId>
<version>2.22.0-SNAPSHOT</version>
<version>2.28.0-SNAPSHOT</version>
</parent>
<artifactId>eai-cs-api</artifactId>
<name>CS base EIA implementations</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ public class EAIServicesConstants {

/** uri for external id. */
public static final String URI_EXTERNAL_ID = "emf:externalID";
/** uri for external type. */
public static final String URI_EXTERNAL_TYPE = "chc:externalType";
/** uri for external system id. */
public static final String URI_SUB_SYSTEM_ID = "chc:sourceSystemId";

public static final String PROPERTY_EXTERNAL_TYPE = "externalType";
/** property for flag for integration. */
public static final String PROPERTY_INTEGRATED_FLAG_ID = "integrated";
/** property for flag for the integraion system id - TMS. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,9 @@ public <T extends ExternalInstanceIdentifier> T extractExternalInstanceIdentifie
if (externalSystemId == null || !getName().equalsIgnoreCase(String.valueOf(externalSystemId))) {
return null;
}
DefinitionModel instanceDefinition = definitionService.getInstanceDefinition(source);
String externalType = source.getString(EAIServicesConstants.URI_EXTERNAL_TYPE,
() -> source.getString(EAIServicesConstants.PROPERTY_EXTERNAL_TYPE, source.getIdentifier()));
DefinitionModel instanceDefinition = definitionService.find(externalType);
// cache by uri the properties
Optional<PropertyDefinition> externalURI = instanceDefinition
.fieldsStream()
Expand All @@ -214,7 +216,7 @@ public <T extends ExternalInstanceIdentifier> T extractExternalInstanceIdentifie
List<Pair<String, Serializable>> sourceSystemId = modelService
.provideModelConverter(getName())
.convertSEIPtoExternalProperty(EAIServicesConstants.URI_SUB_SYSTEM_ID,
properties.get(externalSystem.get().getName()), instanceDefinition.getIdentifier());
properties.get(externalSystem.get().getName()), externalType);
if (sourceSystemId.isEmpty()) {
throw new EAIRuntimeException("Missing required argument source system id for instance: " + source);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import com.sirma.itt.seip.domain.definition.PropertyDefinition;
import com.sirma.itt.seip.domain.instance.DefaultProperties;
import com.sirma.itt.seip.domain.instance.Instance;
import com.sirma.itt.seip.domain.instance.InstancePropertyNameResolver;
import com.sirma.itt.seip.domain.search.SearchArguments;
import com.sirma.itt.seip.domain.search.SearchArguments.QueryResultPermissionFilter;
import com.sirma.itt.seip.domain.search.SearchDialects;
Expand All @@ -59,6 +60,7 @@
import com.sirma.itt.seip.eai.model.communication.RequestInfo;
import com.sirma.itt.seip.eai.model.communication.ResponseInfo;
import com.sirma.itt.seip.eai.model.error.ErrorBuilderProvider;
import com.sirma.itt.seip.eai.model.internal.ExternalInstanceIdentifier;
import com.sirma.itt.seip.eai.model.internal.ProcessedInstanceModel;
import com.sirma.itt.seip.eai.model.internal.RelationInformation;
import com.sirma.itt.seip.eai.model.internal.RetrievedInstances;
Expand Down Expand Up @@ -110,9 +112,10 @@ public abstract class CSResponseReaderAdapter implements EAIResponseReaderAdapte
@Inject
protected QueryBuilder queryBuilder;
@Inject
private InstancePropertyNameResolver propertyNameResolver;
@Inject
@VirtualDb
private DbDao dbDao;

@SuppressWarnings("unchecked")
@Override
public <R extends ProcessedInstanceModel> R parseResponse(ResponseInfo response) throws EAIException {
Expand Down Expand Up @@ -144,7 +147,7 @@ protected SearchResultInstances<Instance> parseResultSetResponse(ResponseInfo re
SearchResultInstances<Instance> parsedInstances = new SearchResultInstances<>();
parsedInstances.setInstances(new ArrayList<>(normalized.size()));
Map<CSExternalInstanceId, Instance> existing = loadExistingItems(
normalized.stream().map(e -> e.getRecord()).collect(Collectors.toList()), errorBuilder);
normalized.stream().map(CSResultItem::getRecord).collect(Collectors.toList()), errorBuilder);
for (CSResultItem item : normalized) {
CSExternalInstanceId externalId = null;
CSItemRecord record = item.getRecord();
Expand Down Expand Up @@ -329,14 +332,14 @@ protected void constructRelationInformation(RetrievedInstances<Instance> importe
if (relationships == null) {
return;
}
String externalType = getExternalType(source);
for (CSItemRelations nextRelation : relationships) {
Object to = loadRelationAsInformation(srcRecord, nextRelation, existing, errorBuilder);
if (to == null) {
// still not imported or not needed - skip it
continue;
}
EntityRelation relation = modelConfiguration.getRelationByExternalName(source.getIdentifier(),
nextRelation.getType());
EntityRelation relation = modelConfiguration.getRelationByExternalName(externalType, nextRelation.getType());
if (relation == null) {
errorBuilder
.append("\r\n Missing relation information: ")
Expand Down Expand Up @@ -512,7 +515,12 @@ protected List<Instance> executeSearchByRecordInfo(final Map<CSExternalInstanceI
private void checkAndMapInstanceToExternalId(
final Map<CSExternalInstanceId, CSItemRecord> externalIdToExternalRecord, Instance instance,
Map<CSExternalInstanceId, Instance> externalIdToInternalInstance) throws EAIException {
DefinitionModel instanceDefinition = definitionService.getInstanceDefinition(instance);

// if external type property is not defined then the instance definition will be used for verification
// we cannot use property name converter here as the new type may not have the defined external type so we
// need to check for all this here
String externalType = getExternalType(instance);
DefinitionModel instanceDefinition = definitionService.find(externalType);
if (instanceDefinition == null) {
throw new EAIRuntimeException("Missing s definition for object with id: " + instance.getId());
}
Expand All @@ -530,7 +538,8 @@ private void checkAndMapInstanceToExternalId(
"Type for classification: " + csItemRecord.getClassification() + " not found in model!",
Objects.toString(csItemRecord, null));
}
if (!instance.getIdentifier().equals(typeByExternalName.getIdentifier())) {

if (!externalType.equals(typeByExternalName.getIdentifier())) {
throw new EAIReportableException(
"The received classification " + typeByExternalName.getIdentifier()
+ " does not match the classification " + instance.getIdentifier()
Expand All @@ -543,6 +552,11 @@ private void checkAndMapInstanceToExternalId(
}
}

private String getExternalType(Instance instance) {
return instance.getString(EAIServicesConstants.PROPERTY_EXTERNAL_TYPE,
() -> instance.getString(EAIServicesConstants.URI_EXTERNAL_TYPE, instance.getIdentifier()));
}

private Serializable extractExternalIdFromInstance(Instance instance, DefinitionModel instanceDefinition) {
String externalIdUri = getExternalIdUri(instance.getIdentifier());
Optional<PropertyDefinition> externalIdProperty = instanceDefinition
Expand Down Expand Up @@ -582,7 +596,7 @@ private Serializable extractExternalSystemIdFromInstance(Instance instance, Defi
.provideModelConverter(
instance.getProperties().get(EAIServicesConstants.PROPERTY_INTEGRATED_SYSTEM_ID).toString())
.convertSEIPtoExternalProperty(EAIServicesConstants.URI_SUB_SYSTEM_ID, externalIdLoaded,
instanceDefinition.getIdentifier());
getExternalType(instance));
} catch (EAIModelException e) { // NOSONAR
// rethrow with original cause and message
throw new EAIRuntimeException(e.getMessage(), e.getCause());
Expand Down Expand Up @@ -636,6 +650,10 @@ protected void fillDefaultProperties(Instance instance, @SuppressWarnings("unuse
throws EAIReportableException {
instance.add(EAIServicesConstants.PROPERTY_INTEGRATED_SYSTEM_ID, getName());
instance.add(EAIServicesConstants.PROPERTY_INTEGRATED_FLAG_ID, Boolean.TRUE);
// define the initial import type of the instance if not defined in the external mapping configuration
if (!instance.isPropertyPresent(EAIServicesConstants.URI_EXTERNAL_TYPE, propertyNameResolver)) {
instance.add(EAIServicesConstants.URI_EXTERNAL_TYPE, instance.getIdentifier(), propertyNameResolver);
}
}

/**
Expand All @@ -654,6 +672,13 @@ protected void fillReceivedProperties(Instance createdInstance, CSItemRecord rec
Map<String, Serializable> convertExternaltoSEIPProperties = modelConverter
.convertExternaltoSEIPProperties(record.getProperties(), createdInstance);
createdInstance.getProperties().putAll(convertExternaltoSEIPProperties);

// override the type of the instance. If the instance exists and it's type has been changed the above properties
// update will override the changed type. This is not desired so we reset the type field back to the one known
// in the system
if (createdInstance.getIdentifier() != null) {
createdInstance.add(DefaultProperties.TYPE, createdInstance.getIdentifier());
}
}

/**
Expand All @@ -680,7 +705,7 @@ protected void fillRelationsInformation(Instance createdInstance, CSItemRecord r
}
// references is id by spec
createdInstance.getProperties().put(EAIServicesConstants.PROPERTY_REFERENCES, String.join(", ",
relationsByIds.keySet().stream().map(e -> e.getExternalId()).collect(Collectors.toList())));
relationsByIds.keySet().stream().map(ExternalInstanceIdentifier::getExternalId).collect(Collectors.toList())));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion cs-deployment/cs-eai/eai-impl-cms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sirma.itt.cs</groupId>
<artifactId>cs-eai</artifactId>
<version>2.22.0-SNAPSHOT</version>
<version>2.28.0-SNAPSHOT</version>
</parent>
<artifactId>eai-impl-cms</artifactId>
<name>CMS Enterprise Integration</name>
Expand Down
2 changes: 1 addition & 1 deletion cs-deployment/cs-eai/eai-impl-dam/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sirma.itt.cs</groupId>
<artifactId>cs-eai</artifactId>
<version>2.22.0-SNAPSHOT</version>
<version>2.28.0-SNAPSHOT</version>
</parent>
<artifactId>eai-impl-dam</artifactId>
<name>DAM enteprise integration</name>
Expand Down
2 changes: 1 addition & 1 deletion cs-deployment/cs-eai/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sirma.itt.cs</groupId>
<artifactId>cs-parent</artifactId>
<version>2.22.0-SNAPSHOT</version>
<version>2.28.0-SNAPSHOT</version>
</parent>
<artifactId>cs-eai</artifactId>
<name>EAI CS implementation</name>
Expand Down
2 changes: 1 addition & 1 deletion cs-deployment/cs-semantic-patches/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>com.sirma.itt.cs</groupId>
<artifactId>cs-parent</artifactId>
<version>2.22.0-SNAPSHOT</version>
<version>2.28.0-SNAPSHOT</version>
</parent>
<artifactId>cs-semantic-patches</artifactId>
</project>
2 changes: 1 addition & 1 deletion cs-deployment/cs-war-deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sirma.itt.cs</groupId>
<artifactId>cs-parent</artifactId>
<version>2.22.0-SNAPSHOT</version>
<version>2.28.0-SNAPSHOT</version>
</parent>
<artifactId>cs-war-deployment</artifactId>
<packaging>war</packaging>
Expand Down
2 changes: 1 addition & 1 deletion cs-deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.sirma.itt.cs</groupId>
<artifactId>cs-parent</artifactId>
<version>2.22.0-SNAPSHOT</version>
<version>2.28.0-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
Expand Down
Loading

0 comments on commit f758993

Please sign in to comment.