I am trying to modify the PathMappings of the "CMISChangeLog" audit application bundled out-of-the-box in Alfresco 5.
I have found these PathMappings in alfresco-audit-cmis.xml which can be found in Alfresco's source code, so I modified this XML file and put it into tomcat/shared/classes/alfresco/extension/audit/alfresco-audit-cmis.xml (thinking that would override the out-of-the-box application) before restarting Alfresco. Problem:
ERROR [audit.model.AuditModelRegistryImpl] Failed to load audit model: file:/home/nico/alfresco/tomcat/shared/classes/alfresco/extension/audit/alfresco-audit-cmis.xml
org.alfresco.repo.audit.model.AuditModelException: 00120000 Audit application key 'CMISChangeLog' is used by: AuditApplication[ name=CMISChangeLog, id=3, disabledPathsId=381]
at org.alfresco.repo.audit.model.AuditModelRegistryImpl$AuditModelRegistryState.cacheAuditElements(AuditModelRegistryImpl.java:646)
How to override this out-of-the-box audit application?
Grepping through my server I found out that the default audit application's XML file is stored at alf_data/contentstore/2017/12/22/18/23/82dfdccd-6ab9-4091-8b7c-d37d4bcf1627.bin but I haven't found it in the Node Browser:
Note: I don't want to create a new audit application. I must modify the existing one (because I want Alfresco's CMIS ChangeLog to take into account more events).
The XML file is actually in alfresco-repository-5.2.g.jar, which itself can be found in Alfresco's WAR file.
So, if you have an already running Alfresco server, here is the procedure:
Stop Alfresco
mkdir -p /tmp/unjar
cd /tmp/unjar
unzip $ALFRESCO/tomcat/webapps/alfresco/WEB-INF/lib/alfresco-repository-5.2.g.jar (adapt for another version number if necessary)
Do the modifications you want inside the extracted file alfresco/audit/alfresco-audit-cmis.xml
zip -r ../alfresco-repository-5.2.g-custom.jar *
cp ../alfresco-repository-5.2.g-custom.jar ALFRESCO/tomcat/webapps/alfresco/WEB-INF/lib/
Restart Alfresco
Related
I'm trying to modify an application that was deployed with JNLP onto my PC. However, when I try to replace the existing application's JAR with my new jar, it fails to lookup javax.jnlp.SingleInstanceService and javax.jnlp.BasicService.
I've already signed the main JAR file with my own key pair (not the original one), but it still does not work.
The following two lines throw UnavailableServiceException (uninitialised).
BasicService lookup = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService");
SingleInstanceService singleInstanceService = (SingleInstanceService)ServiceManager.lookup("javax.jnlp.SingleInstanceService");
On the unmodified JAR (which is run with java.exe -cp SomeJar.jar), no exceptions are thrown. I am certain that this is a signature issue, as even a resigned file with no other modifications still has this issue.
Is there any way I can replicate this on my modified JAR (perhaps by adding it's keystore certificate to some file)?
The problem is not in jar signing. To use JNLP API you should start your jar via jnlp file.
Syntax for running jnlp file is: javaws your_jnlp_file
Your jar should be registered in resources container inside your jnlp file, and your jar should be deployed as part of your web aplication.
You are starting your jar as standard jar.
The reason why the old jar did not result in error, most possibly because it had simply handled UnavailableServiceException.
Is it possible to have both Magnolia Public and Author under 1 instance in Jelastic? If so, how?
According to your request, I'm glad to inform you that you can easily deploy Magnolia Public and Magnolia Author under 1 instance.
As a first step, you should deploy the primary Magnolia application, you can find out that it's can be done in-one-click with help of the appropriate Magnolia CMS widget at our Marketplace
in the Portal/CMS section.
You can manage your applications and files there using Jelastic dashboard, FTP, WebDav or SSH access. In your case there is necessary to establish the SSH Access to the Tomcat instance
and perform the following:
cd /opt/tomcat/webapps/ && cp ROOT.war ROOT2.war
After the copying was finished restart the Tomcat instance.
Having reached this goal, you will obtain two separate Magnolia CMS applications.
Installed files are located at webapps directory which after the mentioned above actions will have two contexts
According to the official Magnolia documentation, it will be necessary to provide the changes in corresponding configuration files
also, it should be mentioned that the copied Magnolia application will have the same settings as an original context ROOT
so before the performing the required changes you should create another DB at your MySQL instance and then specify it for using of the second/copied application.
As a result, you will have two independent Magnolia application one of which could be set Public mode and another one to Author.
How could I recover deleted folder in plone 4.1?
If you haven't yet packed away the transaction that deleted the folder, you can recover the folder.
First, use the "Undo" tab on the parent folder, in the ZMI. It could that doesn't work, too many other things on the system have changed (usually the catalog), for all the changes to be rolled back effectively.
Next step is a little more cumbersome and involved. What you then have to do is open the Object Database (ZODB) with a wrapper that will show you the state of the database at a given point in history. Doing this requires some manual editing of your Zope server configuration. I've written up the steps in a blog post but those steps are a little outdated.
In a modern Plone buildout, you need to add the zc.beforestorage egg to your buildout, and you need to switch the enable-product-installation setting of Zope to False; using the beforestorage wrapper makes your database read-only and the product installation code would try to commit to database, resulting in a failure to start:
[instance]
eggs +=
zc.beforestorage
zope-conf-additional +=
enable-product-installation False
After rebuilding the buildout, you need to open the zope.conf file associated with your instance. If you normally start your server with bin/instance, then that file is located in parts/instance/etc/zope.conf; the script in bin/ used matches the part name (instance in this example).
Locate the part where it defines the ZODB main database:
<zodb_db main>
# Main database
cache-size 10000
# Blob-enabled FileStorage database
<blobstorage>
blob-dir /path/to/var/blobstorage
<filestorage>
path /path/to/var/filestorage/Data.fs
</filestorage>
</blobstorage>
mount-point /
</zodb_db>
You need to add the beforestorage wrapper into that declaration:
<zodb_db main>
# Main database
cache-size 10000
%import zc.beforestorage
<before>
before 2012-12-01T12:00:00
# Blob-enabled FileStorage database
<blobstorage>
blob-dir /path/to/var/blobstorage
<filestorage>
path /path/to/var/filestorage/Data.fs
</filestorage>
</blobstorage>
</before>
mount-point /
</zodb_db>
Note the before <iso timestamp> line in there; when you start your instance, the site will be presented as it was at that timestamp. Choose one close to when you deleted the folder. Now you can export it (again using the ZMI) to a .zexp file. Undo the changes to your zope.conf file, restart, and import the recovered folder.
Yes, it's possible using the Zope Management Interface's "Undo" tab on the folder in question. This will roll back the database transaction in which you deleted the folder, and works most effectively if you have just deleted the folder. Additional information is at: https://plone.org/documentation/kb/using-the-zope-undo-system-to-roll-back
We're using TeamCity to automate MSBuild to use WebDeploy to push our application to our various servers.
For the most part, we've got this working, and great. One snag, though: we've got a folder that holds uploads that we don't want to have deleted during the publication.
How do I tell WebDeploy, "I know that folder's not in the compiled application. Ignore it. Just leave it alone."
If you're using the dirPath, filePath, or contentPath providers, you can specify the DoNotDelete rule to block deletions of files on the destination computer that do not exist on the source. The syntax to add to the command line would be -enableRule:DoNotDelete. For more information, see the provider articles mentioned and Web Deploy Rules.
First of all sorry if the question is not very clear.
I am learning nHibernate from the summerofnhibernate.com, in the first chapter when I run a test project, I get the following error: Test method TestProject1.NHibernateDataProviderTestTest.CanGetCustomerByIdTest threw exception: NHibernate.HibernateException: problem parsing configuration : System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies;PrivateAssemblies\hibernate.cfg.xml'.
I have googled the problem, and the search says that the VS 2008 path is wrong(buggy), to place hibernate.cfg.xml in test project and adding the attribute: [TestMethod(), DeploymentItem("hibernate.cfg.xml")]
After having done this I still get the same problem.
But when I use Visual Studio 2010 I get the following error:
Test method TestProject1.NHibernateDataProviderTestTest.CanGetCustomerByIdTest threw exception:
System.NullReferenceException: Object reference not set to an instance of an object.
looks like 2 different problems.
For the first place nhibernate.cfg.xml in the Project and give the path to new Configuration("Path to hibernate.cfg.xml") somewhere in the testsetup.
The Second looks like the getmethod returns null because it cant finde the Customer with given id in the database. If you use SQLite inMemory a typical captcha is, that each new Connection points to a different Database -> Open Sessions with sf.OpenSession(theOneConnection) or Session.Clear() instead of creating a new one.
Hope it helps
Basically , (depends on your question : How to Configure Test Deployment with the file LocalTestRun.testrunconfig?)
Here is the way that you can follow:
To select files or folders to deploy, in run configuration
In Solution Explorer, under Solution Items, double-click the run configuration file that you want to edit.
A dialog box that has a name such as .testrunconfig appears.
Click Deployment.
Under Additional files or directories to deploy, specify additional files or folders to be copied.
To do this,
click Add file to select files; this opens the Add Deployment Files dialog box.
You can also click Add Directory to select folders by using the Add Deployment Directory dialog box.
In the .testrunconfig dialog box, click Save and then click OK.
These deployment items will be copied to the deployment folder whenever this run configuration file is active.
Hope this will help.