Giter Club home page Giter Club logo

Comments (15)

lmignon avatar lmignon commented on July 18, 2024 1

@JosDeGraeve Thank you for the tip!

from alfodoo.

lmignon avatar lmignon commented on July 18, 2024 1

@Logicasoft I think that an information is lacking in the documentation if your alfresco server is behind a proxy...
The CMIS discovery document returns absolute template URLs that have to be used to navigate the repository and retrieve node information. This service is the first one called when a cmis session is initialized and the next calls will use the url received into the result. By default the hostname of the server is returned in the URLs, if the server is behind a proxy the hostname needs to be configured to return the publicly accessible hostname. If you are in this case you must add the following lines alfresco-global.properties

opencmis.context.override=true
opencmis.context.value=
opencmis.servletpath.override=true
opencmis.servletpath.value=
opencmis.server.override=true
opencmis.server.value=https://XYZ/alfresco/api

from alfodoo.

lmignon avatar lmignon commented on July 18, 2024

@Logicasoft
Location: https://alfrescodemo.eu/alfresco/api/-default-/public/cmis/versions/1.1/browser/
API: https://alfrescodemo.eu/alfresco/s/api
Share: https://alfrescodemo.eu/share

Since you use 'https' you must trust the certificate on the server or monkey patch urllib to disable the SSL certificate validation by default

import httplib2
import functools

# Disable SSL Certificate Validation by python code
httplib2.Http = functools.partial(
    httplib2.Http, disable_ssl_certificate_validation=True)

Don't forget to configure CORS in alfresco: http://alfodoo.org/guides/install.html

from alfodoo.

logicasoftadmin avatar logicasoftadmin commented on July 18, 2024

Thanks Laurent

from alfodoo.

JosDeGraeve avatar JosDeGraeve commented on July 18, 2024

Hi, @Logicasoft @lmignon

Thanks for the module, great work !

Just a small tip, in order to have proper ssl validation, you can monkey-patch the ca certificates path that comes with your deployment environment with:

example for Debian-style systems:

import httplib2
import functools

# Set system CA Certificates based SSL Certificate Validation by python code
httplib2.Http = functools.partial(
    httplib2.Http,
    ca_certs="/etc/ssl/certs/ca-certificates.crt"
)

from alfodoo.

logicasoftadmin avatar logicasoftadmin commented on July 18, 2024

Helo and a very happy new year

We finished the CORS config and we still have a samll problem with the Initial directory for writing

We created a site within Alfresco, named : alfodoo

So we have the following : share/page/site/alfodoo/dashboard

And we created a folder names testalfodoo : share/page/site/alfodoo/documentlibrary#filter=path%7C%2Ftestalfodoo%7C&page=1

What are the values for the initial directory for writing (we have error 405 if we put the whole string "share/page/site/alfodoo/documentlibrary#filter=path%7C%2Ftestalfodoo%7C&page=1" or an error past for false if we type " /alfodoo/testalfodoo"

Many thanks

from alfodoo.

lmignon avatar lmignon commented on July 18, 2024

@Logicasoft The path to give is the cmis path. IOW if you have named your site alfodoo, the cmis path to the document library of yours site should be: /Sites/alfodoo/documentLibrary/
To create your new directories into the sub folder 'testalfodoo' the initial directory for writing should be: /Sites/alfodoo/documentLibrary/testalfodoo

from alfodoo.

logicasoftadmin avatar logicasoftadmin commented on July 18, 2024

Hello

Since the activation of the CORS, we have a conflict. In Alfresco, we are not allowed anymore to create a file folder within an alfresco site.

There is a mapping on the url-pattern /api/* and the web script of creation of folders and content in Alfresco and alfresco is also using url/api/

Thanks for any idea

from alfodoo.

sterbhai avatar sterbhai commented on July 18, 2024

Had the same problem with folder and file creation. I added/left the Alfresco IP and URL in the allowed hosts and folder/file creation works from alfresco and odoo.

from alfodoo.

lmignon avatar lmignon commented on July 18, 2024

@sterbhai You problem is not related to alfodoo. It's related to the way you must properly configure alfresco to work behind a reverse proxy. The answer is maybe into /tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml Look for <config evaluator="string-compare" condition="CSRFPolicy" replace="true">. You must probably adapt this section.

from alfodoo.

vincentlaurent avatar vincentlaurent commented on July 18, 2024

Hello Laurent

What is the utility of several backends ?

Can you configure one backend pointing to a specific site for HR and another site for anaother object ?

thanks

from alfodoo.

lmignon avatar lmignon commented on July 18, 2024

@vincentlaurent

What is the utility of several backends ?

You can use multiple backends if you have more than one CMIS container (alfresco or....) to be accessed by the same odoo app.
Since a folder is materialized into Odoo by a cmis_folder field and you can specify into the field definition the name of the backend to use, it's therefore possible to have on a same model 2 folders in 2 different CMIS container....

from alfodoo.

lmignon avatar lmignon commented on July 18, 2024

@Logicasoft I close this issue. Feel free to reopen-it if it's not fixed.

from alfodoo.

ikrape avatar ikrape commented on July 18, 2024

@lmignon hello , i can't import files ican't find the buttons to import i can only create folder can you help me pleassee ? i have this erreur in js :


> web.assets_common.js:3028 Server application error {"message":"Odoo Server Error","code":200,"data":{"debug":"Traceback (most recent call last):\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 641, in _handle_exception\n    return super(JsonRequest, self)._handle_exception(exception)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 683, in dispatch\n    result = self._call_function(**self.params)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 333, in _call_function\n    return checked_call(self.db, *args, **kwargs)\n  File \"/home/ikram/odoo/odoo-10/odoo/service/model.py\", line 101, in wrapper\n    return f(dbname, *args, **kwargs)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 326, in checked_call\n    result = self.endpoint(*a, **kw)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 941, in __call__\n    return self.method(*args, **kw)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 506, in response_wrap\n    response = f(*args, **kw)\n  File \"/home/ikram/odoo/odoo-10/odoo/addons/bus/controllers/main.py\", line 35, in poll\n    raise Exception(\"bus.Bus unavailable\")\nException: bus.Bus unavailable\n","exception_type":"internal_error","message":"bus.Bus unavailable","name":"exceptions.Exception","arguments":["bus.Bus unavailable"]}}
> (anonymous) @ web.assets_common.js:3028
> 2localhost:8082/alfresco/api/-default-/public/cmis/versions/1.1/browser/:1 Failed to load resource: the server responded with a status of 403 (Interdit)
> :8080/web?&debug=#id=1&view_type=form&model=cmis.test.model&menu_id=286&action=386:1 Failed to load http://localhost:8082/alfresco/api/-default-/public/cmis/versions/1.1/browser/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://0.0.0.0:8080' is therefore not allowed access. The response had HTTP status code 403.
> 2localhost:8082/alfresco/api/-default-/public/cmis/versions/1.1/browser/:1 Failed to load resource: the server responded with a status of 403 (Interdit)
> :8080/web?&debug=#id=1&view_type=form&model=cmis.test.model&menu_id=286&action=386:1 Failed to load http://localhost:8082/alfresco/api/-default-/public/cmis/versions/1.1/browser/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://0.0.0.0:8080' is therefore not allowed access. The response had HTTP status code 403.
> 2localhost:8082/alfresco/api/-default-/public/cmis/versions/1.1/browser/:1 Failed to load resource: the server responded with a status of 403 (Interdit)
> :8080/web?&debug=#id=1&view_type=form&model=cmis.test.model&menu_id=286&action=386:1 Failed to load http://localhost:8082/alfresco/api/-default-/public/cmis/versions/1.1/browser/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://0.0.0.0:8080' is therefore not allowed access. The response had HTTP status code 403.
> 2localhost:8082/alfresco/api/-default-/public/cmis/versions/1.1/browser/:1 Failed to load resource: the server responded with a status of 403 (Interdit)
> :8080/web?&debug=#view_type=form&model=cmis.test.model&menu_id=286&action=386:1 Failed to load http://localhost:8082/alfresco/api/-default-/public/cmis/versions/1.1/browser/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://0.0.0.0:8080' is therefore not allowed access. The response had HTTP status code 403.
> 2localhost:8082/alfresco/api/-default-/public/cmis/versions/1.1/browser/:1 Failed to load resource: the server responded with a status of 403 (Interdit)
> :8080/web?&debug=#id=2&view_type=form&model=cmis.test.model&menu_id=286&action=386:1 Failed to load http://localhost:8082/alfresco/api/-default-/public/cmis/versions/1.1/browser/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://0.0.0.0:8080' is therefore not allowed access. The response had HTTP status code 403.
> 2localhost:8082/alfresco/api/-default-/public/cmis/versions/1.1/browser/:1 Failed to load resource: the server responded with a status of 403 (Interdit)
> :8080/web?&debug=#id=2&view_type=form&model=cmis.test.model&menu_id=286&action=386:1 Failed to load http://localhost:8082/alfresco/api/-default-/public/cmis/versions/1.1/browser/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://0.0.0.0:8080' is therefore not allowed access. The response had HTTP status code 403.
> 6web.assets_common.js:3028 Server application error {"message":"Odoo Server Error","code":200,"data":{"debug":"Traceback (most recent call last):\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 641, in _handle_exception\n    return super(JsonRequest, self)._handle_exception(exception)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 683, in dispatch\n    result = self._call_function(**self.params)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 333, in _call_function\n    return checked_call(self.db, *args, **kwargs)\n  File \"/home/ikram/odoo/odoo-10/odoo/service/model.py\", line 101, in wrapper\n    return f(dbname, *args, **kwargs)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 326, in checked_call\n    result = self.endpoint(*a, **kw)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 941, in __call__\n    return self.method(*args, **kw)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 506, in response_wrap\n    response = f(*args, **kw)\n  File \"/home/ikram/odoo/odoo-10/odoo/addons/bus/controllers/main.py\", line 35, in poll\n    raise Exception(\"bus.Bus unavailable\")\nException: bus.Bus unavailable\n","exception_type":"internal_error","message":"bus.Bus unavailable","name":"exceptions.Exception","arguments":["bus.Bus unavailable"]}}
> (anonymous) @ web.assets_common.js:3028
> 2localhost:8082/alfresco/api/-default-/public/cmis/versions/1.1/browser/:1 Failed to load resource: the server responded with a status of 403 (Interdit)
> :8080/web?&debug=#id=2&view_type=form&model=cmis.test.model&menu_id=285&action=386:1 Failed to load http://localhost:8082/alfresco/api/-default-/public/cmis/versions/1.1/browser/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://0.0.0.0:8080' is therefore not allowed access. The response had HTTP status code 403.
> 58web.assets_common.js:3028 Server application error {"message":"Odoo Server Error","code":200,"data":{"debug":"Traceback (most recent call last):\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 641, in _handle_exception\n    return super(JsonRequest, self)._handle_exception(exception)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 683, in dispatch\n    result = self._call_function(**self.params)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 333, in _call_function\n    return checked_call(self.db, *args, **kwargs)\n  File \"/home/ikram/odoo/odoo-10/odoo/service/model.py\", line 101, in wrapper\n    return f(dbname, *args, **kwargs)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 326, in checked_call\n    result = self.endpoint(*a, **kw)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 941, in __call__\n    return self.method(*args, **kw)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 506, in response_wrap\n    response = f(*args, **kw)\n  File \"/home/ikram/odoo/odoo-10/odoo/addons/bus/controllers/main.py\", line 35, in poll\n    raise Exception(\"bus.Bus unavailable\")\nException: bus.Bus unavailable\n","exception_type":"internal_error","message":"bus.Bus unavailable","name":"exceptions.Exception","arguments":["bus.Bus unavailable"]}}
> (anonymous) @ web.assets_common.js:3028
> (anonymous) @ web.assets_common.js:547
> fire @ web.assets_common.js:541
> fireWith @ web.assets_common.js:546
> done @ web.assets_common.js:937
> callback @ web.assets_common.js:957
> 48web.assets_common.js:3028 Server application error {"message":"Odoo Server Error","code":200,"data":{"debug":"Traceback (most recent call last):\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 641, in _handle_exception\n    return super(JsonRequest, self)._handle_exception(exception)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 683, in dispatch\n    result = self._call_function(**self.params)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 333, in _call_function\n    return checked_call(self.db, *args, **kwargs)\n  File \"/home/ikram/odoo/odoo-10/odoo/service/model.py\", line 101, in wrapper\n    return f(dbname, *args, **kwargs)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 326, in checked_call\n    result = self.endpoint(*a, **kw)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 941, in __call__\n    return self.method(*args, **kw)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 506, in response_wrap\n    response = f(*args, **kw)\n  File \"/home/ikram/odoo/odoo-10/odoo/addons/bus/controllers/main.py\", line 35, in poll\n    raise Exception(\"bus.Bus unavailable\")\nException: bus.Bus unavailable\n","exception_type":"internal_error","message":"bus.Bus unavailable","name":"exceptions.Exception","arguments":["bus.Bus unavailable"]}}
> (anonymous) @ web.assets_common.js:3028
> 4web.assets_common.js:3028 Server application error {"message":"Odoo Server Error","code":200,"data":{"debug":"Traceback (most recent call last):\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 641, in _handle_exception\n    # If we use jsonp, that's mean we are called from another host\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 683, in dispatch\n    def dispatch(self):\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 333, in _call_function\n    if self._cr:\n  File \"/home/ikram/odoo/odoo-10/odoo/service/model.py\", line 101, in wrapper\n    return f(dbname, *args, **kwargs)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 326, in checked_call\n    args = (request,) + args\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 941, in __call__\n    class_path = name_class[0].split(\".\")\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 506, in response_wrap\n  File \"/home/ikram/odoo/odoo-10/odoo/addons/bus/controllers/main.py\", line 35, in poll\n    raise Exception(\"bus.Bus unavailable\")\nException: bus.Bus unavailable\n","exception_type":"internal_error","message":"bus.Bus unavailable","name":"exceptions.Exception","arguments":["bus.Bus unavailable"]}}
> (anonymous) @ web.assets_common.js:3028
> 83web.assets_common.js:3028 Server application error {"message":"Odoo Server Error","code":200,"data":{"debug":"Traceback (most recent call last):\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 641, in _handle_exception\n    return super(JsonRequest, self)._handle_exception(exception)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 683, in dispatch\n    result = self._call_function(**self.params)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 333, in _call_function\n    return checked_call(self.db, *args, **kwargs)\n  File \"/home/ikram/odoo/odoo-10/odoo/service/model.py\", line 101, in wrapper\n    return f(dbname, *args, **kwargs)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 326, in checked_call\n    result = self.endpoint(*a, **kw)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 941, in __call__\n    return self.method(*args, **kw)\n  File \"/home/ikram/odoo/odoo-10/odoo/http.py\", line 506, in response_wrap\n    response = f(*args, **kw)\n  File \"/home/ikram/odoo/odoo-10/odoo/addons/bus/controllers/main.py\", line 35, in poll\n    raise Exception(\"bus.Bus unavailable\")\nException: bus.Bus unavailable\n","exception_type":"internal_error","message":"bus.Bus unavailable","name":"exceptions.Exception","arguments":["bus.Bus unavailable"]}}
> (anonymous) @ web.assets_common.js:3028

from alfodoo.

lmignon avatar lmignon commented on July 18, 2024

@ikrape your alfresco is not properly configured to support CORS request. see http://alfodoo.org/guides/short_guide.html#enable-cors-in-alfresco-5-x

from alfodoo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.