default value - Opentext category attribute - content-management-system

Hi I am trying to update the attribute of type user with the currently logged in user but I didn't see any options to add a default value to the attribute of type user. Is there any option to add the default values to the Category Attributes especially attribute of type user.

Related

Symfony2.8 ChoiceType form filed with TextType form field

In Symfony 2.8 when I edit or create a user, I create the UserType form to render all fields.
The UserType form has an Roles field which I get all roles and render it like checkbox.
The question is our boss want to add an input field at every each roles on the right.
The red color I marked section is the needed input section
.
In this way our boss can edit the input text box so that he can see more clearly every role's meaning.
How can achieve this?
One solution is to move Roles to DB and store them as other entities. In such scenario you will need Role entity with at least two properties:
name
description

Generate custom Azure web form

I am working on Azure C# project. There is webrole with web form collecting customer’s information.
Depending on the information, they submit I need to create new custom web form for each one of them.
How can I generate new web form with custom web controls inside same site with code? I would prefer not create different site for each customer.
Any ideas appreciated!
You don't have to create a custom web form for each customer, you can have it all in on dynamic form and draw the input controls according to the customer.
You will have to have a form a form or a database table to configure the input needed for each customer which will be used in drawing the form.
ex:
You can have a table named: CustomerAttibute with the following columns
Customer ID
Attribute Name
Attribute Type (Number, text, boolean, ...)
Is Required
Validation Reg Expression
In the web form, you will read the customer ID and retrieve the attributes related to that customer, and use these attributes to draw the form, ex: an attribute of type text will be rendered as a textbox but an attribute of type boolean will be rendered as a checkbox
Capture the values from the user and insert it into another table, ex: CustomerAttributeValue which will have the attribute ID and attribute value, the value will be string to accommodate for any type

Symfony: get new ID in a form

I have an object displaying within a form, a hidden field being related to its PK (field id).
When I create a new object, the field has a null value. Submitting the form, the object is inserted into the DB and it now has an ID, but the field in the page still has a null value.
If a reload the page, now the ID is indeed set in the hidden field.
In my opinion, this is due to the form processing of Symfony: when a create an object, it creates a form, with this form valid the object is saved but the form still uses the data before it was saved.
The question is: how to get the auto-incremented key in the form up-to-date? Shouldn't the form only have a reference to the object? Can't the value be updated?
make sur that you call $entityManager->flush() method after insert and that you bind your form whene you have same data in your request object
$form->submit($request->request->get($form->getName()));
You should have an Entity assigned to your Form by FormFactory. Then Symfony will fill that Entity with submitted values. What's left is only persist the Entity and flush to database.
You can find steb-by-step form submission in Symfony Cookbook

orion updateContext without type

I need to make an updateContext of an attribute with a known value but with an unknown type. If we could avoid querying the entity first, it would be great. Is there some way of updating an attribute without knowing its type in advance?
It depends on Orion version. Before 0.17.0, the attribute type was used as part of the attribute identification (along with the attribute name). Thus, you needed to know the attribute type in advance in order to update it in a "safe" way (you could use empty type, which means "any type", but at the risk that other attribute with the same name got unintentionally updated).
However, from 0.17.0 on only the attribute name is used for attribute identification. Thus, you don't need to specify the type in attribute updates. Basically:
If the update includes name, type and value, both the type and value get updated
If the update includes name and value (but not type), the value gets updated. The type is left untouched.

symfony2: how to validate a property which is not mapped to the entity ('property_path' => false)

I'm having a registration form, which contains input fields, almost every field mapped to a property of the User class. But there are some fields which are not mapped. Validation is done via annotations in the User class.
My question is: how do I validate those fields which are not mapped?