Alfresco folder rule to create publicly sharable link for the children - alfresco

I am using Enterprise Alfresco.
I want to have a rule on my folder that will create a publicly shareable link whenever a new document created in the folder. The sharable should be the same as what we can create using the share ui.
Any help will be appreciated...

You can Refer logic of publicly shareable code in below webscript.
ShareContentPost.java
QuickShareService.java

Related

How to create a new action in a folder in document library in Alfresco?

I have to create new action in folder inside document library.I have been trying to add an action but its not working out. I wan the action to available in this menu:
Need some help in the implementation. When I go into Alfresco Share interface, I see the concept of sites. I decided to create a site for our application. Then inside the site, I am able to create folders underneath the site, I also see a document library location, inside which as well I can create folders
I am having a hard time choosing or deciding on an approach. Tried implementing the concepts on repo but not sure how to reflect the changes in UI using share.

How to reference a file (e.g. testaudio.mp3) from another file (e.g. index.html) in Alfresco

I have a mp3 file in a folder called "audio" in Alfresco. I would like to have a link that points to that file in my index.html file which resides in another folder.
For example: <a href="pathToTheFile>test song 1</a>
How would I reference that file? I tried with href="/share/proxy/alfresco/api/node/content/workspace/SpacesStore/xxx-xxx-xxxxx/testMP3.mp3" and it does not work. Or is it even possible with Alfresco? I am using the web interface.
My apologies for not making myself clear. I am using Alfresco Explorer Community Edition for management, and the website I'm working on is based on Spring MVC and pulls content from index.html files in Alfresco.
Currently I need to use <embed> tags to include a mp3 file to index.html, and the mp3 file is also stored within the Alfresco repository but in a different folder.
How would I reference the mp3 file from the index.html file? The referencing has to work when the index.html is deployed to the client website, and currently the client website is referencing files in Alfresco in the following manner: <img src=/asset/xxxxxx-xx-xxx/test.png>(There is no asset folder in the Alfresco repository, and somehow that works...). But this does not work for my mp3 file...
To access alfresco content using the RESTful api, you should be querying this webscript: /alfresco/d/<d|a>/<workspace>/<store>/<nodeId>/<filename>
where :
d and a refer to direct / attached mode
<workspace>, <store> and <nodeId> reference your content nodeRef
<filename> a file name of your choice
So your URL should look something like this http://<host>:<port>/alfresco/d/d/workspace/SpacesStore/8444ad61-4734-40e3-b2d4-b8b1c81347fd/test.mp3
Note : Depending on the permission set on your node, you might need to attach an alf_ticket to the URL for an authenticated alfresco user. Please check this for further insights.

How to search within a particular folder in alfresco

I have folders in share shared folder. Is there any way to specify share to search for a particular file in particular folder of the shared folders?
Yes, but there is no user friendly out of the box solution (I know of).
As admin, go to http://your-host.domain.name/share/page/console/admin-console/node-browser and execute a (fts-alfresco) search like the following:
PATH:"/app:company_home/app:shared//*" AND #cm\:name:"filename.txt"
This will find all files named "filename.txt" below the shared folder.
I guess you will have to customize the search UI if you want to offer that functionality in a user friendly fashion or to non admin users.
Further details are at http://wiki.alfresco.com/wiki/Search#Path_Queries
We've developed a solutions where you can search within a folder through the advanced search form: http://addons.alfresco.com/addons/alfresco-share-folder-search
It's free for download so you can look around how it's done.
In short: in 4.2.e you can send an extra param rootNode to the /slingshot/search repo webscript.
If you check the client side JavaScript in Share components/search/search.js
There is method _buildSearchParams The following params are send: site={site}&term={term}&tag={tag}&maxResults={maxResults}&sort={sort}&query={query}&repo={repo}&rootNode={rootNode}&pageSize={pageSize}&startIndex={startIndex}
So fill in the rootNode with a qnamePath or NodeRef and it will present the results of that folder.
For a possible implementation, I wrote a long post about it on the alfresco community forum .

documentLibrary not visible after creating site in Alfresco Share

I have a problem identifying the root folder documentLibrary after creating a new site.
I'm using a POST command to create a new site (to service/modules/create-site) and everything looks fine, the site is there. However, listing the folders show that there is no defaultLibrary. I need its ID in order to create new folders on the site visible on the web pages of Alfresco share.
My impression is that the documentLibrary is only created when you access for the first time the site on the web. Any ideas?
Thanks
EDIT: the correct name is documentLibrary
You are correct. The documentLibrary is created on the first access. You can use the siteService.getContainer method in the javascript services API. It will create the container if it does not exist: http://wiki.alfresco.com/wiki/4.0_JavaScript_Services_API#Get_container_folder_for_component_id
I think the correct naming of the componentId is documentLibrary.
I had the same problem.
I solved it by creating a folder for the template i use in Data Dictionary/Space Templates
Then the documentlibrary is created.

How to implement an RSS feed of a site within alfresco share?

I am still learning alfresco and trying to get the feed dashlets to display a custom feed in share. The end goal is to have some sort of workflow in which the editing of certain components on a site site page within alfresco generate a feed element which will then be picked up by the feed dashlet. For now to test I created an xml feed file and put it in a document space in a collaborative site that was set to public and put its link in the feeds dashlet config but that doesn't work. Is there anyway to implement the functionality I'm after?
There are 2 options:
Create your own Dashlet. The current RSS-Feed Dashlet connects to the http connector(share-config-custom.xml), this is an external connector for which authentication is required. So copy the RSS-Feed Dashlet and rip this part out.
According to this JIRA enhancement , in Alfresco Enterprise 4.1.4 you can read internal Share Feeds! So this means you probably won't have to do any customization. So grap the SVN/GIT source of Enterprise tree and use Alfresco's code to build the Dashlet or extend/override it.

Resources