cakedc user plugin user_details - cakedc

I am using CakeDC user plugin with cakephp 2.5. I see that it includes a user_details table. I want this use this table to store the full name of the user among other details.
I have added a new entry into the user_details table with the correct user_id but the table does not get pulled with userData in the view.
On investigating the user model I do not see any association with the user_details such belongsTo. There is actually no user_details model.
There is no mention anywhere what to do here. Do I create a model for the user_details table and create the associations?

This table is a key-value store and is not used by the plugin any more but kept for legacy apps.
You'll have to add the assocs by extending the plugin or add your own profiles table which I would recommend to use instead of a key-value store, which is actually as well the reason why it was dropped from the plugin.

Related

Is it possible to create my own custom KvExt table to fully implement and manage User Defined Fields for my custom table and page?

I have a custom table in SQL Server called AnimalBreed and maintenance page.
I wish to add User Defined Field support via the KvExt approach instead of
traditional practices involving either CSAnswers or a CacheExtension of the
DAC and underlying "Usr" fields.
Is this possible?
Can it be done for line-level (child) DACs, such as
existing INLocation and INLocationKvExt?
Thanks!
UPDATE:
It appears the feature needs at least:
ensure your table has the NoteID column as uniqueidentifier datatype and the DAC has the corresponding field: Guid? NoteID and [PXNote()] attribute.
In the ASPX, if not ListView, add the following to the PXDataSource tag:
EnableAttributes="true"
By making these changes, I can Manage User Defined Fields, choose Attributes to include, and I can store values to the KvExt table.
I am using Version = 19.205.0023
Sales Order page observation: if I add two UDFs on SO Order Entry page, one is combobox and one is checkbox, setting their values saves just fine, but then updating the combobox and save leads to loss of the checkbox (from true to false), unless you uncheck and recheck prior to the save. Is this a bug?
Maybe technically possible but definitely not recommended to use undocumented feature like KvExt.
If you need to deploy User Defined Fields on a page which already contains them. Configure them manually and then add them in a customization package in the user defined fields section for deployment as described here:
https://help-2019r2.acumatica.com/Help?ScreenId=ShowWiki&pageid=e01f29d3-b6b1-40f4-a2d1-45c9d01bdde3
Example:

Orchard Collaboration tables joins

I'm new to Orchard CMS and collaboration,I want to know How Orchard Collaboration tables are mapping with each other(i.e joins) like how customer & Project module is linked each other.
The data model of the Orchard is based on ContentItems and ContentParts. Each ContentItem contains several ContentParts. Each ContentPart ( in case it derived from ContentPart not from ContentPart), has its own table in database. ContentParts of a ContentItem have the same primary key value.
Now backing to your question:
Customer is a User with special privilege. Its ContentType is User.
Project is also a ContentItem. Its ContentType is ProjectItem.
Project Type contains a ContentPart called ContentItemPermissionPart. ContentItemPermissionPart specifies which Users and Business-Units have which AccessType to the ContentItem. The associated database tables related to this are ContentItemPermissionPartRecord (master) and ContentItemPermissionDetailRecord (detail).
You can find more information about Orchard data model Here.
You can find more information about Orchard Collaboration data model here.

Giving your own ids to Core Data objects

I have some points on a map with associated informations contained by Core Data, to link the points on the map with the associated info, I would like to have an ID for each point, so in my entity, I would need some ID property, I have read that Core Data has it's own IDs for every managed object but I'm wondering wether or not it would be a good approach for me to directly use them or if I should create my own ID system ?
If you think I should create my OWN ID system, how would I do that ?
Thank you.
CoreData is not an relational database and you should avoid thinking about own ID’s. You may need them only for syncing purposes with external databases. For more precise answer, you should write how your model looks.
[edited after comment]
I don't see that you need any relations. Let's sat you have MapPoint entity with lat, and long properties. If there is only one user note, you just add another property to it like notes. If you have many informations (many records) stored with one MapPoint you need to add Notes entity with properties note and mappoint and make a relation between them. When you insert new Notes object into CoreData you set mappoint property to already existing MapPoint object (fetched after user tap).

Is it possible to add Extra Fields Under Create User in Liferay

I am using Liferay 6 for portal Development .
During Creating Users under Liferay , i need to add some extra Fields also ??
Please let me know if this is ppossible or not ??
Please see the screen shot attached here , and also please let me know in which table this will be stored in Database ??
Yes, you can use Custom Attributes functionality for liferay entities (in your case, User) and can add as many extra fields as necessary for each liferay entity.
Custom field for the user-entity can be created through:
Control Panel -> Portal -> Custom Fields -> User.
And programmatically can be created as follows:
user.getExpandoBridge().addAttribute("yourCustomFieldKey");
Then set the value as:
user.getExpandoBridge().setAttribute("yourCustomFieldKey", "valueForCustomField");
If your custom field is already present you can check like this:
if (user.getExpandoBridge().hasAttribute("yourCustomFieldKey")) { ... };
The data is stored in tables prefixed with "EXPANDO":
EXPANDOCOLUMN: stores the custom field key and other settings
(contains the tableId refrences)
EXPANDODATA: stores the custom field value for the key (contains the
columnId and tableId refrences)
EXPANDOTABLE: stores for which liferay entity (user) are you adding
the custom field
EXPANDOROW: stores linking information between a user and its values
(contains tableId and userId refrences)
Hope this helps.
yes, you can add custom fields to user-entity and add them the field-values to user:
user.getExpandoBridge().addAttribute(...);
Custim field for the user-entity you can create by Control Panel Portal->Custom Fields or programmaticaly at liferay start.
The data will be stored in ExpandoValue tables.
Just in case somebody try to retrieve the values from the custom fields and is having problems with null values returned by the method user.getExpandoBridge().getAttribute("yourCustomFieldKey") (even when you followed the threads about permissions), I found other way to retrieve the Custom Fields values:
ExpandoTable table = ExpandoTableLocalServiceUtil.getDefaultTable(user.getCompanyId(), User.class.getName() );
ExpandoColumn column = ExpandoColumnLocalServiceUtil.getColumn(table.getTableId(), "yourCustomFieldKey");
ExpandoValue expandoValue = ExpandoValueLocalServiceUtil.getValue(table.getTableId(), column.getColumnId(), user.getUserId());
Then you can do a simple (if the field is text) expandoValue.getString();
Not so pretty, but do the work.
User creation page in liferay can be customized. You can infact decide which fields to be present in the user creation page. More about this in here.
Use the following commands if you get the permission problem in adding or setting attribute.
user.getExpandoBridge().addAttribute("yourCustomFieldKey",false);
user.getExpandoBridge().setAttribute("yourCustomFieldKey", "valueForCustomField",false);

Creating associations in EDM model on unique keys

I'm developing a new application which is based on a legacy database. The old legacy database does not use reference integrity and first we try to not change the existing schema. I still want to be be able to use navigation properties in my EF generated POCO classes.
However, the old data model has one big issue regarding child-parent relationships: the column in the child table is referencing the parent table via the uniqe key of the parent, not via the primary key of the parent table. Is it still possible to generate such associations?
I tried to mark the unique key in the parent table as "entity key" but then I still need to provide a mapping for the parent table's primary key which I am not able to because there is no mapping for it available, this primary is just a dummy "counter". If I do not provide a mapping for the primary key, I get
"Error 111: Properties referred by the Principal Role XXX must be exactly identical to the key of the EntityType YYY referred to by the Principal Role in the relationship constraint for Relationship ZZZ. Make sure all the key properties are specified in the Principal Role"
No EF does not support unique keys at all. It is hopefully planned feature of the next major release.

Resources