use of com.liferay.ide.portlet.core.dd.LiferayDisplayDescriptorHelper in project liferay-ide by liferay.
the class BasePortletFramework method postProjectCreated.
@Override
public IStatus postProjectCreated(IProject project, String frameworkName, String portletName, IProgressMonitor monitor) {
IStatus status = Status.OK_STATUS;
if (!CoreUtil.isNullOrEmpty(portletName)) {
PortletDescriptorHelper portletDH = new PortletDescriptorHelper(project);
status = portletDH.configurePortletXml(portletName);
if (!status.isOK()) {
return status;
}
LiferayPortletDescriptorHelper liferayPortletDH = new LiferayPortletDescriptorHelper(project);
status = liferayPortletDH.configureLiferayPortletXml(portletName);
if (!status.isOK()) {
return status;
}
LiferayDisplayDescriptorHelper liferayDisplayDH = new LiferayDisplayDescriptorHelper(project);
status = liferayDisplayDH.configureLiferayDisplayXml(portletName);
}
return status;
}
use of com.liferay.ide.portlet.core.dd.LiferayDisplayDescriptorHelper in project liferay-ide by liferay.
the class NewPortletClassDataModelProvider method getCategories.
protected Properties getCategories() {
if (categories == null) {
ILiferayProject liferayProject = LiferayCore.create(getProject());
if (liferayProject == null) {
try {
liferayProject = LiferayCore.create(getRuntime());
} catch (CoreException ce) {
PortletCore.logError(ce);
}
}
ILiferayPortal portal = liferayProject.adapt(ILiferayPortal.class);
if (portal != null) {
categories = portal.getPortletCategories();
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IProject[] workspaceProjects = workspace.getRoot().getProjects();
for (IProject workspaceProject : workspaceProjects) {
if (ProjectUtil.isPortletProject(workspaceProject)) {
LiferayDisplayDescriptorHelper liferayDisplayDH = new LiferayDisplayDescriptorHelper(workspaceProject);
String[] portletCategories = liferayDisplayDH.getAllPortletCategories();
if (ListUtil.isNotEmpty(portletCategories)) {
for (String portletCategory : portletCategories) {
if (_findExistingCategory(portletCategory) == null) {
categories.put(portletCategory, portletCategory);
}
}
}
}
}
}
}
return categories;
}
Aggregations