diff --git a/pom.xml b/pom.xml index b45e288..8326bad 100644 --- a/pom.xml +++ b/pom.xml @@ -89,22 +89,6 @@ aslcore provided - - org.gcube.common - home-library - provided - - - asm-all - asm - - - - - org.gcube.common - home-library-jcr - provided - org.gcube.dvos usermanagement-core @@ -167,58 +151,12 @@ resource-sweeper-widget [2.2.0-SNAPSHOT, 3.0.0-SNAPSHOT) - - org.gcube.portlets.admin - software-upload-wizard - [1.1.0-SNAPSHOT, 2.0.0-SNAPSHOT) - - - - com.google.guava - guava - provided - - - com.google.inject - guice - ${guice.version} - compile - - - com.google.inject.extensions - guice-servlet - ${guice.version} - compile - - - - net.customware.gwt.dispatch - gwt-dispatch - 1.2.0 - - - javax.mail - javax.mail-api - 1.4.5 - com.liferay.portal portal-service provided - - com.liferay.portal - util-bridges - ${liferay.version} - provided - - - com.liferay.portal - util-taglib - ${liferay.version} - provided - com.liferay.portal util-java diff --git a/src/main/java/org/gcube/portlets/admin/resourcemanagement/client/views/resourcedetails/ResourceDetailsPanel.java b/src/main/java/org/gcube/portlets/admin/resourcemanagement/client/views/resourcedetails/ResourceDetailsPanel.java index c9233ad..46360ff 100644 --- a/src/main/java/org/gcube/portlets/admin/resourcemanagement/client/views/resourcedetails/ResourceDetailsPanel.java +++ b/src/main/java/org/gcube/portlets/admin/resourcemanagement/client/views/resourcedetails/ResourceDetailsPanel.java @@ -25,8 +25,6 @@ import org.gcube.portlets.admin.resourcemanagement.client.utils.OpCommands; import org.gcube.portlets.admin.resourcemanagement.client.widgets.console.ConsoleMessageBroker; import org.gcube.portlets.admin.resourcemanagement.client.widgets.registry.UIIdentifiers; import org.gcube.portlets.admin.resourcemanagement.client.widgets.registry.WidgetsRegistry; -import org.gcube.portlets.admin.software_upload_wizard.client.AppController; -//import org.gcube.portlets.admin.software_upload_wizard.client.AppController; import org.gcube.resourcemanagement.support.client.utils.StatusHandler; import org.gcube.resourcemanagement.support.client.views.ResourceTypeDecorator; import org.gcube.resourcemanagement.support.shared.operations.SupportedOperations; @@ -36,7 +34,6 @@ import com.extjs.gxt.ui.client.data.ModelData; import com.extjs.gxt.ui.client.event.BaseEvent; import com.extjs.gxt.ui.client.event.ComponentEvent; import com.extjs.gxt.ui.client.event.Events; -import com.extjs.gxt.ui.client.event.GridEvent; import com.extjs.gxt.ui.client.event.Listener; import com.extjs.gxt.ui.client.store.GroupingStore; import com.extjs.gxt.ui.client.store.ListStore; @@ -53,7 +50,6 @@ import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem; import com.extjs.gxt.ui.client.widget.toolbar.ToolBar; import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.RunAsyncCallback; -import com.google.gwt.event.shared.HandlerManager; import com.google.gwt.user.client.Window; /** @@ -317,37 +313,6 @@ public class ResourceDetailsPanel { doDeploy.setToolTip("Get report for submitted deployment"); this.getToolBar().add(doDeploy); } - - // Adds toolbar button for software upload wizard (SUW) - if (resType.equals(ResourceTypeDecorator.Service.name()) && - SupportedOperations.SERVICE_DEPLOY.isAllowed(StatusHandler.getStatus().getCredentials())) { - this.getToolBar().add(new SeparatorToolItem()); - ToolButton doAddSoftware = new ToolButton("add-software-icon") { - protected void onClick(final ComponentEvent be) { - super.onClick(be); - GWT.runAsync(AppController.class, new RunAsyncCallback() { - @Override - public void onSuccess() { - String currentScope = StatusHandler.getStatus().getCurrentScope(); - HandlerManager eventBus = new HandlerManager(null); - AppController appViewer = new AppController(eventBus, currentScope); - //AppController appViewer = new AppController(eventBus); - appViewer.go(); - } - - public void onFailure(Throwable reason) { - Window.alert("There are networks problem, please check your connection."); - } - - }); - - }; - }; - doAddSoftware.setToolTip("Upload software"); - this.getToolBar().add(doAddSoftware); - this.getToolBar().add(new SeparatorToolItem()); - } - } public final void setGrid(final Grid grid, final boolean groupingEnabled) { diff --git a/src/main/java/org/gcube/portlets/admin/resourcemanagement/server/gcube/services/MailSender.java b/src/main/java/org/gcube/portlets/admin/resourcemanagement/server/gcube/services/MailSender.java deleted file mode 100644 index e4c3ee4..0000000 --- a/src/main/java/org/gcube/portlets/admin/resourcemanagement/server/gcube/services/MailSender.java +++ /dev/null @@ -1,165 +0,0 @@ -/**************************************************************************** - * This software is part of the gCube Project. - * Site: http://www.gcube-system.org/ - **************************************************************************** - * The gCube/gCore software is licensed as Free Open Source software - * conveying to the EUPL (http://ec.europa.eu/idabc/eupl). - * The software and documentation is provided by its authors/distributors - * "as is" and no expressed or - * implied warranty is given for its use, quality or fitness for a - * particular case. - **************************************************************************** - * Filename: MailSender.java - **************************************************************************** - * @author Daniele Strollo - ***************************************************************************/ - -package org.gcube.portlets.admin.resourcemanagement.server.gcube.services; - -import java.io.File; -import java.util.Date; -import java.util.List; -import java.util.Properties; -import java.util.StringTokenizer; -import java.util.Vector; - -import javax.activation.DataHandler; -import javax.activation.FileDataSource; -import javax.mail.Authenticator; -import javax.mail.Message; -import javax.mail.MessagingException; -import javax.mail.Multipart; -import javax.mail.NoSuchProviderException; -import javax.mail.PasswordAuthentication; -import javax.mail.Session; -import javax.mail.Transport; -import javax.mail.internet.AddressException; -import javax.mail.internet.InternetAddress; -import javax.mail.internet.MimeBodyPart; -import javax.mail.internet.MimeMessage; -import javax.mail.internet.MimeMultipart; - -import org.gcube.resourcemanagement.support.server.utils.ServerConsole; - -/** - * @author Daniele Strollo (ISTI-CNR) - * - */ -public class MailSender { - private static final String LOG_PREFIX = "[RPM-SENDMAIL]"; - - /** - * Given a list of addresses in the form addr1;addr2... - * builds the list of InternetAddress to use to send mail. - * @param toParse a string of email addresses of the form addr1;addr2... - * @return the array of converted valid email addresses - */ - private static InternetAddress[] buildAddress(final String toParse) { - if (toParse == null || toParse.trim().length() == 0) { - return null; - } - - List toReturn = new Vector(); - StringTokenizer parser = new StringTokenizer(toParse, ";"); - while (parser.hasMoreTokens()) { - try { - toReturn.add(new InternetAddress(parser.nextToken())); - } catch (AddressException e) { - ServerConsole.error(LOG_PREFIX, e); - } - } - return toReturn.toArray(new InternetAddress[]{}); - } - - public static void sendMail( - final String sender, - final String target, - final String cc, - final String subject, - final String bodyText, - final String[] attachments) throws Exception { - - if ((target == null || target.trim().length() == 0) - && (cc == null || cc.trim().length() == 0)) { - ServerConsole.warn(LOG_PREFIX, "No valid mail recipients specified."); - return; - } - - Properties properties = new Properties(); - properties.setProperty("mail.transport.protocol", "smtp"); - properties.put("mail.host", "smtp.isti.cnr.it"); - properties.put("mail.port", "587"); - properties.put("mail.auth", "true"); - properties.put("mail.smtps.auth", "true"); - properties.put("mail.smtp.auth", "true"); - - Session session = Session.getDefaultInstance(properties, - new Authenticator() { - public PasswordAuthentication getPasswordAuthentication() { - return new PasswordAuthentication("smtp-user", "UiBe7chae7eh"); - } - }); - Transport transport = null; - try { - transport = session.getTransport(); - } catch (NoSuchProviderException e) { - throw e; - } - - try { - MimeMessage message = new MimeMessage(session); - message.setFrom(new InternetAddress(sender)); - - // MAIL - TO - InternetAddress[] addressTo = MailSender.buildAddress(target); - if (addressTo != null) { - message.setRecipients(Message.RecipientType.TO, addressTo); - } - - // MAIL - CC - InternetAddress[] addressCC = MailSender.buildAddress(cc); - if (addressCC != null) { - message.setRecipients(Message.RecipientType.CC, addressCC); - } - - message.setSubject(subject); - message.setSentDate(new Date()); - - // - // Set the email message text. - // - MimeBodyPart messagePart = new MimeBodyPart(); - messagePart.setText(bodyText); - - // - // Set the email attachment file - // - - Multipart multipart = new MimeMultipart(); - multipart.addBodyPart(messagePart); - - for (String filename : attachments) { - MimeBodyPart attachmentPart = new MimeBodyPart(); - FileDataSource fileDataSource = new FileDataSource(filename) { - @Override - public String getContentType() { - return "application/octet-stream"; - } - }; - attachmentPart.setDataHandler(new DataHandler(fileDataSource)); - attachmentPart.setFileName(new File(filename).getName()); - multipart.addBodyPart(attachmentPart); - } - - message.setContent(multipart); - - transport.connect(); - // FIXME waiting new mail implementation (skipping liferay mail.jar) with CC support. - transport.sendMessage(message, - message.getRecipients(Message.RecipientType.TO)); - transport.close(); - } catch (MessagingException e) { - e.printStackTrace(); - } - } -} diff --git a/src/main/resources/org/gcube/portlets/admin/resourcemanagement/ResourceManagementPortlet.gwt.xml b/src/main/resources/org/gcube/portlets/admin/resourcemanagement/ResourceManagementPortlet.gwt.xml index 862221b..47eb9e2 100644 --- a/src/main/resources/org/gcube/portlets/admin/resourcemanagement/ResourceManagementPortlet.gwt.xml +++ b/src/main/resources/org/gcube/portlets/admin/resourcemanagement/ResourceManagementPortlet.gwt.xml @@ -9,9 +9,6 @@ - - diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 1f17b3d..9e062fb 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -26,20 +26,6 @@ /resourcemanagementportlet/sweeper - - - - guiceFilter - com.google.inject.servlet.GuiceFilter - - - guiceFilter - /* - - - org.gcube.portlets.admin.software_upload_wizard.server.BootstrapListener - - AuthFilter