Is it possible to have both Magnolia Public and Author under 1 instance? If so, how? - magnolia

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.

Related

Magnolia templates not published from Author to Public

I installed two instances of magnolia and converted one of them to public to receive publishing from the first instance.
I followed the hello-magnolia tutorial (from this link on the official site), created the template on the author instances and the page was created and previewd successfully. However, when it is published it appears on the public instance as unknown-template and generates an error. I copied the hello-magnolia module from the modules directory on the author instance to the public instance and the problem was solved.
When I followed the same tutorial but on a downloaded bundle, I did it not copy the template manually and it was published successfully.
Why do I have to copy the templates manually from author to public now and how I can have the same behaviour like the downloaded bundle?
Since you don't link the tutorial you are referring to, one can only guess.
Quoting from one I've found "Magnolia continuously scans the file system folder defined by the magnolia.resources.dir property." Most likely reason for both author and public instance seeing templates instantly in case of tutorial is that both instances have the above mentioned property set to point to same directory.
In case of separate instances in your latter installation, this is most likely not the case. To change it (assuming both instances are running on same VM or share a network drive) you need to point them both to the same directory. The property magnolia.resource.dir can be set in magnolia.properties file located in the webapp representing each instance under WEB-INF/config/default/magnolia.properties.
That said, it is not necessarily best practice to point both instances to point to same version of files. If you do so, you might be limiting yourself in some scenarios. Say you are preparing some campaign or new version of the web and want to have new templates already available in author for editors while on public you want to maintain current view ... if both point to same folder you can't do so. OTOH maintenance is simpler and there's no errors caused by forgetting to update templates in each of the instances ... just saying so you know how the choices you make affect what you might be able to do in the future.

How to modify Alfresco's out-of-the-box audit configuration

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

Custom Workflow _ Alfresco Community

I need to create a new Custom Workflow in Alfresco.
I followed this tutorial : Creating Custom Workflow in Alfresco
But I couldn't find the two files in my Alfresco:
share-workflow-form-config.xml that must be in
Alfresco\tomcat\webapps\share\WEB-INF\classes\alfresco
bootstrap-context.xml that must be in
Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco
I'm using Alfresco Community Edition 5.1 under Windows 8
Can I add those two files to My Alfresco ? If so, where can I find them ?
You should not be modifying the two files that you have listed. It goes against best practices and they are no longer exposed in exploded webapps (you can find them inside of their respective jars).
For tutorial purposes you should use the shared classpath folder. If you're using the all-in-one installer, then that location is: $CATALINA_HOME/shared/classes/alfresco/
As an example: C:/alfresco-one/tomcat/shared/classes/alfresco
In a simplistic approach, you should add your Share form config for workflows to the share-config-custom.xml file located in the shared web-extension location ($CATALINA_HOME/shared/classes/alfresco/web-extension/share-config-custom.xml)
Add your bootstrap config to a custom context file in the shared extension location:
($CATALINA_HOME/shared/classes/alfresco/extension/foobar-bootstrap-context.xml)

custom javascript root node not accessable from share in alfresco

I created custom javascript root node (storeService) in repository and want to access it from share?
The line I haved added in share java script controller
model.storeName = storeService.getStoreInfo(storeName);
but throws referential error storeService.
You cannot create a custom root-scoped JavaScript object in the repository tier (the Alfresco WAR) and then access it from the Share tier (the Share WAR). Those are two completely different contexts.
One way to work around this would be to write a web script on the repository tier that leverages your custom root-scoped object. You can then invoke that web script from the share tier.

Windows symbolic link ASP.NET app repository

We are hosting huge app for our cutomers. There are diffrent configuration and contents (images, user files). But the core code, directories structure, databse scheme is this same for every client.
I'm looking for a way to create one core code repository, so all clientes will use it. We do updates often, so this will make our live easyer.
The idea is to create the repo and In clients directories create just symbolic links to that repo direcories: bin, App_Resources, Css, SystemImages etc.
Is this a good idea? Will ASP.NET MVC app handle this correctly, or I've to add some code for it handle the 'virtual direcotories'?
I would suggest that you take a look Single-tenant and Multi-tenant applications even if you say that your code base is the same for every one.
Here is a nice Multi-Tenancy ASP.NET example
I would also suggest that you check http://appHarbour.com as you can easily push changes from your master repository to appHarbour using Git or Mercurial.
Regarding your exact question, I also keep static files in a custom scheme under Amazon S3, so each client can upload there own files, plus the ones I have and all is based on a single location that does not put more resources just to delivery static files.
You can see my live web application using this technique checking the View Source.

Resources