Search in sources :

Example 1 with QNameWithTypeApiData

use of org.eclipse.winery.repository.rest.resources.apiData.QNameWithTypeApiData in project winery by eclipse.

the class RestUtils method createArtifactTemplate.

public static ArtifactTemplateId createArtifactTemplate(InputStream uploadedInputStream, FormDataContentDisposition fileDetail, FormDataBodyPart body, QName artifactType, UriInfo uriInfo) {
    ArtifactTemplatesResource templateResource = new ArtifactTemplatesResource();
    QNameWithTypeApiData qNameApiData = new QNameWithTypeApiData();
    qNameApiData.localname = "xaasPackager_" + fileDetail.getFileName();
    qNameApiData.namespace = "http://opentosca.org/xaaspackager";
    qNameApiData.type = artifactType.toString();
    templateResource.onJsonPost(qNameApiData);
    ArtifactTemplateId artifactTemplateId = new ArtifactTemplateId("http://opentosca.org/xaaspackager", "xaasPackager_" + fileDetail.getFileName(), false);
    ArtifactTemplateResource atRes = new ArtifactTemplateResource(artifactTemplateId);
    atRes.getFilesResource().onPost(uploadedInputStream, fileDetail, body, uriInfo);
    return artifactTemplateId;
}
Also used : QNameWithTypeApiData(org.eclipse.winery.repository.rest.resources.apiData.QNameWithTypeApiData) ArtifactTemplatesResource(org.eclipse.winery.repository.rest.resources.entitytemplates.artifacttemplates.ArtifactTemplatesResource) ArtifactTemplateId(org.eclipse.winery.common.ids.definitions.ArtifactTemplateId) ArtifactTemplateResource(org.eclipse.winery.repository.rest.resources.entitytemplates.artifacttemplates.ArtifactTemplateResource)

Aggregations

ArtifactTemplateId (org.eclipse.winery.common.ids.definitions.ArtifactTemplateId)1 QNameWithTypeApiData (org.eclipse.winery.repository.rest.resources.apiData.QNameWithTypeApiData)1 ArtifactTemplateResource (org.eclipse.winery.repository.rest.resources.entitytemplates.artifacttemplates.ArtifactTemplateResource)1 ArtifactTemplatesResource (org.eclipse.winery.repository.rest.resources.entitytemplates.artifacttemplates.ArtifactTemplatesResource)1