Liferay 7 - Get Dynamic Attributes from DDLRecord in Freemarker - liferay

How can I get the dynamic attributes from a DDLRecord inside an Application Display Template (ADT) that has an Asset Publisher type using Freemarker?
As far as I know, I don’t have any other choice that doesn’t involve an Asset Publisher ADT, since I use the filters provided by the Asset Publisher. In case you need context, my Dynamic Data List (DDL) has a date attribute and I need to show the record from the latest date.

It is totally possible to get dynamic attributes from the asset publisher. However, you can also display your DDL inside a portlet where you can customize your display.
To do this you would need to know the unique id of the DDL (this can be gotten from your liferay admin interface) and the you can elicit the attributes and then order your list as is appropriate for you.
Check out this example
https://github.com/Temire/Getting-DDL-Attribute-Dynamically/blob/master/GetDDLAttributejava

Related

Dynamic domain that gets list of saved asset queries as values?

Maximo 7.6.1.1:
I have a custom field in PMs called SAVEDASSETQUERY.
I would like to add a domain to this field that is a list of all saved asset queries that the user has access to.
It would be ideal if the domain were dynamic. If a new saved asset query were added to Maximo, then it would automatically show up in the domain/field in the PM application.
The reason for doing this is: I want to avoid data entry errors in the SAVEDASSETQUERY field.
Is it possible to do this with automation scripting, or would it require Java customization?
You could use a standard TABLE domain on the QUERY table object to achieve this. To filter on the user's queries (attribute OWNER), you would use the :&USERNAME& special bind variable.
Table domains:
https://www.ibm.com/support/pages/adding-lookup-functionality-field-maximo-using-table-domain
Bind variables:
https://www.ibm.com/support/pages/username-appname-and-other-special-bind-variables-you-can-use

Liferay 7 Eclipse IDE override default categories filters query

I’m looking for a way to override the default category filter behaviour for Asset Publisher widgets (point 3 of my previous question here).
As far as I understand in the Setup > Asset Section > Filter a rule based on categories will look for all source > asset type components which match the selected categories.
I would like to know where is default query stored and how it is possible to modify it in order to introduce other custom criteria.
Update:
I can create a Liferay module project fragment, but I wasn't able to retrieve the correct OSGi bundle and relative file to override the default query filter behaviour.

E-Commerce Product Custom Field Kentico 10

I am using E-commerce module of Kentico portal and it has two fields for Products pricing : SKUPrice and SKURetailPrice.
I needed one more field to show sell price and I added a new field in Modules application of the portal.(Modules->E-Commerce->Classes->SKU->Fields->New Field)
Now, I need to access this field in my code,but SKUInfo class doesn't show me the newly added field.What I need to do so that the newly added field reflects in my project code ?
I have already build the entire solution multiple times.Any other solutions please.
You can use GetValue and SetValue methods for such fields like this:
SKUInfo sku = ...;
string a = sku.GetValue("field").ToString();
sku.SetValue("field", "value");
JanH has the answer for custom fields you set, also keep in mind though that there is a "SKUCustomData" for other information that you want to store. It takes a Name-Value pair dictionary if memory serves me correctly, and useful if you need to store configuration information or other things that won't be located on the normal SKU table.

Reusing a custom ContentPart in the same ContentType

I'm trying to figure out the best way to handle a requirement I have for an Orchard module I'm building.
I have a ContentPart that has a few fields. One field is a ContentPicker that allows for multiple items to be associated to the part. The rest are descriptive information.
The issue I have is that I actually need to be able to include more than one of this ContentPart into a ContentType. I need to create a ContentType that has exactly 3 of this part.
Should I be making this into a field instead of a part? Is it even possible to have a ContentField that has other fields in it?
Or, should I somehow use all the same models and data structures, but somehow define it as 3 distinct parts?
Just wondering what the best practice to do something like this would be.
You can only have one part of each kind on a given type. You can't have fields that have other fields in it (instead - take an existing field and extend it with custom stuff).
As I understand, the actual problem is "how to make groups of fields with some metadata for each group", right? If so, there are a few approaches to solve the problem:
Create a custom field based on Content Picker (basically - take existing Content Picker and extend it with your metadata) and use this without the need for a separate part
Create one part to hold only the metadata for each field attached to it and attach 1 or more fields to it
Create 3 distinct parts. Parts should be thought of as extensions that add some unique features to an item. If you think it's logically ok to have 3 parts then go for it.

Sharepoint Extenal List and Custom Field Types

I have an odd issue.
I have client that wants a sharepoint list what is populated from a WCFService. That part is working quite well.
I have a bdcmodel that is mapping the WCF data and I can create an external list from the bdcmodel as well so that is working fine.
The issue I have is that one of the properties in the model is actually a collection of entities called Attributes. The objects in this collection simply have 2 properties Name and Value so really they are just a key value pair.
The client wants to see the list of attributes of the parent entity in the external list. So there would be an Attributes column and within that column would be the list of attributes for each parent object.
Is there even a way to do this? I am looking into Custom Field Types, but it seems like these are really intended to be singular values.
How would I create a list within and external list?
Any help anyone can give would be great even if its just to tell me that there really isn't a stable way to do this so I can go back to the client and tell them we will need to build a custom list to support this because the OOB external list and custom fields and custom field types won't support this kind of nested listing.
I decided to set up the custom field as a string and when I get my collection in from the BdcModel I am serializing it to JSON and then passing it to the field. When the field is viewed in display, edit or new I have overridden the FieldRenderingControl and I am tiling the collection out that way.

Resources