I have a Plone site with a traditional product BaseProduct (versioned directly in the Products filesystem directory of the Zope installation); the rest of the setup is buildout-based.
For a fork of the project, I need another product AdditionalProduct, which I made the same way (I know it's not the current state-of-the art method; but that's how it worked before for me ...).
Now I was able to install AdditionalProduct using the quickinstaller (for now it contains a single skin directory with a single template only, but this will change, of course).
Sadly, this ceased to work; the product is not shown in the quickinstaller anymore. There is no visible error; I was able to pdb.set_trace() it during instance startup, and there is no error in the error.log either.
The profiles.zcml file looks like this:
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
i18n_domain="BaseProduct">
<include package="Products.GenericSetup" file="meta.zcml" />
<genericsetup:registerProfile
name="default"
title="AdditionalProduct"
directory="profiles/default"
description="Extension profile for AdditionalProduct."
provides="Products.GenericSetup.interfaces.EXTENSION"
/>
</configure>
(Copied and changed from an earlier AdditionalProduct of another fork; I don't really understand that "meta.zcml" part.)
How can I debug this?
I'd be willing to "eggify" my product (AdditionalProduct first, since it has the problem; perhaps BaseProduct later as well), but I'm not sure about the amount of work, and a How-To would be useful ...
Your product should have a configure.zcml file that includes your profiles.zcml with the following directive:
<include file="profiles.zcml" />
Is it the case ?
You can debug this by ruling out the following:
The ZCML is not loaded (introduce a syntax error in profiles.zcml and
restart Plone to ensure profiles.zcml is loaded.)
You don't have the 'z3c.autoinclude.plugin': 'target = plone' entry point (not applicable as you are not using a Python package)
Your product is not loaded by Zope2 because it's not in the products folder, or has some related issue e.g. missing __init__.py.
Also you may not need the following, as it should already be included by Plone before your products is loaded:
<include package="Products.GenericSetup" file="meta.zcml" />
(And file='meta.zcml' means "load meta.zcml instead of the default file name i.e. configure.zcml")
Lastly, I'd recommend creating a Python package (AKA "eggify"). See the following for an overview:
http://blog.aclark.net/2015/06/01/plone-add-on-development-for-command-line-savvy-developers/
Related
I'm new to alfresco and using Alfresco 6. I am trying to override colleagues.get.html.ftl file so I can change the display of Site members dashlet. Original ftl has the following code snippet:
<div class="person">
<#-- LIST - ITEM - PERSON -->
<#markup id="list-item-person">
<h3>${m.authority.firstName?html} <#if m.authority.lastName??>${m.authority.lastName?html}</#if>
</h3>
</#markup>
<#-- LIST - ITEM - ROLE -->
<#markup id="list-item-role">
<div>${msg("role." + m.role)}</div>
</#markup>
</div>
Instead of firstName and lastName I just want to display the userName.
Here's what I have done.
I have copied the original code to a file named colleagues.get.html.ftl
I have modified the html.
I was assuming this would override the original file. However my changes are not getting reflected when I restart server. How to correct this?
First, I'll assume you are using the Docker- and Maven-based Alfresco SDK 4.0.0. It makes doing this kind of customization much more productive.
The goal is to customize an out-of-the-box web script template and keep it in your own path to avoid problems when upgrading later. To do that, copy the colleagues.get.html.ftl into your project, in a path that you choose. For example, in my project I'll use alfresco-share-example-share/src/main/resources/alfresco/web-extension/site-webscripts/com/metaversant/alfresco/dashlets/colleagues.get.html.ftl.
Next, you need to tell Share that you are overriding the template and where to find yours. You do that by creating a Share extension file. I'll name mine colleague-example.xml and place it in alfresco-share-example-share/src/main/resources/alfresco/web-extension/site-data/extensions/colleague-example.xml with the following content:
<extension>
<modules>
<module>
<id>Colleague Example</id>
<version>1.0</version>
<auto-deploy>true</auto-deploy>
<customizations>
<customization>
<targetPackageRoot>org.alfresco.components.dashlets</targetPackageRoot>
<sourcePackageRoot>com.metaversant.alfresco.dashlets</sourcePackageRoot>
</customization>
</customizations>
</module>
</modules>
</extension>
Finally, edit your version of the template. We're going to tell Alfresco to replace the #markup with an id of "html" with ours. So change:
<#markup id="html">
to:
<#markup id="html" target="html" action="replace" scope="global">
Next, you want to replace first name and last name with just the username, so change:
<h3>${m.authority.firstName?html} <#if m.authority.lastName??>${m.authority.lastName?html}</#if></h3>
to:
<h3>${m.authority.userName?html}</h3>
Now run the project with ./run.sh build_start. Your Docker images will fire up and you'll see that the Site Members dashlet uses username instead of first name and last name.
If you need to tweak it, make a change, then run ./run.sh reload_share to build and restart just the Share container.
When you are ready to deploy, run mvn install to create a Share AMP you can deploy on your server.
I'd like to install liip/imagine-bundle in my symfony 2 project. But in order to make barcodes, I installed previously MopaBarcodeBundle.
MopaBarcodeBundle requires "avalanche123/imagine-bundle" which requires imagine/imagine: v0.4.1
And
LiipImagineBundle requires imagine/imagine: ~0.5,<0.7
Obviously composer detects the conflict, as he cannot unistall v0.4.1, and that version is not enough for LiipImagine.
I'd like to know how I could bypass this. Create sorts of aliases in composer and keep the two versions on my project ? I'm not a pro in version management, so I guess this is not possible.
Thank you very much for any help.
Ok, after some code inspection i figured out a way around. MopaBarcodeBundle doesn't really requires avalanche123/imagine-bundle, but it uses it in the service declaration. (To make the link with Imagine classes).
So I changed the service.xml file containing the BarcodeService declaration.
<parameter key="imagine.gd.class">Imagine\Gd\Imagine</parameter>
<service id="imagine" alias="imagine.gd" />
<service id="imagine.gd" class="%imagine.gd.class%" />
I guess thoses lines could be factorised, but i chose to keep it as it was done in avalanche123.
Also a constant from avalanche was used in 5th argument, I changed it to :
<argument>%kernel.root_dir%../web</argument>
Finally I removed avalanche, and then install a newer version of imagine/imagine
I tried every solution i found in the internet.
Im using flex 4.5, This is what im doing:
created directory locale/en_US in my src directory
add resources.properties file to that directory with some mappings.
add -locale en_US -source-path=./locale/{locale} -allow-source-path-overlap=true to the compile args.
checked in the framework that the en_US locale directory appear.
add metadata:
<fx:Metadata>
[ResourceBundle("resources")]
</fx:Metadata>
starting the app gives me the exception:
Error: Could not find compiled resource bundle 'resources' for locale 'en_US'.
This is some of the main solutions i tried:
uncheck "Remove unused RSLs" from the build path.
add the directory as a source path.
using the argument -include-resource-bundles and give my directory here (with using the argument -resource-bundle-list to get all bundles).
Any idea what else can i do?
Here is my structure for a mobile app (Android and iOS):
In src/locale I have 3 subdirs: de_DE, en_US, ru_RU
And in compiler options: -locale=ru_RU,en_US,de_DE -source-path=locale/{locale}
For another mobile app I have:
In src/locale 4 subdirs: en_US, hr_HR, sr_RS, sl_SI.
I had to add the latter 3 dirs with copylocale command.
And in compiler options: -locale hr_HR sr_RS sl_SI en_US -allow-source-path-overlap=true
Both apps work well for me with the latest Apache Flex SDK.
Here is the contents of a src/locale/hr_HR/recources.properties file:
# resources.properties file for locale hr_HR
navbar.tables=Stolovi za igranje:
navbar.all=Svi
navbar.vacant_long=Slobodni
navbar.vacant_short=Slb.
navbar.full_long=Su puni
navbar.full_short=Su puni
comments.good_long=dobri
comments.good_short=Dbr.
comments.bad_long=loši
comments.bad_short=loši
comments.without_long=neutralni
comments.without_short=ntr.
help.title=Pomoć
OK i found a solution here:
http://www.nbilyk.com/flex-localization-example
im really not sure why it should be that difficult.
anyway, if someone ever need a help with that. after you successfully compile the file using ant (like described in the link), if you want to load it dynamcally like i needed just use (for example):
resourceManager.localeChain = ["en_US", "es_ES"];
resourceManager.loadResourceModule("Resources_en_US.swf");
resourceManager.loadResourceModule("Resources_es_ES.swf");
worked well for me, no need to add anything to the compiler args for that solution.
Try using the fully qualified directory path name. If you're using ant you can use ${basedir}/src/locale/{locale}
With OpenCms 7.5.3 fresh install:
I create an index.htm page, then export it via webdav to disk. It
creates index.html.xml and __properties/index.html.xml.properties.
Thats ok.
Delete index.html from OpenCms and publish.
Try to import previously exported files via webdav and...
Error 409 conflict when importing __properties/index.html.xml
I tried with 3 different webdav clients, including the Eclipse plugin for webdav.
Also tried with OpenCms 7.5.4 and 8.5.0
Any ideas? Thanks.
It seems to be a known problem by Alkacon (OpenCms developer):
Here is a possible cause:
https://github.com/alkacon/opencms-core/issues/73
("pbeltran" is me there.)
If it helps we did the following on OpenCms 8.5 in order to avoid the error, but sacrificing properties files :(
Just edit WEB-INF/config/opencms-importexport.xml and replace with this:
<repository name="standard" class="org.opencms.repository.CmsRepository">
<params>
<param name="wrapper">org.opencms.file.wrapper.CmsResourceExtensionWrapperJsp</param>
<param name="wrapper">org.opencms.file.wrapper.CmsResourceExtensionWrapperXmlContent</param>
<param name="wrapper">org.opencms.file.wrapper.CmsResourceExtensionWrapperXmlPage</param>
<param name="wrapper">org.opencms.file.wrapper.CmsResourceWrapperSystemFolder</param>
<!--param name="wrapper">org.opencms.file.wrapper.CmsResourceWrapperPropertyFile</param-->
</params>
<filter type="include">
<regex>/</regex>
<!--regex>/__properties/.*</regex-->
<regex>/sites/.*</regex>
<regex>/system/</regex>
<!--regex>/system/__properties/.*</regex-->
<regex>/system/galleries/.*</regex>
<regex>/system/modules/.*</regex>
<!--regex>/system/workplace/.*</regex-->
</filter>
</repository>
Afer that restart your server.
We do regular exports from OpenCms of the modules to keep the whole package (files and properties) in order to keep the solution under control version (SVN). You can create a module with a resource pointing to sites/default to do that. But it's critical to select root site before doing any import/export of that module (if you dont you can break your ocms installation).
Since some months, I'm using the Linux FUSE driver (gentoo's davfs 1.4.7) to mount OpenCms resources. I was quite irritated with the lot of LOG CmsVfsResourceNotFoundException errors, so I ended up removing the __properties dirs from the exported Repository.
If you don't need these __properties files, I'll recommend you to ignore that error and remove the files from the repository as per the instructions in the link.
The corresponding fstab entry:
# WebDAV (opencms)
# http://myserver:8080/opencms/webdav /home/alberto/mnt/myserver-opencms-dav davfs rw,user,noauto 0 0
I have never had Eclipse with webdav up and running, but I successfully use OpenCms 7.5 and 8 daily with webdav:// and webdavs:// from KDE's Kate editor. Maybe give it a try.
In case you want to try, here the URL you need to use to browse the VFS:
webdav(s)://server(:port)/webdav
I am using the following MSDeploy command to pull content and settings from a production server to a staging server nightly.
msdeploy -verb:sync -source:webServer,wmsvc=xx.xx.xx.xx,username=xxxxx,password=xxxxxx,authType=basic -allowUntrusted=true -dest:webServer
As documented here the "webServer" provider uses several other providers. Is there any way to exclude the "machineConfig32" and "machineConfig64" linked providers from being executed?
Thanks.
Updated:
Using a manifest works:
<sitemanifest>
<appHostConfig path="siteNameHere" />
<appHostSchema />
<contentPath path="siteNameHere" />
<rootWebConfig32 />
<rootWebConfig64 />
</sitemanifest>
with MSDeploy command:
msdeploy" -verb:sync -source:manifest=d:\msdeploy\deploymanifest.xml,wmsvc=xx.xx.xx.xx,username=xxxxxx,password=xxxxxx,authType=basic -allowUntrusted=true -dest:manifest=d:\msdeploy\deploymanifest.xml
You can just skip those objects from the sync operation all together by adding the following to your command line: -skip:objectName=machineconfig32 -skip:objectName=machineConfig64
The linked extensions you can exclude are covered here and here:
I don't see yours listed there, but it may be worth a try. Sometimes this doco is out of date.
That said, you may want to try to "build up" less inclusive providers using manifests rather than "tearing down" an all-inclusive one. Try the following link for the info.. (package manifests)
Then you can have a package command like: (my IIS6 standard package command, note this won't work exactly as it's IIS6, just serving up an example)
-verb:sync -source:manifest=$manifestFile -dest:package=$appName.zip,encryptPassword=MyPassword -enableLink:AppPoolExtension -disableLink:CertificateExtension -disableLink:ContentExtension -declareParamFile:$parametersFile"
and deploy:
-verb:sync -source:package=$appname.zip,encryptPassword=MyPassword -dest:auto -setParamFile=$appname_$computernamesetParameters.xml
In the manifest I then have the site, the content directory, a registry location I need, and even com components and the like.
As far as I know - there is no direct way to exclude linked providers. However - you can sync individual providers by getting the dependency list.