Foren

Module is not deploying in Ubuntu

Thirumal Reddy, geändert vor 7 Jahren.

Module is not deploying in Ubuntu

Regular Member Beiträge: 216 Beitrittsdatum: 03.12.15 Neueste Beiträge
Hi All,
I have created basic LR 7 GA2 setup in Ubuntu after that i have created new liferay workspace by running blade init [work space] after that i created a gust book module in side modules folders and it was success full.
now i moved to root folder of guest book module i run gradle deploy cmd then i got BUILD FAILED.
and showing log
FAILURE: Build failed with an exception.

Where:
Settings file '/opt/example/osgi/settings.gradle' line: 13

What went wrong:
A problem occurred evaluating settings 'osgi'.

Cannot apply plugin with id 'com.liferay.workspace' to 'settings 'osgi'' (class: org.gradle.initialization.DefaultSettings_Decorated) as it is not a Project

Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED


this is my settings.gradle file

buildscript {
dependencies {
classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "1.0.40"
}

repositories {
maven {
url "https://cdn.lfrs.sl/repository.liferay.com/nexus/content/groups/public"
}
}
}

apply plugin: "com.liferay.workspace"

it worked fine windows. i'm not getting why it is not working in Ubuntu.
can any one help me..

regards,
Thirumal.
thumbnail
Andy Wu, geändert vor 7 Jahren.

RE: Module is not deploying in Ubuntu

Regular Member Beiträge: 195 Beitrittsdatum: 05.05.15 Neueste Beiträge
hello , Thirumal, which version of gradle do you have ? also , could upload your sample liferay-workspace with the gust book module here and we can try to reproduce your issuse.
Thirumal Reddy, geändert vor 7 Jahren.

RE: Module is not deploying in Ubuntu

Regular Member Beiträge: 216 Beitrittsdatum: 03.12.15 Neueste Beiträge
Hi Andy,
Thanks for your replay.
I resolved that issue,
it was raised because of gradle version.
before i used gradle 1.4 now i am using gradle 3.0.

regards,
Thirumal.
Thirumal Reddy, geändert vor 7 Jahren.

RE: Module is not deploying in Ubuntu

Regular Member Beiträge: 216 Beitrittsdatum: 03.12.15 Neueste Beiträge
Hi Andy Wu,
I want store roles information in some other table for that, at the time creating role it self i need to store that roleId in my table so that i need to implement that logic in RoleAdminPortlet.java class from role admin web module.
In 6.2 we done that through ext but in LR 7,
we know how to add extra logic in MVC Action,render and resource command classes but how can i add my logic in RoleAdminPortlet.java
could you please suggest..?

all plugins migrated to LR7 only at this place i'm struggling from so many days..emoticon

regards,
Thirumal.
thumbnail
Andy Wu, geändert vor 7 Jahren.

RE: Module is not deploying in Ubuntu

Regular Member Beiträge: 195 Beitrittsdatum: 05.05.15 Neueste Beiträge
sorry I am not familiar with it , you can go to develop category to ask some help.
thumbnail
David H Nebinger, geändert vor 7 Jahren.

RE: Module is not deploying in Ubuntu

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
Thirumal Reddy:
I want store roles information in some other table for that, at the time creating role it self i need to store that roleId in my table so that i need to implement that logic in RoleAdminPortlet.java class from role admin web module.
In 6.2 we done that through ext but in LR 7,
we know how to add extra logic in MVC Action,render and resource command classes but how can i add my logic in RoleAdminPortlet.java
could you please suggest..?


Thirumal, I told you this before, it is simply not supported. You can open as many threads as you want, you're not going to receive a different answer from anyone else.

This portlet is wrapped within an OSGi bundle jar with the portlet classes all marked as private. This means you cannot extend them, you cannot override them, you cannot replace them. It is simply impossible because of the nature of what OSGi does.

Now fortunately you've finally indicated what you are trying to do: Store information in another table and need role id. When I need to do this kind of thing, I normally rely on a model listener. The model listener can be invoked after the save so the role ID is available, so you can get access to the role ID here and call out to another service layer.

Another option for this would be a service wrapper around the role service; there you can intercept the add/update methods so you would have visibility over the role id here too.







Come meet me at the LSNA!
Thirumal Reddy, geändert vor 7 Jahren.

RE: Module is not deploying in Ubuntu

Regular Member Beiträge: 216 Beitrittsdatum: 03.12.15 Neueste Beiträge
Hi David,
Thanks for your replay's..
plese see my code snippets,
public class EditRoleActionEXT extends EditRoleAction {

protected void deleteRole(ActionRequest actionRequest) throws Exception {
long roleId = ParamUtil.getLong(actionRequest, "roleId");
// If org.admin wants to delete the organization role then
long orgId = ParamUtil.getLong(
actionRequest, "orgId", 0);
if(orgId>0){
try{
// if records are available then delete
List<Org_Roles> objOrg_RolesList = Org_RolesLocalServiceUtil.getOrg_RolesBasedOnOrganizationIdAndRoleId(orgId,roleId);
if(!objOrg_RolesList.isEmpty()){
Org_RolesLocalServiceUtil.deleteOrg_Roles(objOrg_RolesList.get(0));
}
}catch (Exception objException) {
objException.printStackTrace();
}
// delete the role
RoleServiceUtil.deleteRole(roleId);
}else{
RoleServiceUtil.deleteRole(roleId);
}
}


protected Role updateRole(ActionRequest actionRequest) throws Exception {
long roleId = ParamUtil.getLong(actionRequest, "roleId");

String name = ParamUtil.getString(actionRequest, "name");
System.out.println();
Map<Locale, String> titleMap = LocalizationUtil.getLocalizationMap(
actionRequest, "title");
Map<Locale, String> descriptionMap =
LocalizationUtil.getLocalizationMap(actionRequest, "description");
int type = ParamUtil.getInteger(
actionRequest, "type", RoleConstants.TYPE_REGULAR);
String subtype = ParamUtil.getString(actionRequest, "subtype");
long subTypeId= ParamUtil.getLong(actionRequest, "subtype");
ServiceContext serviceContext = ServiceContextFactory.getInstance(
Role.class.getName(), actionRequest);

long orgId = ParamUtil.getLong(
actionRequest, "orgId", 0);
boolean isPrimary = ParamUtil.getBoolean(actionRequest, "isPrimary");

Role role=null;
int isPrimaryCount = 0;
if(isPrimary){
isPrimaryCount = 1;
}

if (roleId <= 0 && orgId>0) {
role= RoleServiceUtil.addRole(
null, 0, name+StringPool.UNDERLINE+orgId, titleMap, descriptionMap, type, subtype,
serviceContext);

Org_Roles objOrg_Roles = Org_RolesLocalServiceUtil.createOrg_Roles(Org_RolesLocalServiceUtil.getOrg_RolesesCount()+1);
objOrg_Roles.setRoleId(role.getRoleId());
objOrg_Roles.setIsEditable(1);
objOrg_Roles.setOrgId(orgId);
objOrg_Roles.setIsPrimary(isPrimaryCount);
objOrg_Roles.setRoleCategoryId(subTypeId);
System.out.println("update type are "+subtype);
// Creating the record to update the record
Org_RolesLocalServiceUtil.updateOrg_Roles(objOrg_Roles);
return role;

}else if (roleId <= 0){
return RoleServiceUtil.addRole(
null, 0, name, titleMap, descriptionMap, type, subtype,
serviceContext);
}
else if (roleId >= 0 && orgId>0){

List<Org_Roles> objOrg_RolesList = Org_RolesLocalServiceUtil.getOrg_RolesBasedOnOrganizationIdAndRoleId(orgId, roleId);


if(subTypeId != 0){
RoleCategories objRoleCategories = RoleCategoriesLocalServiceUtil.getRoleCategories(subTypeId);
subtype = objRoleCategories.getCategoryName();
}

if(objOrg_RolesList!= null && objOrg_RolesList.size()!= 0){
Org_Roles objOrg_Roles = objOrg_RolesList.get(0);
objOrg_Roles.setRoleCategoryId(subTypeId);
objOrg_Roles.setIsPrimary(isPrimaryCount);
Org_RolesLocalServiceUtil.updateOrg_Roles(objOrg_Roles);
}


return RoleServiceUtil.updateRole(
roleId, name+StringPool.UNDERLINE+orgId, titleMap, descriptionMap, subtype,
serviceContext);
}else{
return RoleServiceUtil.updateRole(
roleId, name, titleMap, descriptionMap, subtype,
serviceContext);
}
}


}


In 6.2 we have done this.

Now in 7 i have done two POC's
service wrapper and ModelListners. those are working.
but i want Organization ID in that
how can i get Organization Id in ModelListener/Service Wrapper.?

Thanks,
Thirumal.