dkd / typo3-ext-cmis-fal

A TYPO3 CMS FAL driver for CMIS
3 stars 0 forks source link

Initialization does not work #4

Open fladi opened 7 years ago

fladi commented 7 years ago

I'm trying to evaluate this extension to see if it fits my needs but I cannot get past the point of initialization described in #3.

I included the TypoScript template from cmis_service and changed the constants to fit my environment but once I try to do the initialization it fails with an error:

Initialising CMIS repository (may take a few seconds)... CMIS initialisation failed! Reason: Parameter "dkd.phpcmis.binding.browser.url" is missing!

From what I can see dkd.phpcmis.binding.browser.url is something the PHP CMIS client library expects but I cannot figure out where it should be passed from the CMIS FAL/service to the client.

dkd-dobberkau commented 7 years ago

Which CMIS Repo are you using?

fladi commented 7 years ago

Alfresco 5.1. I can successfully connect to the browser API-endpoint using the CMIS workbench from the Chemistry project.

dkd-dobberkau commented 7 years ago

did you set? plugin.tx_cmisservice.settings.cmis.servers.default.url =http://localhost:7070/alfresco/api/-default-/public/cmis/versions/1.1/browser in the TS?

fladi commented 7 years ago

Yes, except that it's https and uses a separate server:

plugin.tx_cmisservice.settings.cmis.servers.default {
    url = https://server.example.org/alfresco/api/-default-/public/cmis/versions/1.1/browser
    username = typo3
    password = *******
    contentRepositoryId = -default-
}
sascha-egerer commented 7 years ago

Have you figured out what the Problem is? If Not please Tell me and i'll try to support you. Sorry for the delay. Sascha

Am 21. Okt. 2016, 15:08 +0200 schrieb Michael Fladischer notifications@github.com:

Yes, except that it's https and uses a separate server:

plugin.tx_cmisservice.settings.cmis.servers.default { url = https://server.example.org/alfresco/api/-default-/public/cmis/versions/1.1/browser username = typo3 password = *** contentRepositoryId = -default- }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub (https://github.com/dkd/typo3-ext-cmis-fal/issues/4#issuecomment-255371841), or mute the thread (https://github.com/notifications/unsubscribe-auth/ABky1iRCMb4kRkZ82zxGy4YVJ8s1ny8Uks5q2LkdgaJpZM4KdDe8).

fladi commented 7 years ago

The problem still persists. What can I do to help with the debugging?

sascha-egerer commented 7 years ago

Not sure but you've Not defined Andy Protocol in your URL. Maybe its just the missing https? sorry it was just not displayed in the github mail. If this does Not help could you Provider a Full example (Extension Version and typoscript configuration)?

NamelessCoder commented 7 years ago

To clarify what actually goes on inside when you run the initialisation command:

  1. Extension cmis_service is asked to initialize itself (InitializationTask from that ext is executed)
  2. InitializationTask attempts to:
    1. Connect to CMIS
    2. Read available type definitions to determine if TYPO3-specific types exist
    3. If they do not, upload them using the schema update feature in CMIS
  3. cmis_fal tries to create the file storage record using templates hardcoded into the creation logic. It does this and attempts to put the storage online.
  4. If the CMIS FAL initialisation command was asked to create (file) mounts, it attempts to do so.
  5. If the CMIS FAL initialisation command was asked to assign the mount to groups, it attempts to do so.

This is the full initialisation logic; after that you may need to perform the following steps, depending on how customised your CMIS installation is:

  1. Edit the created storage record to select another repository (this depends on an active CMIS connection!)
  2. Edit the created storage record to select another root folder (also depends on an active connection!)

And regarding the dependencies of the logic above:

It sounds from the report above as if the CMIS initialisation task has a problem initialising the CMIS connection because it cannot read the correct TS configuration containing your connection url and credentials. I would look into your TS first, make sure that cmis_service TS is loaded and available (see above) and try to initialize CMIS alone (instead of doing so via CMIS FAL). Finally, enable logging on your site and check for any messages about responses from CMIS itself - but check the TS issue first of all since without that, no requests will even be made to the repository (client itself fails due to missing parameter). I expect once you find and solve the TS retrieval issue the rest will begin working right away.

Hopefully this helps.

fladi commented 7 years ago

@NamelessCoder thanks for your input, but I'm still stuck. This is what I tried so far:

The command I use to initialize cmis_service is: sudo -u www-data php /path/to/typo3/cli_dispatch.phpsh extbase cmis:initialize. It still results in the same warning.

fladi commented 7 years ago

Ok, I found the culprit. It's caused by the schema upload, which required elevated privileges in Alfresco. The user I tried to use had only limited privileges. The first failure somehow got cached in typo3temp/Cache/... which then triggered the Parameter "dkd.phpcmis.binding.browser.url" is missing! message. After cleaning the cache I was able to see the real error message which was the Unauthorized status from Alfresco.

ksjogo commented 7 years ago

Ok, we should implement a check for that.

fladi commented 7 years ago

Now I'm stuck at calling cmisfal:initialize with the message CMIS initialisation failed! Reason: Document is not the latest version!. The model was successfully uploaded at the first run. No TYPO3 file storage was created.

fladi commented 7 years ago

Any news on this?

dkd-dobberkau commented 7 years ago

We are currently working on other issues.

If you want to add some money to our open source work then send me your details and I will write you an offer.

ksjogo commented 7 years ago

@fladi You could try to add the ResourceStorage by hand. Then you circumvent the model upload which is not necessary for the basic functionality.

@NamelessCoder Could we try/catch the upload and still proceed with the configuration if that failed?

NamelessCoder commented 7 years ago

@ksjogo FAL objects won't work without the schema, so we can't suppress errors that happen during model installation. In the case of insufficient permissions it's fine to upload the model as another user and then run the initialisation, but the driver won't run without it.