Skip to content

Commit

Permalink
[MIG] cmis_web_proxy_alf - Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoMaxime committed Jun 12, 2024
1 parent 82a4e09 commit 00d68e0
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 83 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ exclude: |
# NOT INSTALLABLE ADDONS
^cmis_web_bus/|
^cmis_web_proxy/|
^cmis_web_proxy_alf/|
^cmis_web_report_write/|
^cmis_web_report_write_alf/|
# END NOT INSTALLABLE ADDONS
Expand Down
2 changes: 1 addition & 1 deletion cmis_web_proxy/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ Maintainer
:alt: ACSONE SA/NV
:target: http://www.acsone.eu

This module is maintained by ACSONE SA/NV.
This module is maintained by ACSONE SA/NV.
2 changes: 1 addition & 1 deletion cmis_web_proxy_alf/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ Maintainer
:alt: ACSONE SA/NV
:target: http://www.acsone.eu

This module is maintained by ACSONE SA/NV.
This module is maintained by ACSONE SA/NV.
12 changes: 9 additions & 3 deletions cmis_web_proxy_alf/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@
{
"name": "Alfodoo CMIS Web Proxy for Alfresco",
"category": "Document Management",
"version": "14.0.1.0.1",
"version": "16.0.1.0.1",
"license": "AGPL-3",
"author": "ACSONE SA/NV",
"website": "https://alfodoo.org",
"depends": ["cmis_web_proxy"],
"data": ["views/cmis_backend.xml", "views/cmis_web_proxy_alf.xml"],
"data": ["views/cmis_backend.xml"],
"demo": [],
"pre_init_hook": "pre_init_hook",
"images": ["static/description/main_icon.png"],
"installable": False,
"assets": {
"web.assets_backend": [
"/cmis_web_proxy_alf/static/src/cmis_folder/cmis_folder.js",
"/cmis_web_proxy_alf/static/src/cmis_object_wrapper_service.js",
],
},
"installable": True,
}
2 changes: 0 additions & 2 deletions cmis_web_proxy_alf/controllers/alfresco.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from odoo.http import request

from odoo.addons.cmis_web_proxy.controllers import cmis
from odoo.addons.web.controllers import main

ALFRESCO_API_PROXY_PATH = "/alfresco/s/api"

Expand Down Expand Up @@ -36,7 +35,6 @@ def _check_alfresco_access(self, proxy_info, params):
csrf=False,
methods=["GET"],
)
@main.serialize_exception
def get_thumnails(self, backend_id, cmis_name, **kwargs):
"""Call at the root of the CMIS repository. These calls are for
requesting the global services provided by the CMIS Container
Expand Down
21 changes: 21 additions & 0 deletions cmis_web_proxy_alf/static/src/cmis_folder/cmis_folder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/** @odoo-module **/

/* ---------------------------------------------------------
+ * Odoo cmis_web
+ * Authors Laurent Mignon 2016, Maxime Franco 2023 Acsone SA/NV
+ * License in __openerp__.py at root level of the module
+ *---------------------------------------------------------
+*/

import {CmisFolderField} from "@cmis_web/cmis_folder/cmis_folder";
import {patch} from "@web/core/utils/patch";

patch(CmisFolderField.prototype, "open_with_proxy_alf", {
getCmisObjectWrapperParams() {
const params = this._super(...arguments);
params.alfrescoApiLocation = this.backend.alfresco_api_location;
return params;
},
});

CmisFolderField.props.backend[0].shape.alfresco_api_location = String;
38 changes: 38 additions & 0 deletions cmis_web_proxy_alf/static/src/cmis_object_wrapper_service.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/** @odoo-module **/

/* ---------------------------------------------------------
+ * Odoo cmis_web
+ * Authors Laurent Mignon 2016, Maxime Franco 2023 Acsone SA/NV
+ * License in __openerp__.py at root level of the module
+ *---------------------------------------------------------
+*/

import {CmisObjectWrapper} from "@cmis_web/cmis_object_wrapper_service";
import {patch} from "@web/core/utils/patch";

patch(CmisObjectWrapper.prototype, "alfresco_proxy_alf_url", {
setup(cmisObject, cmisSession, params) {
this._super(...arguments);
this.alfrescoApiLocation = params.alfrescoApiLocation;
},
getPreviewUrl() {
var _url = this._super(...arguments);
if (_url) {
return _url;
}
var params = {
c: "force",
lastModified: "pdf%" + new Date().getUTCMilliseconds(),
token: this.token,
objectId: this.objectId,
versionSeriesId: this.versionSeriesId,
};
return (
this.alfrescoApiLocation +
"/content/thumbnails/pdf/" +
this.name +
"?" +
$.param(params)
);
},
});
58 changes: 0 additions & 58 deletions cmis_web_proxy_alf/static/src/js/form_widgets.js

This file was deleted.

17 changes: 0 additions & 17 deletions cmis_web_proxy_alf/views/cmis_web_proxy_alf.xml

This file was deleted.

1 change: 1 addition & 0 deletions setup/cmis_web_proxy_alf/odoo/addons/cmis_web_proxy_alf
6 changes: 6 additions & 0 deletions setup/cmis_web_proxy_alf/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 00d68e0

Please sign in to comment.