Fórum

Changing User Asset view

thumbnail
Dominique Ebert, modificado 11 Anos atrás.

Changing User Asset view

Junior Member Postagens: 29 Data de Entrada: 01/02/13 Postagens Recentes
Hello everybody!
After my last problem got solved so quickly, I thought I might try to get a solution in this forums for this problem aswell:
I added a User approval Workflow using Kaleo to the liferay registration and everything works pretty fine. During the registration I'm storing additional information apart from the standard information LR asks for in the registration.
Now I want to extend the review view of the user (asset?) in order to display the additional information. In the standard version of the review theres only stuff like the name, surname, email address etc. and I want to extend that view by additional information. How can I achieve that?

Thanks in advance, best regards

Dominique
thumbnail
Dominique Ebert, modificado 11 Anos atrás.

RE: Changing User Asset view

Junior Member Postagens: 29 Data de Entrada: 01/02/13 Postagens Recentes
Nobody has an idea on this? =)
Oliver Bayer, modificado 11 Anos atrás.

RE: Changing User Asset view

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi Dominique,

I've never modified sth. around the workflow process so I can only speek theoretically and give you a few hints emoticon.

My guess would be that you're storing the additional info during registration with custom attributes (expando) for the type user, right? If so the next step would be to identify the jsp displaying the data for the review task. Maybe it's located somewhere in one of the "html \ portlet \ workflow_*" folders. Next you should create a hook and override the jsp. You can access custom attributes by using "userObj.getExpandoBridge().getAttribute("my-additional-attribute")". If I remember rigth there is also a taglib for displaying custom attributes.

It's not much of a solution but I hope you can at least use it to find one emoticon.

Greets Oli
thumbnail
Dominique Ebert, modificado 11 Anos atrás.

RE: Changing User Asset view

Junior Member Postagens: 29 Data de Entrada: 01/02/13 Postagens Recentes
Hi Oli,

Thanks for putting me into a direction, I was kinda helpless, I will try the approach you suggested and post my progress here, maybe I can reveal something for other people with a similiar problem.
thumbnail
Dominique Ebert, modificado 11 Anos atrás.

RE: Changing User Asset view

Junior Member Postagens: 29 Data de Entrada: 01/02/13 Postagens Recentes
Hey Oli!
So I figured out which *.jsp displays the information that I want to extend. But unfortunately the *.jsp just shows a rendered assert, which is kinda what I expected it to do. Conlcuding this I see three options in order to extend the shown information:

1. Extend the Liferay-defined User Assert. But I have no clue wether this is possible nor how this can be achieved.
2. Check for the classname in the *.jsp and if it is " com.liferay.portal.model.User" then render another assert (self-written assert) instead and show it.
3. Check for the classname in the *.jsp and if it's the *.model.User then show additional fields in the *.jsp

What solution would you recommend? Do you see any other approaches to this?

EDIT:

I just came up with another Issue. Writing my own assert an render it instead of the user assert might disturb the workflow process I guess. So this could bring more trouble into this.

Regards and thanks in advance
Oliver Bayer, modificado 11 Anos atrás.

RE: Changing User Asset view

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi Dominique,

thanks for the info.

With "assert" you meen "asset" right emoticon?
I would stick to #3 of the mentioned possibilities. It seems to be -at least for me- the easiest solution without having to change or create java classes. Modifying a jsp can be done with a hook so this approach is hot (un)deployable which I think it's a great benefit. As you're only changing the display of the information and don't change anything in the backend/ service layer... it shouldn't break anything of the workflow process.

Oli
thumbnail
Dominique Ebert, modificado 11 Anos atrás.

RE: Changing User Asset view

Junior Member Postagens: 29 Data de Entrada: 01/02/13 Postagens Recentes
Hey Oli!
Yes that's exactly what I meant.
And for everbody who might come up with the same issue, the jsp which you need to hook in order to modify the asset preview in the "my workflow tasks" portlet is the:
"edit_workflow_tasks.jsp" in /html/portlet/workflow_tasks

And thanks for your help / suggestions