/** * Create an instance of {@link ApplicationOption } * */ public ApplicationOption createApplicationOption() { return new ApplicationOption(); }
@Override public String getId(ApplicationOption entity) { return entity.getId(); }
return Response.status(Status.BAD_REQUEST).entity("file has to be provided").build(); ApplicationOption option = new ApplicationOption(); option.setId(id); option.setName(name); option.setDescription(description); option.setIconUrl(iconFileName); option.setPlanInputMessageUrl(planInputMessageFileName); option.setPlanServiceName(planServiceName);
@Override public Response onDelete() { // delete icon and plan model reference ... // delete icon // we use the URL stored in the data instead of the generated URL to be compatible with manually edits RepositoryFileReference ref = new RepositoryFileReference(this.ssmdId, this.o.getIconUrl()); try { RepositoryFactory.getRepository().forceDelete(ref); } catch (IOException e) { OptionResource.LOGGER.error("Could not remove file", e); return Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); } // delete plan input // we use the URL stored in the data instead of the generated URL to be compatible with manually edits ref = new RepositoryFileReference(this.ssmdId, this.o.getPlanInputMessageUrl()); try { RepositoryFactory.getRepository().forceDelete(ref); } catch (IOException e) { OptionResource.LOGGER.error("Could not remove file", e); return Response.status(Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); } // after deleting files, continue with list deletion return super.onDelete(); } }
SelfServiceMetaDataId id = new SelfServiceMetaDataId(entryId); for (ApplicationOption option : options.getOption()) { String url = option.getIconUrl(); if (Util.isRelativeURI(url)) { putRefIntoRefMap(targetDir, refMap, repository, id, url); url = option.getPlanInputMessageUrl(); if (Util.isRelativeURI(url)) { putRefIntoRefMap(targetDir, refMap, repository, id, url);
private String getFileNamePrefix() { return OptionResource.getFileNamePrefix(this.o.getId()); }