-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to setup imio.webspellchecker
- Loading branch information
Showing
4 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters