Dynamic columns in liferay-ui:search-container? - liferay

I have tried the liferay-ui:search-container to fetch and display the database table records on UI in a table/grid format. By using the liferay-ui:search-container I am getting the output as shown below,
I am fetching the USER_ table records in the above screen shot.
Problem:
I wanted to make the grid columns dynamic like, I wanted to enable an option for end user to remove the unwanted columns and add the wanted columns in the respective grid/table.
EX:
In the above screen shot the the following columns are showing in a grid.
First Name, Last Name, Screen Name, Job Title, Organization, User Groups
Now If user wants to remove Job Title and wants to add Greetings and Mail Address columns on UI with click events with out touching/ modifying the code.
How can I implement this feature?
Note:
I need to implement this feature for custom models.
Queries:
1) Is there any api/methods to implement/enable this feature?
2) If not how can I do implement the steps? Any suggestions or steps to achieve this task?

This can be achieved by adding a configuration page to your portlet.
You can develop portlet configuration page which can have required options to be configured and save as portlet preferences.
Later on while displaying the search container you can retrieve the portlet preferences and display only those columns which were selected in the configuration form.
Here is a link on how to develop the portlet configuration using portlet preferences: Implementing Configurable Portlet Preferences

Related

Populate data back to form in Kentico

Here's what I'd like to do but not sure how to. I have a form that's like a typical doctor/school form, where the form has 2 sections: [1] Section 1 at the top is for user (with standard fields like First Name, Last Name etc.), and [2] Section 2 at the bottom is for Admin/Office use only (with fields like Reviewed by, Approved/Not Approved etc.)
what I was able to do is to process Section 1 where I got ALL users' submission and display all their data on a webpage using a RepeaterWithCustomQuery. That's pretty basic. But in order to do what described above, I guess that I'll need to pull the submitted data and populate them back to Section 1 of the form (maybe as readonly data at this time) and then the Office/Admin staff can fill in Section 2.
I hope I made sense and hope that someone can point me to the right direction. I only use Portal Engine, no access to file system or backend.
I think I understand your issue you want to have some sort of an editor for biz form data. Similar to what you have in the admin. And the problem is that you don't have access to backend. :( Such thing is available for custom table data (there is web part), but not for biz form data. There is no ready to use web part. Here is old topic on that https://devnet.kentico.com/questions/how-to-edit-the-information-of-a-record-using-the-bizform-layout.
you want to have something like the admin page for editing form records:
/CMSModules/BizForms/Tools/BizForm_Edit_EditRecord.aspx?formID=7&formRecordID=1
but customized :(. I'd say without back end access the only options I see:
Create a new role "Biz Form Editor" (or use existing) that has rights only to edit biz
form data. So all your people who do "validation" part must have a
Kentico account with role "Biz Form Editor".
Add link above to your repeater with appropriate record id.
P.S. There are special code names for alternative forms (https://docs.kentico.com/k8/configuring-kentico/creating-alternative-forms/code-names-of-automatically-used-alternative-forms). If you create an alternative form with special name update the system will automatically load it when you edit the record.
Not sure that I understood correctly your question. But what you need is to use alternative forms. So the idea is that one form is for "registration" and the 2nd one for "validation".
So in your registration form you show only firstName, lastName etc and you don't show "validation" fields. In the validation form you show firstName, lastname etc as label and show textboxes for validation fields.

Document library properties in sharepoint other than default like Title, Description

Is it possible to add additional properties to a document library in SharePoint using OOTB or Customization?
By default Document library has properties like Title, Description.
I need to add an other custom property in a library level which i can use it for further purpose.
Appreciate your inputs..
Thanks,
Gnanasekhar K
If you want to have metadata for folders/Library, You can look in to "Document Sets"(OOTB)
You can create columns and even run workflows on it.
You can add custom columns to document library. Navigate to document library settings and click on add new column. Or Alternatively click on Create Column option in the ribbon.
Choose the column display name, data type and other properties like default values, choice options etc. (depending upon the type of column you intend to create) and click on OK button.
You would be able to see the column in the default list view. You will also be able to capture the column's value for each document (after you upload it) via Edit properties form.
Refer [this][1] article for more details
For storing metadata for document library, you can use property bags. Property bags can be associated with
farm
web application
site collection
site
list/library
You can do this using
Powershell script
CSOM code
JSOM code

Liferay: Dynamically populate 'select' structure field

I am building a liferay theme, which has two columns side by side. The right column is where the web contents will be displayed.
My implementation aims to build a menu (left column) that gets the titles from the web content titles and builds hierarchy (parent, child) based on a 'select' structure field that I added to each web content.
So far I was able to build this system using
Liferay.Service('/journalarticle/get-articles'...)
and some javascript coding.
Now the 'select' fields i use in my structure have predefined hard coded options.
How can i populate dynamically this option list so that whoever is managing content will automatically have all titles from all web contents available to choose a 'parent' from? So far a developer has to update this option list each time there is a new web content added.
#chadct : AFAIK Liferay not provide this default functionality, this is not good practice to populate dynamically value in structure field. But you wanted to achieve that functionality, then there are 4 solution :
Add one text field in structure which contains articleId of your parent web content.
You can add related article for that web content and write some sort of code to get article which consider as a parent of that web content.
Create Select DOM options form template which hold the list of article according to groupId and render on web content view mode, then you can select parent content from there and update content expando with articleId of parent webcontent. Remember this contains AJAX post request. and only show that control who is admin or loggedin user or depends on Role. Refer AJAX post calling
Hook edit_structure.jsp and add your logic here as you want.
Note : last one is worst but also a solution, Remember you need to modify your current solution.

ExtJs - Allowing user to modify position of form fields using drag and drop

We have been developing our application using ExtJs 4.0.7, and now we have a new feature request which will allow user to set the position of form fields, as per his choice, using drag and drop.
For example, if currently a form has fields arranged in rows, then the user can pick these fields and arrange them in columns, or he can move a field from first row to second etc..
The user is also allowed to save this layout and when he opens the screen again then he gets to see the fields arranged in the same manner he saved.
I have not been able to locate any example in ExtJS carrying such a functionality, so I was wondering if this is possible in ExtJS?
Also, as the user is allowed to save the layout, thus, will this involve storing of ExtJs code in database or dynamic generation of ExtJS code from server side.
Looking forward to guidance at this.
Thanks in advance.
The only example of such a beast I have seen is the Sencha Designer. It saved the complete JSON object that represents the form config ... I suppose it's doable, but good luck :)

Drupal6 - product comparison

Hi
I have not using any shopping cart module, just created a content type (product) and defining several field(attribute) for each product feature.
I want to ask is there any module in Drupal for product comparison or field comparison?
Thanks
No, but there is a way to do it with the Flag module and Views. It will take more work than just turning on a module, but the outcome is the standard product comparison you're looking for. See this article.
The article is no longer online: here the content of the original post.
Ubercart Product Comparison
For me, using Ubercart in Drupal as an e-commerce solution for your website is the way to go. I have been using Ubercart for years now for a number of web design and development projects, and there are a massive amount of contribute modules to beef it up. One feature that I have been keen to work on is a Product Comparison feature, which would allow users to select products and have them display on a page, providing them with a nice and easy layout to easily compare their selected products.
After searching around the web, I found a few articles and posts from people looking for this feature, asking how it could work or if anyone had done it, but couldn’t find anything that said “here it is, this is how it can be done”. So, after a little bit or research and a bit of a play, I have come up with a solution which is not that difficult to achieve and only requires some already existing Drupal modules with just a few tweaks.
Note: This tutorial assumes that you already have a working ecommerce site with Ubercart installed. Best to also try this on a test environment and not a live website.
Step 1. Download Required Modules
Download, install and enable the following modules.
Views (I used 6.x-2.11, I haven’t tested it with any other releases)
Flag (I used 6.x-2.0-beta3, I haven’t tested it with any other releases)
Step 2. Flags configuration – Setting up your “compare”
Once you have enabled the Flags module, go to the flags administration page at /admin/build/flags.
Click the Add link, enter the name of your flag (something like “compare”), and leave the flag type as “node”, and submit.
On the next screen you will need to configure your new flag. Complete the following fields (changing the values if you like). I setup my configuration so only registered users of the website could compare products.
Title – Compare Products
Flag link text – Add to compare
Flagged message - [title] has been added to your compare
Unflag link text – Remove from compare
Unflagged message – [title] has been removed from your compare
Flaggable content – Product
Check “Display login link for anonymous users.” and for anonymous link text add “[login] to add to your compare”
For flag access, check flag and unflag for authenticated users
Under Display options select “Display link on node page” and “JavaScript toggle” as link type
Click submit to save your flag.
With the settings we used, the “flag link text” should now display on your product nodes. Clicking it should make the “flagged message” appear and the link changed to your “unflag link text” using JavaScript.
So what we are doing here is just flagging nodes – it’s actually pretty simple. We are flagging/unflagging them as “compare product”, so you should now be able to (by clicking on the link provided on your products) add and remove products to compare on your website.
Now we have done this, we need to create a page to display our “flagged” products, in which this case is the products we want to compare.
Step 3. Creating out Compare Products Page
Go to the Views Administration page, enabling the Flag module creates a default flag view. You can use this as a reference, or even change this view to what you need, it’s totally up to you. All we need is a view with (at least) the settings explained below.
DEFAULTS
Basic Settings – Use at least the following settings
Title: Product Comparison
Style: Table
Items per page: Unlimited
Access: Authenticated user
Empty text: Full HTML
- You have not yet added any products to compare. Click the “Add to compare” link when viewing a product to add it to this page.
Relationships
Add the following relationship:
Flags: Node flag
- label: compare
- check “Include only flagged content”
- flag: select the flag you created in step 2
- by: current user
Fields – You can put whatever fields here you would like to show up against each product. You must include the Node Title, and ideally you would want to show a thumbnail of the product, its price and description and the unflag link to allow users to remove it from this page. I have the following fields for my compare:
Content Image using an imagecache, linking to product
Node: Title linking to product
Flags: Flag link
- Relationship: select the one you added
Product: Sell Price
Node: Teaser
Filters
Node: Published Yes
AND SAVE
Now add a new page display view and give it a URL, then save. Navigate to your new compare page using the URL you entered. If you haven’t “flagged” any products yet, go do so and once done you should see those products displayed on your Compare Products page!!!
But, there is one slight issue. Because we needed to use Style: Table to get the layout to better suit a compare list, it still doesn’t display it the way we need it too. We want to display each of the products horizontally, with each field label shown on the far left so it is easy to compare our products. To do this we need to retheme the table style for our view.
Step 4. Theme the table output of the view
Under Theme: Information for our view, it displays a list of all the possible templates for the display plugin and for the style plugins. Look for the list titled Style output. This is what we want. It lists the possible templates we can use to change the theming of the style output. The first one it displays is the generic template for the table style output but we don’t want to use this one, because if we do we could effect any other table style view that may be on the site. So best to use the next one across, mine was called views-view-table–flag-compare.tpl.php.
Create a new php file and name the file to the template name you want to use. In my case my file is named views-view-table–flag-compare.tpl.php.
Paste the Drupal 6 code from here http://drupal.org/node/174578 into your template file.
Then place the file in your themes directory – and presto! Your comparison table should be laid out more like a comparison style grid. Below is a screenshot of what my Comparison page looks like after a little bit of extra styling.
Try this module: https://drupal.org/project/comparison
Allows the comparison of the attributes of two or more nodes by generating a table. A checkbox is added to nodes to allow them to be included in the comparison. If two or more nodes are selected a link is added to a page with a comparison table.

Resources