use of com.liferay.ide.project.core.PluginsSDKBundleProject in project liferay-ide by liferay.
the class ProjectUtil method is7xServerDeployableProject.
public static boolean is7xServerDeployableProject(IProject project) {
ILiferayProject liferayProject = LiferayCore.create(project);
if (liferayProject instanceof IBundleProject) {
if (liferayProject instanceof PluginsSDKBundleProject) {
PluginsSDKBundleProject sdkProject = (PluginsSDKBundleProject) liferayProject;
SDK sdk = sdkProject.getSDK();
if (sdk != null) {
IPath location = sdkProject.getProject().getLocation();
String projectType = getLiferayPluginType(location.toPortableString());
Version version = new Version(sdk.getVersion());
Version sdk70 = ILiferayConstants.V700;
if ((CoreUtil.compareVersions(version, sdk70) >= 0) && !ISDKConstants.EXT_PLUGIN_PROJECT_FOLDER.equals(projectType)) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
return true;
}
} else {
return false;
}
}
use of com.liferay.ide.project.core.PluginsSDKBundleProject in project liferay-ide by liferay.
the class ThemePluginFacetInstall method execute.
@Override
public void execute(IProject project, IProjectFacetVersion fv, Object config, IProgressMonitor monitor) throws CoreException {
super.execute(project, fv, config, monitor);
IDataModel model = (IDataModel) config;
IDataModel masterModel = (IDataModel) model.getProperty(FacetInstallDataModelProvider.MASTER_PROJECT_DM);
if ((masterModel != null) && masterModel.getBooleanProperty(CREATE_PROJECT_OPERATION)) {
/*
* // get the template zip for theme and extract into the project
* SDK sdk = getSDK(); String themeName =
* this.masterModel.getStringProperty( THEME_NAME ); // FIX IDE-450
* if( themeName.endsWith( ISDKConstants.THEME_PLUGIN_PROJECT_SUFFIX
* ) ) { themeName = themeName.substring( 0, themeName.indexOf(
* ISDKConstants.THEME_PLUGIN_PROJECT_SUFFIX ) ); } // END FIX
* IDE-450 String displayName = this.masterModel.getStringProperty(
* DISPLAY_NAME ); IPath newThemePath = sdk.createNewThemeProject(
* themeName, displayName ); processNewFiles( newThemePath.append(
* themeName + ISDKConstants.THEME_PLUGIN_PROJECT_SUFFIX ) ); //
* cleanup files FileUtil.deleteDir( newThemePath.toFile(), true );
*/
// IDE-1122 SDK creating project has been moved to Class
// NewPluginProjectWizard
String themeName = this.masterModel.getStringProperty(THEME_NAME);
IPath projectTempPath = (IPath) masterModel.getProperty(PROJECT_TEMP_PATH);
processNewFiles(projectTempPath.append(themeName + ISDKConstants.THEME_PLUGIN_PROJECT_SUFFIX));
FileUtil.deleteDir(projectTempPath.toFile(), true);
// End IDE-1122
// delete META-INF
CoreUtil.deleteResource(project.findMember(ISDKConstants.DEFAULT_DOCROOT_FOLDER + "/META-INF"));
} else if (shouldSetupDefaultOutputLocation()) {
setupDefaultOutputLocation();
}
if (shouldConfigureDeploymentAssembly()) {
// IDE-565
configureDeploymentAssembly(IPluginFacetConstants.PORTLET_PLUGIN_SDK_SOURCE_FOLDER, DEFAULT_DEPLOY_PATH);
}
IWebProject lrproject = new PluginsSDKBundleProject(project, null);
IResource libRes = lrproject.findDocrootResource(new Path("WEB-INF/lib"));
if (FileUtil.exists(libRes)) {
IFolder libFolder = (IFolder) libRes;
IResource[] libFiles = libFolder.members(true);
if (ListUtil.isEmpty(libFiles)) {
libRes.delete(true, monitor);
}
}
if (shouldUpdateBuildXml()) {
updateBuildXml(project);
}
if (shouldInstallThemeBuilder()) {
installThemeBuilder(this.project);
}
try {
this.project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
} catch (Exception e) {
ThemeCore.logError(e);
}
}
use of com.liferay.ide.project.core.PluginsSDKBundleProject in project liferay-ide by liferay.
the class LayoutTplPluginFacetInstall method execute.
@Override
public void execute(IProject project, IProjectFacetVersion fv, Object config, IProgressMonitor monitor) throws CoreException {
super.execute(project, fv, config, monitor);
IDataModel model = (IDataModel) config;
IDataModel masterModel = (IDataModel) model.getProperty(FacetInstallDataModelProvider.MASTER_PROJECT_DM);
if ((masterModel != null) && masterModel.getBooleanProperty(CREATE_PROJECT_OPERATION)) {
String layoutTplName = this.masterModel.getStringProperty(LAYOUTTPL_NAME);
IPath projectTempPath = (IPath) masterModel.getProperty(PROJECT_TEMP_PATH);
processNewFiles(projectTempPath.append(layoutTplName + ISDKConstants.LAYOUTTPL_PLUGIN_PROJECT_SUFFIX));
FileUtil.deleteDir(projectTempPath.toFile(), true);
} else if (shouldSetupDefaultOutputLocation()) {
setupDefaultOutputLocation();
}
removeUnneededClasspathEntries();
IFolder folder = new PluginsSDKBundleProject(project, null).getDefaultDocrootFolder();
if (FileUtil.exists(folder)) {
IResource libRes = folder.findMember("WEB-INF/lib");
if (FileUtil.exists(libRes)) {
IFolder libFolder = (IFolder) libRes;
IResource[] libFiles = libFolder.members(true);
if (ListUtil.isEmpty(libFiles)) {
libRes.delete(true, monitor);
}
}
}
try {
this.project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
} catch (Exception e) {
LayoutTplCore.logError(e);
}
}
Aggregations