GALAglobal / TAPICC-API-implementation

TAPICC API implementation using node.js framework sails.js
Other
6 stars 1 forks source link

proposal: add Asset.originalPath #34

Open assembledStarDust opened 6 years ago

assembledStarDust commented 6 years ago

proposal: add Asset.originalPath: string

Asset.originalPath would be a reference for the sender of the file. A particular file might be referenced by a path on the client server. Uploading as an asset loses this info. When pulling back a final translated file, there could be benefit in knowing the original path it came from.

Alino commented 6 years ago

in commit https://github.com/GALAglobal/TAPICC-API-implementation/commit/8b4851317597f76e22e1bb448dac07e904774743 I have added two new fields:

Asset.fileDescriptor (it's a path to the file on the TAPICC server) Asset.fileOriginalName (it's the original name of the file when it was uploaded to the TAPICC server)

These 2 fields were also added for the Task model.


My question is: is Asset.fileDescriptor the same thing as your proposal for Asset.originalPath ?

assembledStarDust commented 6 years ago

It seems that Asset.fileOriginalName would be similar as my proposal for Asset.originalPath.

If the field could be allowed to include a path with Asset.fileOriginalName, then that would suffice the requirement.

Alino commented 6 years ago

Oh I see now. Asset.originalPath is filesystem path on the tapicc server + original file name as uploaded. for example uploading a jpg with name my_file.jpg would be _Asset.originalPath = /tapicc/assets/assets/myfile.jpg


After the file upload implementation, this seems now unnecessary for me. Because the same scenario with uploading my_file.jpg in the current implementation would result into _Asset.fileOriginalName = myfile.jpg Asset.fileDescriptor = /tapicc/assets/assets/00b7081a-34e8-48e4-a352-b3ec5952def6.jpg

The reason why we don't use the original file name in the actual file system, is because there could be duplicate file names with different content. However when downloading the files through the download API endpoints, the file is being downloaded with the original file name.


EDIT: Did you mean that the Asset.originalPath would be filesystem path of the system which is uploading the file?

assembledStarDust commented 6 years ago

While I can see that either method will achieve the aim of putting back a file to the client with the same path, I'd be a bit wary of embedding a client path onto a target system.

If we are to change the asset name (for which I agree with), the implementer of the standard should be free to put it anywhere. That's why I'd be suggesting client path to be stored.

assembledStarDust commented 6 years ago

reply to edit: yes.

mesztam commented 5 years ago

can we call this e.g. clientId or something like this instead? Then it's up to the client system what information to store there. Either a path, or even some artificial ID that exactly identifies the source file in the client system.

terales commented 5 years ago

As we disucussed in the https://github.com/GALAglobal/TAPICC-API-implementation/issues/58#issuecomment-462760956 there would be a name parameter that you can use to store a reference.

@mesztam Does it solve your case?

mesztam commented 5 years ago

I'm not 100% sure. So e.g. input.name can be also a GUID? Then the input file won't have a human-readable name. If we use a human-readable name like 'test.docx', then we can't always pair this to a resource in the source system. E.g. the input file's name in a project is not necessarily unique. Or we should use names like "path1\test.docx" in the one case, and "path2\test.docx" for the other input? (Or even an URI) And the TAPICC implementation should split at (back)slashes, and use the last fragment (test.docx) to generate a name for the deliverable?