Choose a profile when installing a quickinstaller product (Plone 4) - plone

I had performance problems when loading MathJax dynamically in my Plone 4 application. Thus, I found the Plone integration at https://github.com/collective/collective.mathjax and, as I noticed it does the same, forked it, which works well; I included a current MathJax 2.3 and changed the profile to use the "local" copy.
Now I wonder whether it is possible to choose between "online"/"remote" behaviour (load everything from rackcdn.com) and the "default" behaviour (use the included copy) by choosing a profile when installing the product in the Plone QuickInstaller Tool.
I changed the configure.zcml like this:
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="collective.mathjax">
<browser:resourceDirectory
name="mathjax"
directory="resources/MathJax" />
<genericsetup:registerProfile
name="default"
title="collective.mathjax: default"
directory="profiles/default"
description="collective.mathjax default profile: Includes MathJax 2.3."
provides="Products.GenericSetup.interfaces.EXTENSION" />
<genericsetup:registerProfile
name="online"
title="collective.mathjax: online"
directory="profiles/online"
description="collective.mathjax online profile: Load MathJax dynamically from rackcdn.com."
provides="Products.GenericSetup.interfaces.EXTENSION" />
</configure>
Unfortunately I can't see the "online" profile in the QuickInstaller, not even after deinstalling the product and changing the version number.
Update: In the console output, I found the following text:
INFO CMFQuickInstallerTool Multiple extension profiles found for product collective.mathjax. Used profile: collective.mathjax:default
Is there some fundamental misunderstanding, or what can I do to let people choose?

Plone Quickinstaller (both ZMI and Plone UI) will only display one profile as "installation" profile. The chosen ones will be the first found (alphabetically speaking).
To manually run a profile, go to the portal_setup tool in ZMI, then go the the "Import" tab and select your wanted profile (the provided order here is a mess... you will probably find a very long combo box). At the end of the page select "Import all steps"

It is actually possible to have multiple "alternative" profiles show up in Quickinstaller - you just need to 'trick' GenericSetup by registering each profile for its own (sub)package.
So the trick is to put the profile definitions inside different configure.zcml files that reside in different packages (directories), and making sure to include the <five:registerPackage package="."/> directive in each configure.zcml file.
While it works, I am not sure how recommendable this trick is: I found it in the dexterity.membrane package, used as an example here:
First, a 'default' profile is registered completely normally in the main configure.zcml of the dexterity.membrane package. Nothing special - but note that it includes the content subpackage:
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
xmlns:i18n="http://namespaces.zope.org/i18n"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="dexterity.membrane">
<!-- Include configuration for dependencies listed in setup.py -->
<includeDependencies package="." />
<!-- Grok the package to initialise schema interfaces and content classes -->
<i18n:registerTranslations directory="locales" />
<include package=".behavior" />
<include package=".content" />
<!-- Register an extension profile to make the product installable -->
<genericsetup:registerProfile
name="default"
title="dexterity.membrane: behaviors"
description="Configuration for the dexterity.membrane behaviors"
directory="profiles/default"
provides="Products.GenericSetup.interfaces.EXTENSION"
/>
<!-- Note that the example profile is registered in the content
directory. It is registered in such a way that both profiles
are visible and can be installed separately. Any upgrade steps
for that profile are also defined there. -->
<genericsetup:upgradeStep
title="Update profile"
description="Dummy step to fix profile registration after rename."
source="1000"
destination="1001"
handler="dexterity.membrane.migration.dummy_step"
profile="dexterity.membrane:default" />
<adapter name="Title" factory=".indexers.Title" />
<!-- -*- extra stuff goes here -*- -->
</configure>
Here's the configure.zcml of the said content subpackage: Nothing special either, except for the (second) registerPackage directive, and the second profile:
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:five="http://namespaces.zope.org/five"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="dexterity.membrane">
<!-- make this show up in the quickinstaller separately -->
<five:registerPackage package="."/>
<genericsetup:registerProfile
name="example"
title="dexterity.membrane: content"
description="Configuration for the dexterity.membrane example content type"
directory="../profiles/example"
provides="Products.GenericSetup.interfaces.EXTENSION"
/>
</configure>

To make an answer from the helpful comments of Ida and Keul:
There is (unfortunately) no such thing as a choice between alternative profiles (which makes the name "profiles" slightly misleading here, IMO).
To switch between profiles, I ended in having distinct branches. The process goes like this:
Go to the product directory and switch to the desired branch, e.g. git checkout <branch name>
Restart Plone (otherwise it wouldn't notice the change, unless there was a new version number meanwhile)
re-install the product;
when all is well, update the buildout.cfg to reflect the change.

Related

DB scripts to launch in WSO2 IS + WSO2 APIM

I have deployed WSO2ISasKM with WSO2APIM and I'm struggling to get the configuration right.
I can see there are a lot of scripts in the ../dbscripts folder. However, since I only share config+governance registry and userdb I created 2 dbs in which I only ran the script wso2is-km-5.7.0\dbscripts\postgresql.sql that created UM_ and REG_ tables. I am keeping the local registry in the WSO2CARBON_DB (H2). Is this correct?
I don't really make any use of scripts about IDENTITY and CONSENT that are shipped with the wso2IS binaries. Where should those scripts be launched?
I'm asking because there are some strange behaviour and errors about content in my logs.
This is how i configured the registry.xml of both IS and APIM:
<currentDBConfig>wso2registry</currentDBConfig>
<readOnly>false</readOnly>
<enableCache>true</enableCache>
<registryRoot>/</registryRoot>
<dbConfig name="wso2registry">
<dataSource>jdbc/WSO2CarbonDB</dataSource>
</dbConfig>
<dbConfig name="sharedregistry">
<dataSource>jdbc/WSO2REG_DB</dataSource>
</dbConfig>
<remoteInstance url="https://fqdn of the IS/APIM:9443/registry">
<id>sharedreg</id>
<cacheId>reg_db_owner#jdbc:postgresql://carbondb.postgresql-wso2.com:5432/wso2_carbon_shared_reg</cacheId>
<dbConfig>sharedregistry</dbConfig>
<readOnly>false</readOnly>
<enableCache>true</enableCache>
<registryRoot>/</registryRoot>
</remoteInstance>
<mount path="/_system/governance" overwrite="true">
<instanceId>sharedreg</instanceId>
<targetPath>/_system/governance</targetPath>
</mount>
<mount path="/_system/config" overwrite="true">
<instanceId>sharedreg</instanceId>
<targetPath>/_system/config</targetPath>
</mount>
This is how datasources got added in master-datasources.xml
<datasource>
<name>WSO2REG_DB</name>
<description>REGDB ON POSTGRES</description>
<jndiConfig>
<name>jdbc/WSO2REG_DB</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:postgresql://carbondb.postgresql-wso2.com:5432/wso2_carbon_shared_reg</url>
<username>wso2</username>
<password>wso2</password>
<defaultAutoCommit>true</defaultAutoCommit>
<driverClassName>org.postgresql.Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
</configuration>
</definition>
</datasource>
The UM_DB entry is identical but it point to another database.
I also noticed that for REG_DB and UM_DB, with Postgresql-11, I have to set the defaultAutocommit must be set to true to avoid error in writing the registry.
Can you also explain what are the purpose of IDENTITY and CONSENT related tables?I read the docs but couldn't understand the practical use of them.
Thanks in advance.
If you're using APIM with IS as KM, you need to share AM_DB as well. The script is inside dbscripts/apimgt/. That script includes both Identity and Consent scripts. So you can ignore Identity and Consent scripts.
See more in: https://docs.wso2.com/display/AM260/Configuring+WSO2+Identity+Server+as+a+Key+Manager

Changing the default instructions in Alfresco 5.1 searchbox

I have successfully created a number of amps to customize Alfresco 5.1. The one change that aludes me, is to develop an amp to change the default text in the searchbox. The text currently is "Search files, people, sites" and I want it to say "Search Reports". I can force the change by modifiying the line in the Aikau jar which contains the "search.instructions=Search files, people, sites" but this will not hold if we upgrade to the newer version of Alfresco.instruction which is different than the search placeholder text. Let me know what version of Aikua you are using.
You can user module deployment approach for this.
Create .xml file within web-extension/site-data/extensions/share-module.xml
<extension>
<modules>
<module>
<id>AAAAA</id>
<version>1.0</version>
<auto-deploy>true</auto-deploy>
<customizations>
<customization>
<targetPackageRoot>org.alfresco.share.header</targetPackageRoot>
<sourcePackageRoot>com.menu</sourcePackageRoot>
</customization>
</customizations>
</module>
</modules>
</extension>
Create .js file within web-extension/site-webscripts/com/menu/share-header.get.js
var searchBox = widgetUtils.findObject(model.jsonModel.widgets, "id", "HEADER_SEARCH");
searchBox.config.placeholder= "search-custom.label";

wix: can not see in add remove program after installing msi

IN wix project, i do not use ARPNOREMOVE property to forbid product from adding the interface to add/remove programs, but i cannot see in add remove programs.
any one who can give me some suggestions? any suggestions i will appreciate.
My Product.wxs like below
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes" />
<Property Id="ARPSYSTEMCOMPONENT" Value="1"/>

custom splashscreen not showing with ionic and phonegap build (3.5.0)

I'm referring to phonegap doc here:
http://docs.build.phonegap.com/en_US/configuring_icons_and_splash.md.html
yet can't have the splashscreen to show after building ( build via phonegap build service, not locally )
relevant ( I suppose ) config.xml lines:
<gap:plugin name="org.apache.cordova.splashscreen" />
<gap:splash src="splash.png" />
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
splash.png is in the root, as is config.xml, is a 480x800 PNG (32-bit color)
I'm building with phonegap 3.5.0 selected; pulling from the git for the ionic project ( so no local 'platforms' dir in the way, since it's in ionic .gitignore.
I also tried the
<gap:splash src="res/screen/android/screen-ldpi-portrait.png" gap:platform="android" gap:qualifier="port-ldpi" />
options to no result ('res/screen... dirs also starting from the root where config resides')
I have made no specific splash show/hide code in the app, is this mandatory ? I just want the splash to show for a fixed bunch of seconds...
My advice is twofold:
First, use PGB 3.6.3. Not only is 3.5 outdated, it also has a security flaw in Android that means apps will be removed from the Past Store.
Second (re: your problem). Go back to basics - follow the PGB docs on splash screens in the simplest way possible.
I don't know what the issue, it looks OK to me, but there are a few preferences you have that I don't use and it works fine for me. I'd expand more but I'm on a mobile. I'll check it out in detail later.

How do I enable Directory Browsing for an virtual web directory using wix?

I want to enable "Directory Browsing" for the for the following virtual web directory using WIX.
<iis:WebVirtualDir Id="LogsVirDir" Alias="Logs" Directory="ESGLOGFILES" />
How do I accomplish this using WIX?
Wouldn't a simpler solution be to use the web.config system.webserver property like :
<directoryBrowse enabled="true"/>
Based on my research Wix currently does not have any capability to enable Directory Browsing using the standard set of actions. The one way I have found to do this is using a combination of Wix Custom Actions and IIS's Appcmd.exe. Note this command will create a web.config file if one does not exist.
<CustomAction Id="EnableDirectoryBrowsing"
Execute="deferred"
ExeCommand='[WindowsFolder]system32\inetsrv\APPCMD.EXE set config "ESG Website/logs" /section:directoryBrowse /enabled:true'
Directory="TARGETDIR"
Return="check"
Impersonate="no"/>
<InstallExecuteSequence>
<Custom Action="EnableDirectoryBrowsing" Before="InstallFinalize">Not Installed</Custom>
</InstallExecuteSequence>
Im using wix v3.8
try adding ConfigurableDirectory in your Feature
ex: <Feature Id='TestName' Title='Test Web' ConfigurableDirectory='INSTALLDIR' Level='1'>
Use the following code
<Control Id="Browse" Type="PushButton" X="304" Y="210" Width="56" Height="17" Text="!(loc.CustomizeDlgBrowse)">
<Publish Event="SelectionBrowse" Value="BrowseDlg">1</Publish>
</Control>
Take the value of this in the variable you want and use it.

Resources