We are using Plone as a Document Management System in a healthcare environment. A lot of documents were already created and sent throught a custom workflow.
We now detected a small mistake that should be corrected in 171 documents.
Is there a method to change this programatically?
I'm thinking of something like VIM regexes...
:%s/wrong/right/g
There's no built-in feature for this.
You can try out these add-ons:
https://pypi.python.org/pypi/collective.searchandreplace
https://pypi.python.org/pypi/rt.bulkmodify
Related
The issue is i have a catalogue of reports that have security policies assigned to them. Let's say things like 'manager' can access this report, but not this. This goes on throughout the catalogue. I have been told that a large chunk of reports need these security policies updated. The only thing is is seems very tedious going through each any every report and updating access manually.
Is there a quick way of doing this for say 500+ reports, some nested within others?
Use the command line:
runcat.cmd -cmd setItemPermissions
Use this command with -help suffix to get the documentation and then write what you need.
In one requirement I need to query just created document. If I use lucene search then it will take few seconds to do the indexing and may not come in the search result.
The query should be executing from some alfresco webscript or a scheduler which runs every 5 seconds.
Right now I am doing it by using NodeService and finding child by name which is not the efficient way to do. I am using JAVA API.
Is there any other way to do it?
Thank you
You don't mention what version of Alfresco you are using, but it looks like you are using Solr.
If you just created the document, the recommendation is to keep the reference to it, so you don't have to search for it again.
However, sometimes it is not possible to have the document reference. For example, client1 is not aware that client2 just created a document. If you are using Alfresco version 4.2 or later, you can probably enable Transactional Metadata Queries (TMQ), which allows you to perform searches against the database, so there is no Solr latency. Please review the whole section, because you need to comply with four conditions to use TMQ:
Enable the TMQ patch, so the nodes properties tables get indexed in the database.
Enable searches using the database, whenever possible (TRANSACTION_IF_POSSIBLE).
Make sure that you use the correct query language (CMIS, AFTS, db-lucene, etc.)
Your query must be supported by TMQ.
I want to create a custom report. Response format for sonarqube web service API /api/issues/search is JSON or XML. How can I use that response to create a html or CSV file using "unix shell without using command line tools" so that I can use it as a Report. Or is there any other better way to achieve this?
you can generate a html file if you run an analysis in the preview mode http://docs.sonarqube.org/pages/viewpage.action?pageId=6947686
It looks as if the SonarQube team has been working hard to not allow people to do this. They appear to want people to purchase an Enterprise Subscription in order to export reports.
An old version of sonar-runner (now called sonar-scanner) had an option to allow local report output. But that feature is "no more supported".
ERROR: The preview mode, along with the 'sonar.analysis.mode' parameter, is no more supported. You should stop using this parameter.
Looks like version 2.4 of Sonar Runner does what you want. If you can find it. Of course they only have 2.5RC1 available on the site now.
Using the following command should work on version 2.4:
sonar-runner -Dsonar.analysis.mode=preview -Dsonar.issuesReport.html.enable=true
There at least two open-source projects that query the SQ API to generate reports in various formats.
https://github.com/cnescatlab/sonar-cnes-report/tree/dev (Java)
https://github.com/soprasteria/sonar-report (JavaScript/Node)
At the time of writing both are active.
I was just wondering if this is possible. I have a site that admins use to add products to our database. The database is in SQL Server 2008 and I use Visual Studio 2010 using VB.net and was hoping that upon addition of a new product, it would automatically generate a folder assigned to that product's ID.
I haven't found anything online that would suggest that this is a possibility, but it would make it a lot easier for me. As of right now, I have to remember to create a folder in the X: drive for each product that has been added. We are up to 645 products now, so you can see my need for some kind of automation here.
Any kind of help would be greatly appreciated!
If you're using a web service or web project to create products, you could create the directory there when the user enters a new product.
Dim dir As New System.IO.DirectoryInfo("C:\" & someFolder)
If Not dir.Exists Then
dir.Create()
End If
If products are always added within a call to a stored procedure, you could add code to call xp_cmdshell to "MD < DirName >" after the insertion. If not done via stored procedures, you could do something similar in an insert trigger. However, both of these are really bad ideas. SQL is first and foremost a database engine, not a file system manager or flexible programming tool. You are much better off having the application(s) that cause the creation of products be responsible for manipulating files and folders on your hard drives.
Is it possible to create Alfresco users in a "batch" way?
I mean, creating lots of users with a script or calling an API or something.
Thank you!
There is a module for the Share admin console in the Share-Extras project which allows the creation of users from a CSV file. It can found here: http://code.google.com/p/share-extras/wiki/CreateBulkUsers
The alfresco shell tools project allows the batch creation of Alfresco users:
https://code.google.com/p/alfresco-shell-tools/wiki/UsersAndGroupsFun#Create_a_new_user
It wraps the REST APIs mentioned in the other replies in an easy to use manner.
I think the easiest way to do that is to use the addPerson webscript.
Just create a small application that calls the webscript (it's a normal HTTP POST request) with the user data you want.
http://wiki.alfresco.com/wiki/Repository_RESTful_API_Reference#Add_Person
If you're using Alfresco Team, or a recent nightly build, then you can simply upload a CSV / Excel file of users and have them created for you. (It's in Swift too)
You'll find the link to do this in the admin console, and the webscript that backs this is http://localhost:8080/alfresco/service/api/people/upload (perform a GET to fetch the spreadsheet template, or a POST to upload the users)