Skip to content

Instantly share code, notes, and snippets.

@gabriel-lee
Created February 7, 2014 16:51
Show Gist options
  • Save gabriel-lee/8866728 to your computer and use it in GitHub Desktop.
Save gabriel-lee/8866728 to your computer and use it in GitHub Desktop.
addDepartment test script
import com.liferay.portal.model.Organization;
import com.liferay.portal.service.OrganizationLocalServiceUtil;
import com.liferay.portal.util.PortalUtil;
import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.model.User;
import com.liferay.portal.service.UserLocalServiceUtil;
long companyId = PortalUtil.getDefaultCompanyId();
Organization organization = OrganizationLocalServiceUtil.getOrganization(companyId, "Gabriel Test 1 Company 2-6-14");
User user = UserLocalServiceUtil.getUserByScreenName(companyId, "sdsg_test");
PortletBeanLocatorUtil.locate("noa-omas-portlet", "com.nintendo.tpt.security.omas.service.OmasLocalService").addDepartment(companyId, organization, "", user.getUserId(), "TEST");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment