Changing default namespace - screwturn

We are using ScrewTurn Wiki for training purposes for our LMS.
Our LMS provider is updating the software om version x to y so we need to update the training materials in wiki to match a new version.
I thought that the easiest way to do it is:
1. create a new namespace v10
2. change the new namespace to serve as default (root)
I can't find a way to select or change a default namespace for wiki using admin pages. Is it even possible?
If it needs to be done programmatically, how can it be done?
Thank you

Unfortunately that's not possible via configuration. You can rename namespaces, but root is built-in and has no name.
You could, however, use simple redirection tags to redirect from the old to the new namespace.

Related

Is it possible to add an already existing CRD into a custom Kubernetes operator using Go?

I'm currently working on my own custom operator that deploys a fully functional Wordpress. I'm required to implement SSL. Now this is where I'm stuck, I'm not really sure how to implement this using Go.
Is there a way of adding already existing CRDs, for example cert-manage, into my operator and then create a Kubernetes resource type out of these, using my custom Operator?
Yes, every Go controller also has clients generated. See e.g. client-go cert-manager.
If you import the client-go for cert-manager, you can use it to e.g. create resources or watch for changes.

Can I run code at Alfresco startup?

I have an Alfresco module that I would like to have do some cleanup when a new version of it is installed.
In the current situation, an older version of the module created a folder node with custom properties at the root of the repository. We've since decided to have multiple such nodes, and none of them at that location. I'd like to put into the next version of the module code that would run at Alfresco startup, check for the existence of the old node, copy its properties into the appropriate new nodes, and delete the old node.
Is such a thing possible? I've looked at the Bootstrap configuration file, but that appears to only allow one to add things to the repository, not modify or delete them.
My suggestion is that you write a patch. That is a class that implements
org.alfresco.repo.admin.patch.AbstractPatch
Then you can do pretty much anything you want on bootstrap (except executing searches against solr since it wont be available).
Add some spring configuration, take a look at the file patch-services-context.xml for inspiration.
Yes you can do that, probably you missed the correct place in the documentation about that:
If you open Import Strategy you'll find a section Per BootstrapView, you should be using something like REPLACE_EXISTING or UPDATE_EXISTING for your ACP packaged content (if you're using ACPs as your bootstrap importing strategy).
Here is a more detailed description of the UUID Bindings values.
Hope that helps.
You can use patches.
When alfresco server starts it applies patches and executes database updates etc.
Definition :
A patch is a piece of Java code that executes once when Alfresco
Content Services starts. Custom patches can be implemented.
Documentation Link

Django CMS search engine, few questions

It's tough to find good documentation on this. I am trying to build a simple search engine for a very small Django CMS site built with CMS version 2.4. I have found out the best way is with Haystack + django-cms-search, which then tells me that package is deprecated and to use aldryn-search instead, the documentation is lacking big time.
From what I can gather, I need to create a search_indexes.py but where does this go? I thought this was app specific? If I am just using it to index Page model from the CMS, how do I go about integrating that?
For cms versions < 3.0 then django-cms-search would be your solution, once you switch to >= 3.x then aldryn-search is the way to go.
The reason for this is that aldryn-search is basically a fork/refactor of django-cms-search targeting haystack 2.x and cms 3.x
I'm considering adding backwards compatibility for aldryn-search to work on cms 2.4 but to get you up and running, here's what you can do.
Install django-cms-search and add haystack and cms_search to your INSTALLED_APPS setting.
This should allow you to start indexing pages already, if not please post a traceback :).
Once you are able to index pages, now it's up to you if you want to manage the search page through the cms using an apphook or a fixed url.
Usually when working with search, one needs to tweak some things and add search specific templates, for this I highly recommend creating a search app in your project, add a models.py and then add this app to your INSTALLED_APPS.
Now back to the search page, if you choose to use an apphook, then in your search app, create a cms_app.py file and add the following:
from cms_search.cms_app import HaystackSearchApphook
apphook_pool.register(HaystackSearchApphook)
this registers the packaged apphook from django-cms-search with the cms (this used to happen by default, but not anymore).
Otherwise, if you chose to have a fixed url not managed by the cms, you can simply add a urls.py in your search app with the following:
from django.conf.urls import *
from haystack.views import search_view_factory
urlpatterns = patterns('search.views',
url('^$', search_view_factory(), name='haystack-search'),
)
then in your project's urls.py you can include the search.urls under any name you want, like so:
url(r'^search/', include('search.urls')),

Not able to build dll to tridion content manager using Tcmupload assembly

We have migrated from 5.3 version to Tridion 2011 SP1
In compound templating setup, we have created one project called "CommonFunctions" which contains functions which are used frequently throughout the website.
This cs file is built to tridion content manager and we are trying to reference it in other project using
Add Exixting Item > CommonFunctions.cs > Add as link
But when i try to build my project(in which commonFunctions cs file is referenced) it gives me following error:
Cannot generate a template with name CommonFunctions since a generated template created for another assembly template is already present.
Can anyone help in this?
Thanks and Regards
Reason is very straight forward, if you go with the error message. You are trying to create two TBB's with same name(CommonFunctions).
I am suggesting you either to alter your already existing TBB or rename the new one.
Does your CommonFunctions class implement ITemplate? If so then this is why you're seeing the error. Doing so means that, when uploaded, Tridion will try to create a TBB for it, giving you the situation where you have a naming conflict. What's in the class? It should either be help functions or a "template" (TBB), but not both. At least, not if you want to reuse your existing functionality in this way.
You have several options as I see it. The first would be to upload the new assembly to a different folder than the one that is currently in use. The second would be to copy the class to your new project and rename it. The third would be to separate your helper functions from the TBB class in to one that doesn't implement ITemplate, which you could then reference as you're currently trying from your new project.

Symfony2 where to place custom helper classes

I'm starting with a Symfony2 project. I know the framework basics but I have a question:
Where is the right place to pot those helper classes I create for help or for the business logic?
Max's answer is correct. However I question the path he recommends for your code.
The following classes and files have specific emplacements:
Service Container Extensions (belong in) DependencyInjection/
from http://symfony.com/doc/current/cookbook/bundles/best_practices.html
That says your Services should be placed in a folder called 'DependencyInjection', not 'Services'. In full, it should be src/Foo/BarBundle/DependencyInjection
I say this as someone that had the former and has just finished moving them all to the latter (!)
What #Adam says is wrong, you have to store your Dependency Injection Extensions in DependecyInjection directory, not the services itself. In the documentation says that you can store your (custom) business logic classes in any place you like.
http://symfony.com/doc/current/best_practices/business-logic.html
The best way to keep the business logic is create service to handle all the logic. So it will be in:
src/Foo/BarBundle/Service
and you need to call the service in the services.yml.
I recently did some small work on an existing Symfony2 project. As described by answer from Tuong Le, I created my Helper classes under the Helper directory of the bundle and class name with Helper suffix i.e. the helper class is located at:
src/MyBundle/Helper/MyUtilHelper.php
I can use MyUtilHelper class in my bundle without calling the service container i.e. I didn't need to call.
$container->get('my_util');
I don't really know whether there is some special config. in my setup; someone already got it setup and I was just adding new functionality.
You can create the custom classes under your Bundle, such as under a folder Helper/..
However, to use those helper in your code, you'll need to define those Helper(s) in your service description file (such as services.xml)... Then you can use $container->get('your_helper')->
According to official documentation - in particular - Symfony Best Practices - you should store your services in Utils folder under the src. I belive, that this is correct way regardless of whether you want or don't wont to make the functionality provided by services of your bundle available to other parts of application via Service Container. Furthermore, you can store helper classes in any place you consider suitable. Concerning #Adam Knowles and #PachinSV answers - they are not quite right because they do not answer your question - "Where is the right place to pot those helper classes I create for help or for the business logic?" or "Where to store classes which I want to register and use via Service Container" - but not where to put bundle Extension class - which main purpose is to provide information about configuration which should be automatically loaded from your bundle to apps Service Container during the process of booting the Kernel.

Resources