how to make dynamic change in worlflow definition - liferay

I am using liferay 6.1.1CE.
Am using kaleo as my workflow engine.
As of my knowledge,the workflow is uploaded as a xml file . and i did that(upload a workflow with 2 levels of approvel).
my question is, can we dynamically change the roles,user ids in that workflow through a user interface that is provided to a particular user in my portal?
2ng thing is
for eg: i have a portlet that is common to all users,In my portal 2 user groups are there.
Different approval criteria for both groups.
so i can create two type of workflow for the two groups.
my question is,based on the user ( in which group) can i redirect the portlet to the corresponding workflow...?
share your suggestions..Is it possible or not?

Related

Add new fields to create_account.jsp without custom fields functionality in Liferay

I want to add 15 new fields to my user account creation page in Liferay. How it is possible other than custom fields, expando tables? Because I know how to use custom fields. I have more fields so it will be difficult to manage. Through hook I want to add more fields to account creation page.
Fields are related to user.
Create one selectbox that will have list of organizations available in my application.
Create one selectbox that will have list of roles available in my application.
onclicking of save button that should redirect to 3rd party payment gateway. Once paid amount it will create account for that user.
After paid amount all the above fields need to add under extra table with related columns and maps to the user_ table with userId as a primary key.
assign that organization to the user which is selected above and similar for role also.
I am using Liferay 6.2. Please let me know if any one have any ideas!
Learn Java. A modification of the platform to the extent that you're mentioning won't work without knowing Java. You'll introduce all kinds of issues in your system.
Then there are two options:
Just implement a custom portlet that takes all the values that you want, saves them where you want and queues them in your payment system. Disable Liferay's "do-it-yourself-signup" and place your own links to the "create account" portlet. This will be easiest to maintain
Alternatively, override Liferay's JSP that's used for the "create account" UI as well as the action that's handling the data. The default implementation would save everything in Liferay's database - including custom fields. As you implement it yourself, you can do whatever you want with this data.

How can I fetch the existing table data in aportlet

I am trying to create the user by site admin so I have created a portlet which has basic user details form and in the action class I called the UserLocalServiceUtil.adduser(). Now the values are inserting into the DB in USER_. Now I want to display the list of created users by only site admin how can I do that? I have the following queries.
1) How can I fetch the values from USER_ in my portlet. Do I need to create the service builder OR are there API methods to fetch the values from the USER_ table?
2) I want to display only the users list which is created by site admin in my portlet. I don't want to display the whole company list of users. So How can I achieve this?
Suggest me any references or guidelines to do this.
Your help will be very much appreciated.
For Q1 :
http://cdn.docs.liferay.com/portal/6.1/javadocs/com/liferay/portal/service/UserLocalServiceUtil.html#getUsers(int, int)
This might help you. You don't need service builder for that. Just create a simple Liferay MVC portlet and call the relevant methods.
for Q2 : I don't think this would be possible by API methods. What you can do is to set an expando variable for user at time of creation by site-admin. And # time of fetching users, you can cross-check the value of that field manually.
EDIT :
One more point for suggestion : Never create user with Site-Admin role for user creation. This role is supposed to manage site & user assignment to the site. You can use more appropriate role i.e. Org-Admin rather than site-Admin.
How to set an expando variable while adding the user?
Liferay provides Expando API interface, which you can use while creation of user in your portlet. refer following links Developing with Expando, Liferay Expando API
I hope this would be helpful to you.

how to change share point workflow are complete

In SharePoint 2010, i created an info path form and submitted it to SharePoint.
With Microsoft SharePoint designer i created a workflow for this form.
At this workflow I implemented removing permission from some group and getting contribute access to 2 person.
Now after 3 month, there are 450 item in form library.
And i want to add another person to (2 persons) that have contribute access.
So, i changed workflow in SharePoint designer.
It is correct for new items that created after this time. but i want this new workflow set to old item that before 3 month created!
how can I do that?
If I've understood the question correctly. That you want to add the new person to the existing permissions. Then don't do it through workflow.
Assuming that your 450 forms mean that there are 450 groups that need to be changed, the easiest way is to create a list of the group names and use PowerShell to add the new user to all of the groups.
Better still if you can, would be to create an Active Directory Security Group with the 3 people in it and apply that to all of the SharePoint groups. Then you will never have to go through the same exercise again as you can simply change the AD group and the SharePoint groups will all be correct.

SharePoint 2010 - Three-State ootb Workflow with multiple user for a step?

I want to use the three state out of the box workflow in SharePoint 2010.
My problem is now, that I only can assign a task to one user for a step (It is not possible to add a second person in this field)
Is there any way to assign a task to a group? Like a exchange group or something else?
You are correct that multiple users are not allowed for the field. But you can assign the respective task to an Active Directory group. If you would want more customization you would need to implement the workflow yourself.

Hierarchical expiration policies on individual items

I am looking to implement a custom policy for item expiration on a custom list (not a document library).
This policy must be editable on an item-per-item basis, and compute the expiration date based on user-defined rules such as: number of accesses, expiration timespan, or any aggregation of the two rules above. Because of this granularity, I cannot use the default expiration policies model (or implement a custom one), nor the default audit in my expiration policy.
As the items are organized in folders and subfolders, I would like to apply the policies hierarchically (similar to the OOTB permission model).
My solution would be to create custom content types for the folders and the items in order to include a column which will hold the serialized rules, while the access to this "rules" field would be synchronized manually from code. A custom Infopath form would be used to edit the attached rules for each entry in the list (be it Folder or Item), and this data would be used by a custom application page to grant access to the item or not (based on additional item fields, it also does the actual job for each item).
While I am not exactly sure the above solution would be approved (company policy might forbid me to edit toe Global.asax file for the synchronization scheme), I am wondering if anyone may come with a better architecture for this requirement?
Ok, I will give it a shot. First, I would forget about InfoPath and go for a custom ASPX page for configuring policies. The whole project should be packaged in a WSP solution with the following ingredients:
Policy configuration aspx page in the _layouts folder. This page should enable users to create and edit policies for lists, folders and items. The page could in turn serialize and store rules in the property bag on list items. For list level rules, use the SPWeb property bag. Alternatively, create a hidden list where all rules are stored in XML files associated with a list, folder or item.
Site Collection Feature that adds Custom Actions to your custom list for adding and editing policies. You could add a custom action like "Edit Policy" to the ECB menu on folders and items. For list level policies, you add a similar action to the list actions menu.
SharePoint Timer Job for enforcing the policies. Use a farm level feature to install the timer job in a feature receiver on activation.
No matter what, I think you will face a fair amount of development effort.

Resources