Alfresco unique constraint validation adding content to webform with xs:unique - validation

Is it possible with standard Alfresco code to perform schema validations when adding new content to a webform? (the webform is associated with the schema file)
I have a simple schema file with 3 elements that must be unique. I've found out that I can use xs:unique to perform this validation and ensure that each element is unique, however Alfresco does not perform this validation at all.
I can submit the content with repeated fields anywhere.
I've been digging the internet to find a solution and it is possible to tackle this issue messing a little with Alfresco extensions, however I would like to know if is there any other way.
Does someone experienced this issue?

you can use custom validation in this custom validation you need to check whether your elements are unique or not please refer this documentation for custom validations.

Related

Migrate validations from strus1.3 to struts2

I am current working on a migration project from struts1.x to struts2. I am looking for some help in migrating the existing validations.xml and validations-rules.xml to struts2 equivalent. I am aware that we need to create validation xml per action class in struts2, but idea of placing all validations under file like in struts1 looks more better in terms of managing the application. If anybody had done similar work, please give me some pointers or guidance.
Secondly, if validation using one single file is not possible, i would like some help on how to convert the validations file to equivalent struts2. I am not able to understand the plugins part, for eg, mask, date. Seems they are more easy in struts1, whereas in struts2 we have to write regex for almost everything. for eg, i couldnt find anything for just a Invalid date validation. Whereas just using the date plugin in struts1 its possible.

Orbeon : Where are my forms

I work with Orbeon Form Builder. I had created a form with the builder interface and I had published it. Now I want to find the file myform_created_with_builderINterface.xhtml but I don't know where the path of it to edit it.
I need this file because I would like to edit and implement some XML request and I don't know how I can proceed to make it work.
Where is the file of the form that I have created before with the builder?
The published form definition is stored in a database when you save or publish it.
If you haven't made any changes to the Orbeon Forms configuration, form definitions and form data are stored into the built-in eXist database, whose files are under WEB-INF/exist-data.
If you have configured a relational db, form definitions and form data are stored in one of the database tables: orbeon_form_data for non-published form definitions and form data, and orbeon_form_definition for published form definitions. In both cases, look at the xml column.
The cross-database way of retrieving it though is to use the persistence API: an HTTP GET at the right URL will give you the form definition, provided the service has been open or secured.
I am still unclear why you need this "to edit and implement some XML request" though. Better work with the source of the form definition, which you can see in Form Builder's Edit Source, or using custom model logic.

Confused with MVC scaffolding

I'm learning MVC3. There is something I'm trying from many hours and now I think I'm totally lost.
I created a database first, then generated Models from it. Now I wanna know if it is possible to use scaffolding to generate a model with CRUD views? I tried several things. Firstly the error- Unable to get metadata.
Googling it first misled me that there is something wrong with EF4.x. Reinstalled it and wasted time. Then I tried Automatic Code Generation feature but its giving ambiguity errors between previously generated classes.
Is it even possible to do what I'm trying? How? Or do I have to code for the views?
Go to your controller method, right click and add your view, You will need to check strongly typed-view then select the model and the scaffold template.
If you still get an error, make sure you decorate the primary key with the attribute [key], also make sure all properties have the same name as your DB field or you will get an error.

umlauts-domain in magento e-mail validation?

is there a way to allow umlauts-domains for e-mail addresses in Magento? when entering such domain at the moment, there's an validation error. where can i find those validation settings?
thanks in advance!
I guess you'll need to change at least the appropriate Prototype and Zend validators to achieve this.
Scan js/prototype/validation.js for the pattern 'validate-email' to find the client-side validation part.
To locate the server-side validation part search the pattern Zend_Validate_EmailAddress in the file app/code/core/Mage/Eav/Model/Attribute/Data/Abstract.php.

MVC 3 client-side validation without annotation?

Is there a way to have the same kind of client-side validation in MVC 3 without being able to set the validation at the viewmodel level?
I have two requirements that are preventing me from adding my validation at the viewmodel level. I'd like to be able to have the same kind of "built-in" validation but without changing the viewmodel or controller code. I'd like to be able to change, turn on/off, validation at the view level post-deployment. Ideally I'd like to be able to edit the view mark-up without writing and maintaining mountains of my own JavaScript.
http://bassistance.de/jquery-plugins/jquery-plugin-validation/
This may help ya, only validation on the client though so not really ideal.
You could create your own TypeDescriptionProvider which will allow to augment your viewmodel at runtime.
Based on this code sample (XmlMetadataTypeDescriptor, XmlMetadataTypeDescriptionProvider) you should be able to:
Augment viewmodel using external xml which contains validation attributes.
Turn on validation with
TypeDescriptor.AddProvider
and turn it off with:
TypeDescriptor.RemoveProvider
Update
For more information you can read great article: "Understanding the TypeDescriptor: A Metadata Engine for Designtime Code".

Resources