agea / CmisJS

A CMIS javascript library for node and browser
MIT License
38 stars 34 forks source link

createItem signature and submitted form data #73

Open wiser opened 3 years ago

wiser commented 3 years ago

Hello,

to start, let me thank you for still maintaining your library, we use it time to time it’s a very convenient.

We have tried to use the "createItem" method and we observe a shift between what we expected and what we get. In your documentation, we have to provide a folderId. The cmis specification says it’s optionnal, so we try to put null value and it works. Ok, that’s fine. But when we provide a real value (the root folder id of our repository) the request send an objectId data instead of a folderId. There is what we receive in our server :

cmisaction = > "createItem", objectId => 2, propertyId => [...], propertyValue => [...], succinct => true

Our server doesn’t understand the submitted objectId parameter.

According to you, is there a mistake in the cmis library or do we have to consider the objectId is the folderId in the server side ?

Thanks for your help. Wiser

agea commented 3 years ago

I think it's a bug, probably the line

https://github.com/agea/CmisJS/blob/master/src/cmis.ts#L1342

it's wrong, you may create a pull request with the correction, and if possible even a test (the tests were run against alfresco mainly, i don't know what is your backend)

Thank you

wiser commented 3 years ago

Ok, I will do a pull request with a test. Our backend is homemade and we use your lib to validate our new devs. We also use your lib to administer our servers.

wiser commented 3 years ago

Hello @agea

I have take a look on the lib tests and there is a lot of HTTP 403 Forbidden errors from the Alfresco server. So I can add another assertion for the createItem method but I am pretty sure with this server will reject it as it does with the others. By the way, there is many other warnings, do you also have all these "UnhandledPromiseRejectionWarning" when you run tests ?

Thanks

agea commented 3 years ago

hello, it's possibile that the test server specified in the tests (https://cmis.alfresco.com/cmisbrowser) is no longer available to everyone.. if you have an internal alfresco available you can change the url to your server via an environment variable, otherwise just add your test, and i will check before merging the pull request