CloudOpting / cloudopting-manager

The cloudopting core manager
MIT License
10 stars 7 forks source link

GET /application/{idApp}/file should have the type of the file (PROMO, TOSCA, LIBRARY) #345

Closed xeviscc closed 8 years ago

xeviscc commented 8 years ago

GET /application/{idApp}/file should have the type of the file (PROMO, TOSCA, LIBARARY) or a separate endpoint should be provided in order to be available to show them in the proper screen.

image

xeviscc commented 8 years ago

The types are:

ciprianpavel commented 8 years ago

@guidospadotto-profesia : Can you check wherever BpmnService.upload() return the type of the file as asked by @xeviscc

guidospadotto-profesia commented 8 years ago

This is the signature of the method: public ActivitiDTO upload(UploadDTO uploadDTO) ActivitiDTO does not have the type of upload, which is passed into the method as an attribute of uploadDTO.

One possible solution MIGHT be adding additional metadata to the JCR Nodes when saving them in JackRabbit, see: http://stackoverflow.com/questions/15896950/jcr-new-nodetype-with-custom-properties https://modeshape.wordpress.com/2010/09/01/custom-properties-on-ntfile-and-ntfolder-nodes/

When querying the files from the JCR Repo, those informations will be available.

@ildave take a look at the URLs above

gioppoluca commented 8 years ago

I do not agree on the whole approach. We deecided to have a table with the info of the application and there we have the image and the toscafile. Than there should be a table where we have all the other files. That table do not have a column for specifying what the file is but we do not really need it since we should not care. JR is just a BIN where we dump stuff into The DB is the real keeper of the info All the API for getting file info should read the DB discover the proper name and path on JR and recover the required file. The API in discussion should return the list of files associated with the application but are all files linked to the tosca needs and not the image or the tosca file itself that are saved on a different table. Why do we want to have all those files together?

ildave commented 8 years ago

I pushed some changes to address this issue: be00b49333443a8b5c57de76d57f11461e8ddb11

Now the output of the/application/{idApp}/file endpoint is in this format:

{
    "files": [{
        "filePath": "http://lab1.cloudopting.org:8083/repository/default/organization_key/busportal/template/bus_home.png",
        "fileType": "content library
    }, {
        "filePath": "http://lab1.cloudopting.org:8083/repository/default/organization_key/busportal/template/bus_home.png",
        "fileType": "promoimage"
    }, {
        "filePath": "http://lab1.cloudopting.org:8083/repository/default/organization_key/busportal/template/TOSCA_Archive (4).zip",
        "fileType": "toscaarchive"
    }]
}
cpopsa commented 8 years ago

eu.cloudopting.domain.ApplicationFile is missing @ildave please fix the compilation problem

ildave commented 8 years ago

My bad, I have pushed the missing files.