Skip to content

Commit

Permalink
Add script to setup imio.webspellchecker
Browse files Browse the repository at this point in the history
  • Loading branch information
duchenean committed Jun 17, 2024
1 parent c883988 commit b5b7730
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
1 change: 1 addition & 0 deletions dev.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ auto-checkout =
ftw.labels
imio.pm.locales
imio.pm.ws
# imio.webspellchecker
imio.zamqp.core
imio.zamqp.pm
plone.restapi
Expand Down
30 changes: 30 additions & 0 deletions scripts/install_wsc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from imio.helpers.security import setup_app
from imio.helpers.security import setup_logger
from imio.webspellchecker import config as webspellchecker_config
from os import getenv
from plone import api
from Products.PloneMeeting import logger

import logging
import sys
import transaction


setup_logger(level=logging.INFO)
setup_app(app)
with api.env.adopt_user(username="admin"):
logger.info("Installing webspellchecker...")
WSC_JS_BUNDLE_URL = getenv("WSC_JS_BUNDLE_URL")
WSC_SERVICE_URL = getenv("WSC_SERVICE_URL")
if not WSC_JS_BUNDLE_URL or not WSC_SERVICE_URL:
logger.error("Missing webspellchecker environment variables. Aborting installation.")
sys.exit(-1)

portal = api.portal.get()
portal.portal_setup.runImportStepFromProfile(
'profile-Products.PloneMeeting:default',
'PloneMeeting-Install-Imio-Webspellchecker')
webspellchecker_config.set_js_bundle_url(WSC_JS_BUNDLE_URL.decode('utf-8'))
webspellchecker_config.set_service_url(WSC_SERVICE_URL.decode('utf-8'))
transaction.commit()
logger.info("Installed webspellchecker.")
6 changes: 5 additions & 1 deletion scripts/update_all_local_roles.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from plone import api
from imio.helpers.security import setup_app
from imio.helpers.security import setup_logger
from plone import api

import logging
import transaction


setup_logger(level=logging.INFO)
setup_app(app)
with api.env.adopt_user(username="admin"):
tool = api.portal.get_tool("portal_plonemeeting")
tool.update_all_local_roles(redirect=False)
transaction.commit()
1 change: 1 addition & 0 deletions sources.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ imio.pm.locales = git ${remotes:imio}/imio.pm.locales.git pushurl=${remotes:imio
imio.pm.ws = git ${remotes:imio}/imio.pm.ws.git pushurl=${remotes:imio_push}/imio.pm.ws.git
imio.prettylink = git ${remotes:imio}/imio.prettylink.git pushurl=${remotes:imio_push}/imio.prettylink.git
imio.pyutils = git ${remotes:imio}/imio.pyutils.git pushurl=${remotes:imio_push}/imio.pyutils.git
imio.webspellchecker = git ${remotes:imio}/imio.webspellchecker.git pushurl=${remotes:imio_push}/imio.webspellchecker.git
imio.zamqp.core = git ${remotes:imio}/imio.zamqp.core.git pushurl=${remotes:imio_push}/imio.zamqp.core.git
imio.zamqp.pm = git ${remotes:imio}/imio.zamqp.pm.git pushurl=${remotes:imio_push}/imio.zamqp.pm.git

Expand Down

0 comments on commit b5b7730

Please sign in to comment.