Is there any way to restrict content type in folder

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2012 03:59 AM
For example only someco:whitepaper type is allowed in the Whitepaper folder and the MIME type should be PowerPoint or Word document.
What should I do to archive that goal ?
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2012 06:19 AM
- Use the rule engine. Add a rule to this folder. When new content is entered you choose to execute a server side javascript where you implement the behaviour you want using the alfresco javascript API.
- Implement a server side java behaviour which implement a NodeServicePolicy. There are a variety of policies to implement like onBeforeCreate or onCreate. If the content that is about to be created not meets your requirement (ie your specified content type or mimetype) you wont allow it to be created.
/Erik

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2012 06:28 AM
Does the javascript action be able to deny the update of this node?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-13-2012 06:52 AM
I mean during creation of rule we can set that it should fire on content update.
We can choose the secript in that rule with that rule which will do the rest of the work.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2012 01:34 AM
Yes you can create the rule which gets fired on the content update.
I mean during creation of rule we can set that it should fire on content update.
We can choose the secript in that rule with that rule which will do the rest of the work.
My question is if I setup a rule that will fire on each content create or update, the action is taken place when the content creation or update is done, am I right?
If the action is called after the creation or update of the content is done, then how to deny content creation or update. What should I do in the action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2012 02:21 AM
/Erik

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2012 05:08 AM
Delete the content?
/Erik
It is absolutely not user friendly to just delete the content when content type or MIME type restriction violation is detected.
I am thinking of another way.
Maybe I can develop an custom aspect to add to folder which can have property to define allowed content types and corresponding MIME types.
Provide custom content creation and modification page to those folder which have the aspect.
Those page should have the ability to restrict content type choice and enforce the restriction (do not allow submit if there is policy violation) .
Does alfresco share support that kind of extension?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2012 05:15 AM

Read this blog post about customizing the file upload. http://www.ixxus.com/blog/2011/09/customising-the-upload-file-dialog-box-in-alfresco-share/
You could then present a list in this gui with the allowed file types which you could supply from a web script.
Have in mind that you still might need to do it the non user friendly way if the user chooses to use drag and drop when uploading content.
/Erik

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2012 05:32 AM
And I think this is a very useful feature, and should be placed in the feature requirement list of future alfresco releases.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2012 05:35 AM
/Erik
