Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public class KnownJarsFilter implements Predicate<String> {
add("axis-");
add("axis2-");
add("batchee-jbatch");
add("batik-");
add("bcprov-");
add("beam-sdks-");
add("beam-runners-");
Expand All @@ -80,6 +81,7 @@ public class KnownJarsFilter implements Predicate<String> {
add("charsets.jar");
add("cldrdata");
add("commons-");
add("components-api");
add("component-api");
add("component-spi");
add("component-runtime");
Expand All @@ -91,7 +93,9 @@ public class KnownJarsFilter implements Predicate<String> {
add("cssparser-");
add("curator-");
add("cxf-");
add("cdi-");
add("deploy.jar");
add("deltaspike-");
add("derby-");
add("derbyclient-");
add("derbynet-");
Expand All @@ -103,13 +107,15 @@ public class KnownJarsFilter implements Predicate<String> {
add("ehcache-");
add("error_prone_annotations");
add("FastInfoset");
add("freemarker-");
add("j2objc-annotations");
add("jackson-");
add("jaxb-");
add("jce.jar");
add("jets3t");
add("jfr.jar");
add("jfxrt.jar");
add("jmustache");
add("jna-");
add("jnr-");
add("johnzon-");
Expand All @@ -118,6 +124,7 @@ public class KnownJarsFilter implements Predicate<String> {
add("jolokia-serv");
add("json-simple-");
add("json4s-");
add("jsr250-");
add("fusemq-leveldb-");
add("geronimo-");
add("google-");
Expand Down Expand Up @@ -213,8 +220,7 @@ public class KnownJarsFilter implements Predicate<String> {
add("mapstruct-");
add("maven-");
add("mbean-annotation-api-");
add("meecrowave-maven-");
add("meecrowave-gradle-");
add("meecrowave-");
add("mesos-");
add("metrics-");
add("mimepull-");
Expand Down Expand Up @@ -294,6 +300,7 @@ public class KnownJarsFilter implements Predicate<String> {
add("swizzle-");
add("sxc-");
add("tachyon-");
add("talend-icon");
add("testng-");
add("tomcat-annotations");
add("tomcat-api");
Expand Down Expand Up @@ -338,6 +345,7 @@ public class KnownJarsFilter implements Predicate<String> {
add("xml-resolver-");
add("xmlbeans-");
add("xmlenc-");
add("xmlgraphics-");
add("xmlpull-");
add("xmlrpc-");
add("xmlschema-");
Expand Down
8 changes: 7 additions & 1 deletion component-starter-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
distributed under the License is distributed on an "AS model.getCategory())IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Expand Down Expand Up @@ -86,6 +86,12 @@
<version>${project.version}</version>
<scope>provided</scope>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
/**
* Copyright (C) 2006-2017 Talend Inc. - www.talend.com
* Copyright (C) 2006-2017 Talend Inc. - www.talend.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.talend.component.starter.server.front;

import static java.util.Collections.emptyList;
import static java.util.Collections.emptyMap;
import static java.util.Collections.singletonList;
import static java.util.Optional.ofNullable;
import static java.util.stream.Collectors.toList;
Expand Down Expand Up @@ -97,34 +98,47 @@ private ProjectRequest toRequest(final ProjectModel model) {
packageBase = "component";
}

return new ProjectRequest(
ofNullable(model.getBuildType()).orElse("maven").toLowerCase(Locale.ENGLISH),
return new ProjectRequest(ofNullable(model.getBuildType()).orElse("maven").toLowerCase(Locale.ENGLISH),
new ProjectRequest.BuildConfiguration(
ofNullable(model.getName()).orElse("A Talend generated Component Starter Project"),
ofNullable(model.getDescription()).orElse("An application generated by the Talend Component Kit Starter"),
"jar",
packageBase,
ofNullable(model.getArtifact()).orElse("application"),
ofNullable(model.getVersion()).orElse("0.0.1-SNAPSHOT"),
"1.8"),
"jar", packageBase, ofNullable(model.getArtifact()).orElse("application"),
ofNullable(model.getVersion()).orElse("0.0.1-SNAPSHOT"), "1.8"),
ofNullable(model.getPackageBase()).orElse("com.application").replace('/', '.'),
ofNullable(model.getFacets()).orElse(emptyList()),
ofNullable(model.getSources())
.map(s -> s.stream()
.map(i -> new ProjectRequest.SourceConfiguration(i.getName(), i.isGenericOutput(), toStructure(i.getOutputStructure())))
.collect(toList()))
.map(i -> new ProjectRequest.SourceConfiguration(i.getName(), i.getIcon(),
toStructure(false, i.getConfigurationStructure()).getStructure(),
toStructure(i.isGenericOutput(), i.getOutputStructure())))
.collect(toList()))
.orElse(emptyList()),
ofNullable(model.getProcessors())
.map(s -> s.stream().map(i -> new ProjectRequest.ProcessorConfiguration(i.getName(), i.isGenericInputs(), i.isGenericOutputs(),
i.getInputs(), i.getOutputs(),
ofNullable(i.getInputStructures()).map(is -> is.stream().map(this::toStructure).collect(toList())).orElse(emptyList()),
ofNullable(i.getOutputStructures()).map(is -> is.stream().map(this::toStructure).collect(toList())).orElse(emptyList())))
.collect(toList()))
.orElse(emptyList()));
.map(s -> s.stream()
.map(i -> new ProjectRequest.ProcessorConfiguration(i.getName(), i.getIcon(),
toStructure(false, i.getConfigurationStructure()).getStructure(),
ofNullable(i.getInputStructures())
.map(is -> is.stream()
.collect(toMap(ProjectModel.NamedModel::getName,
nm -> toStructure(nm.isGeneric(), nm.getStructure()))))
.orElse(emptyMap()),
ofNullable(i.getOutputStructures())
.map(is -> is.stream()
.collect(toMap(ProjectModel.NamedModel::getName,
nm -> toStructure(nm.isGeneric(), nm.getStructure()))))
.orElse(emptyMap())))
.collect(toList()))
.orElse(emptyList()),
model.getFamily(), model.getCategory());
}

private ProjectRequest.DataStructure toStructure(final ProjectModel.Model model) {
return new ProjectRequest.DataStructure(model.getEntries() == null ? emptyList() : model.getEntries().stream()
.map(e -> new ProjectRequest.Entry(e.getName(), e.getType())).collect(toList()));
private ProjectRequest.StructureConfiguration toStructure(final boolean generic, final ProjectModel.Model model) {
return new ProjectRequest.StructureConfiguration(!generic ? new ProjectRequest.DataStructure(model.getEntries() == null
? emptyList()
: model.getEntries().stream()
.map(e -> new ProjectRequest.Entry(e.getName(), e.getType(),
e.getModel() != null ? toStructure(false, e.getModel()).getStructure() : null))
.collect(toList()))
: null, generic);
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**
* Copyright (C) 2006-2017 Talend Inc. - www.talend.com
* Copyright (C) 2006-2017 Talend Inc. - www.talend.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.talend.component.starter.server.model;

Expand All @@ -23,17 +23,31 @@

@Data
public class ProjectModel {

private String buildType;

private String version;

private String group;

private String artifact;

private String name;

private String description;

private String packageBase;

private String family;

private String category;

// private String packaging; // jar only for now
// private String javaVersion; // enforce to java 8 for now
private Collection<String> facets;

private Collection<Source> sources;

private Collection<Processor> processors;

@Getter
Expand All @@ -42,8 +56,12 @@ public static class Source {

private final String name;

private final String icon;

private final boolean genericOutput;

private final Model configurationStructure;

private final Model outputStructure;
}

Expand All @@ -61,6 +79,8 @@ public static class Entry {
private final String name;

private final String type;

private final Model model;
}

@Getter
Expand All @@ -69,16 +89,23 @@ public static class Processor {

private final String name;

private final boolean genericInputs;
private final String icon;

private final Model configurationStructure;

private final boolean genericOutputs;
private final Collection<NamedModel> inputStructures;

private final Collection<String> inputs;
private final Collection<NamedModel> outputStructures;
}

private final Collection<String> outputs;
@Getter
@RequiredArgsConstructor
public static class NamedModel {

private final String name;

private final Collection<Model> inputStructures;
private final boolean generic;

private final Collection<Model> outputStructures;
private final Model structure;
}
}
Loading