use of com.liferay.ide.server.core.IPluginPublisher in project liferay-ide by liferay.
the class LiferayPublishHelper method prePublishModule.
public static boolean prePublishModule(ServerBehaviourDelegate delegate, int kind, int deltaKind, IModule[] moduleTree, IModuleResourceDelta[] resourceDelta, IProgressMonitor monitor) {
boolean retval = true;
if (ListUtil.isNotEmpty(moduleTree) && moduleTree[0].getProject() != null) {
IProject project = moduleTree[0].getProject();
IFacetedProject facetedProject = ServerUtil.getFacetedProject(project);
if (facetedProject != null) {
IProjectFacet liferayFacet = ServerUtil.getLiferayFacet(facetedProject);
if (liferayFacet != null) {
String facetId = liferayFacet.getId();
IRuntime runtime = null;
try {
runtime = delegate.getServer().getRuntime();
if (runtime != null) {
IPluginPublisher pluginPublisher = LiferayServerCore.getPluginPublisher(facetId, runtime.getRuntimeType().getId());
if (pluginPublisher != null) {
retval = pluginPublisher.prePublishModule(delegate, kind, deltaKind, moduleTree, resourceDelta, monitor);
}
}
} catch (Exception e) {
// $NON-NLS-1$
LiferayServerCore.logError("Plugin publisher failed", e);
}
}
}
}
return retval;
}
use of com.liferay.ide.server.core.IPluginPublisher in project liferay-ide by liferay.
the class LiferayTomcatUtil method canAddModule.
public static IStatus canAddModule(IModule module, IServer currentServer) {
IProject project = module.getProject();
if (project != null) {
IFacetedProject facetedProject = ProjectUtil.getFacetedProject(project);
if (facetedProject != null) {
IProjectFacet liferayFacet = ProjectUtil.getLiferayFacet(facetedProject);
if (liferayFacet != null) {
String facetId = liferayFacet.getId();
IRuntime runtime = null;
try {
runtime = ServerUtil.getRuntime(project);
} catch (CoreException e) {
}
if (runtime != null) {
IPluginPublisher pluginPublisher = LiferayServerCore.getPluginPublisher(facetId, runtime.getRuntimeType().getId());
if (pluginPublisher != null) {
IStatus status = pluginPublisher.canPublishModule(currentServer, module);
if (!status.isOK()) {
return status;
}
}
}
}
}
}
return Status.OK_STATUS;
}
Aggregations