Unable to add a custom attribute to User model in Liferay - liferay

I have a task at hand where I need to add an attribute (Home Page) to user model without making changes in liferay source code i.e. modifying the service.xml and regenerating the service.
I searched a lot on this but nothing seems to work. Used hook to override the create account page and all. Does anyone has step by step solution for this?
Only the steps will do as I just need guidance on this.
Thanks
Mohit

I think you should be able to add custom attributes just by using the control panel.
This link should give you an idea.

Related

Adding content to dashboard of liferay user other than admin

I am new to using Liferay, and practicing currently on Liferay DXP. I have created various user, and wanted to add different content to dashboard of any user. Such as asset publisher which will list all the assets published by that user. I am able to add this modified content only for Admin User. I am not able to find any setting where I can change the look and feel of dashboard for every user.
Can anyone please help me where I can find it? It might be pretty simple but I am unable to find it.
Thank you in advance for helping me.
You can look at the ADT. Modify the templates as per requirement and on user roles. You won't be able to deliver content as per individual user but to roles. You can also have portlet preferences to show different content on different criteria. This all is possible. You will have to study the subject more. It will be very difficult to detail out the whole stuff here. But yes with ADT in Liferay 7 / DXP you have a lot of flexibility.

How to secure content in Orchard CMS

I'd like to use the roles and membership ability of Orchard CMS to limit access to a staff portal in Orchard CMS. At present there doesn't look like there's an out of the box way to do it.
I've found numerous references to modules that should be able to help out but none seem to work.
Very Simple Permissions is a codeplex item suggested by some that has a dead link nowadays and doesn't seem to exist on codeplex.
Science Project: Quanta destroys my site everytime I try to install it with a missing dll issue, and not sure if its what I need anyways.
Does anyone have any guidance as to how to either: show/hide menu items based on roles using the standard menu system or advanced menu plugin
or
limit content visibility based on roles. If its a module fantastic, otherwise don't mind getting my hands dirty with some coding but a point in the right way to do this mvc style would be great. I'm going to presume I need to edit the controller for the menu module to check for current membership and adjust the view data accordingly. I'm moving away from webforms. slowly. Still getting my head around the framework.
Thanks for checking in.
For those who are still struggling with this, there's a module is called ContentPermissions which is available here:
gallery.orchardproject.net/List/Modules/Orchard.Module.Orchard.ContentPermissions
Once installed, you can then add the ContentPermissionsPart to the Content Type you want to secure.
Quanta really is what you want. You are probably missing one of its dependencies. Pete, the author, is also super-active on the CodePlex forums so if you ask there, you'll get an answer.
UPDATE: Orchard 1.5.1, the current version as I'm writing this update, supports content item permissions and menu trimming out of the box.

Custom newsbsite.aspx and custom webtmplates (sharePoint)

I have created new aspx file within a module which I am going to use it as instead of newsbsite.aspx for create workspaces. I have deployed it and I can browse to it via my custom action link (site settings).
I have my own webtemplates.
What I want to do is using mynewsbsite.aspx to show only my webtemplates (not others) and implement permision inheritance and all other staff you can find in the original newsbsite.aspx. but I cann't.
is there anybody who can help me with this problem? thank you so much.
Use SPWeb.GetAvailableWebTemplates Method (UInt32) to get all the templates and filter out the out of the box ones.
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spwebtemplate(v=office.12).aspx

liferay login programmatically

I'm trying to create a custom login portlet for liferay because I also need to do some other things such as logging. However the problem I've stumbled on is that the portal-impl.jar seems to be shielded off so I can't use the loginutil class.
Now I don't want to modify how the actual login works so this is quite a bummer.
I've read something about being able to use something like ext(the explanation was quite vague) but that didn't seem like the cleanest solution.
I've got some experience at developing portlets, but I'm new at developing for liferay.
creating an "ext plugin", as it is called, is the best way to solve your problem.
This part of the documentation should be your first step.
First, you should identify in the portal.properties the properties to modify : be it another autologin in the pipeline, or an action triggered by the login action. I often use the first one for custom SSO actions, and the latter for auditing purposes.
Then create an ext plugin with your custom class (extending loginutil, for example) and create embed the portal-ext.properties needed to reference it.
That way, you should be able to have a clean package to deploy and undeploy ; customizing the jsps of the login portlet can also be done.
Arnaud
Why do you want to use the LoginUtil class?
If you really just want to add logging to the login you can maybe just create a post-login hook. This hook will intercept each user login so you can do your custom logic such as adding some logging with the user's information.
The advantage of this approach is that your code is completely separated from Liferay.

sharepoint document visiblity based on user contribution to library

We have a doc library, Requirement is that only the user who has contributed to the document should be able to see the document and other user who has access to the library should not see that.
Can you please help me to achieve this.
Update: I talked to my TL he said, we need multiple Views on the Doc Library. Any one with new Ideas?
Add a custom view to the document library that only displays the items if the current user == creator of the document.
Set this view as the default view.
Prohibit users from changing the view.
If you are after a true permission based solution, you could develop a event handler for the adding item handler that sets the permission on the newly created item.
(By breaking parent inheritance also)
Set only permissions (owner) for the user that created the item.
EDIT: Just re-read your question. I didn't understand correctly. I missed the "contribution" part. Anyway, I will let my answer be here.
Adding a view is not really good practice. If one want's to gain access to the data he can do so by working with the lists web service. the solution is much simpler then it seems.
1. you need to install this: http://spdactivities.codeplex.com/.
This add-on will add you work flow activities to the SP Designer.
2. create a workflow doing what you described. It will take you no more then 10 minutes.
That's it :)

Resources