Alfresco web-scripts-application-context.xml - javabeans

I want to register a bean. I'am following this tutorial http://aboutalfresco.blogspot.com/2010/07/java-backed-web-scripts.html.
But i can't found the file tomcat\webapps\alfresco\WEB-INF\classes\web-scripts-application-context.xml.
Is it deprecated ?
Should i create it ? or should i use the file alfresco\web-client-application-context.xml wich also define beans ?
What is the difference bettwen this 2 files ? Alfresco version?
I'm using Alfresco 5.0.d.

In Alfresco 5 many of the context files have been bundled up in jars that you won't be able to access.
Besides, best practice involves you creating your own custom context file rather than overwriting a system context file. Your best bet if you don't want to create an amp is to put your bean definition in a file named something like custom-webscripts-context.xml and putting it in shared/classes/extension. Alfresco will pick up anything that ends in -context.xml.
Also, please don't follow a 5 year old tutorial. The tutorials linked in the comments are created by Jeff Potts, the old Community Manager for Alfresco, so really are the most up to date and easiest to follow you're going to find.

Related

Is it possible to replace Jackrabbit repository with Community File Repository in Pentaho BI Server

We are using Pentaho BI Server for mainly scheduling Jobs and Transformations. Drawback of Jackrabbit is that you cannot refer to additional files (.csv, .txt etc) with in your transformation using parameter ${Internal.Transformation.Filename.Directory}, you can refer to transformations or jobs with that though.
Community File Repository doesn't have this restriction as it saves files as it is. The documentation for CFR states
An easy way for a user to upload some files to the BA Server (maybe to
be used by an ETL job)
however there are no examples of how to do it !! But my question, is it even possible to switch to CFR, I have googled to find any help but unfortunately there are none that were helpful.
Looked at pentaho-server\pentaho-solutions\system\repository.spring.xml file which supposedly defines repository classes but not sure what changes will enable CFR.. ???
If anyone knows how to achieve this it will be
Thanks for any help..

Generation of migration files from ezplatform with kaliop

Using ezplatform with "kaliop/ezmigrationbundle": "^3.0".
I read and re-read the manual but cannot see anything about auto-generating yml files from exsiting content types; does anyone have any experience with this and happen to know if/where the docs might live?
We have a list of content types that were created in the backend via the gui and now we need to create migration files for them for better development with the dev team.
Update: This is available on v4+ https://github.com/kaliop-uk/ezmigrationbundle/issues/34#issuecomment-317524072#issuecomment-317524072
This is available on v4+ and answers the question
https://github.com/kaliop-uk/ezmigrationbundle/issues/34#issuecomment-317524072#issuecomment-317524072
I guess that is not how it works!
the bundle generate just an empty yaml file for you and you should fill up the content types (or any other Backend Changes you want) yourself in that yaml file and then take it and apply to your stage or Live Environment.
so unlike Symfony DoctorineMigrationBunlde, this bundle does not read the difference and produce stuff itself.

Reading and writing Hippo content

What is the best way to read and write Hippo content programmaticaly? I want to build a migration tool that writes some pages and binary files to Hippo. I am now using the JCR API to create nodes in the repo, is there any better approach?
Have you tried:
http://import-tool.forge.onehippo.org/
(you can checkout source code and use it as a reference if needed)
Another one you could check is:
https://forge.onehippo.org/svn/restimporter/
(no documentation other than:
https://forge.onehippo.org/svn/restimporter/trunk/README.txt
)
hth

Sonar: is it possible to give new projects permissions automated?

we are starting to use Sonar. We want to use it for many different projects. Is there a way to give a project automated defined project permissions (for example with a name pattern). We found only the way to create a default template for new projects, but with this template every project would have the same permissions and we would like to give them permissions based on name patterns...
Do you know if there is a way to do this?
Thanks and regards
This is not possible yet - as of SonarQube 4.0, but will be soon: feel free to watch and vote for SONAR-4535.

Changing createDate on Liferay Journal Article (Web Content) via Liferay API

So here's the situation. I want to add 'old' news from our previous website in to an asset publisher portlet on our new Liferay 6.1 site. The problem is that I want them to show up as if I had added them in the past.
So, I figure, how hard can it be to modify the createDate? I've since been able to directly access the MySQL database and perform updates on the article object's createDate field. However, it doesn't seem to propagate to my Liferay deployment, regardless of clearing caches, reindexing search indices, and restarting Liferay. The web content still maintains it's 'original' createDate even though the database shows it as the value I have changed it to.
Here's the query I used:
mysql> UPDATE JournalArticle SET createDate='2012-03-08 15:17:12' WHERE ArticleID = 16332;
I have since learned that it is a no-no to directly manipulate the database, as the dynamics of database/Liferay isn't as straight forward as Liferay performing lookups. So it looks like I might need to use the Liferay API, namely, setCreateDate as seen here.
But I have absolutely no idea where and how to leverage the API. Do I need to create a dummy portlet with the sole purpose of using this API call? Or can I create a .java file somewhere on the server running my Liferay deployment and run it to leverage this method?
I only have like 15 articles I need to do this to. I can find them by referencing the ArticleID and GroupID.
Any help would be greatly appreciated. I've grepped the Liferay deployment and found setCreateDate being used heavily within .java files inside the knowledge-base-portlet, but I can't tell how else to directly use them without creating a portlet.
On the other hand, if anybody knows how to get my database to propagate it's changes to the Liferay deployment, even though I know it's a dirty hack, that would probably be the easiest.
Thanks; I really appreciate it.
Using of Liferay API is of course the clear and better way, but for only 15 articles I would try to change it directly through the database.
I checked the database and it seems that Liferay stores the data in these tables: JOURNALARTICLE and ASSETENTRY.
Try to change the created date in both these tables.
Then reload the cache: Control Panel -> Server Administration --> Clear Database Cache.
You can write hook for application startup event. This way whenever liferay is first started it will change the create date as you desire. Later if you want to remove the hook it can be done easily. See here on how to create a hook and deploy it.
http://www.liferay.com/community/wiki/-/wiki/Main/Portal+Hook+Plugins
Also, changing in database itself is not at all recommended even for 1 value/article. Always use Liferay provided service api to modify.