Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Commit

Permalink
Check smtp setting for the community edition
Browse files Browse the repository at this point in the history
  • Loading branch information
hainguyen committed Apr 11, 2015
1 parent 80aeda1 commit 6ab1457
Show file tree
Hide file tree
Showing 28 changed files with 217 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,3 @@ public static String getString(String key, String defaultValue) {
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.esofthead.mycollab.module.project.ProjectTypeConstants;
import com.esofthead.mycollab.test.DataSet;
import com.esofthead.mycollab.test.service.IntergrationServiceTest;
import com.zaxxer.hikari.pool.HikariPool;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -37,6 +38,7 @@ public class MonitorServiceTest extends IntergrationServiceTest {
@Test
@DataSet
public void testSaveBatchMonitor() {
HikariPool a;
MonitorItem mon1 = new MonitorItem();
mon1.setMonitorDate(new GregorianCalendar().getTime());
mon1.setSaccountid(1);
Expand Down
4 changes: 2 additions & 2 deletions mycollab-test/src/main/resources/mycollab.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ db.username=root
db.password=esofthead321

mail.smtphost=
mail.port=
mail.port=1
mail.username=
mail.password=
mail.isTLS=
Expand All @@ -22,4 +22,4 @@ app.url=http://localhost:8080/mycollab-web/
# CLOUD DRIVE INTEGRATION
#==================================
dropbox.callbackUrl=http://localhost:8080/mycollab-web/drive/dropboxAuth
ggDrive.callbackUrl=http://localhost:8080/mycollab-web/drive/googleAuthServlet
ggDrive.callbackUrl=http://localhost:8080/mycollab-web/drive/googleAuthServlet
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
*
*/
public class ViewManager {

protected static Set<Class<?>> viewClasses;

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,4 @@ public String getCandidateTextFieldName() {
public void refreshSectionLayout(DynaSection section) {

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* This file is part of mycollab-web.
*
* mycollab-web is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* mycollab-web is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with mycollab-web. If not, see <http://www.gnu.org/licenses/>.
*/
package com.esofthead.mycollab.common.ui.components.notification;

import com.esofthead.mycollab.common.ui.components.AbstractNotification;
import com.esofthead.mycollab.shell.view.SmtpConfigurationWindow;
import com.vaadin.ui.*;
import org.vaadin.maddon.layouts.MHorizontalLayout;

/**
* @author MyCollab Ltd
* @since 5.0.4
*/
public class SmtpSetupNotification extends AbstractNotification {

public SmtpSetupNotification() {
super(AbstractNotification.WARNING);
}

@Override
public Component renderContent() {
MHorizontalLayout layout = new MHorizontalLayout();
layout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
Button smtpBtn = new Button("Setup", new Button.ClickListener() {
@Override
public void buttonClick(Button.ClickEvent clickEvent) {
UI.getCurrent().addWindow(new SmtpConfigurationWindow());
}
});
smtpBtn.setStyleName("link");
layout.with(new Label("You did not set up a SMTP account yet."), smtpBtn);
return layout;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* This file is part of mycollab-web.
*
* mycollab-web is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* mycollab-web is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with mycollab-web. If not, see <http://www.gnu.org/licenses/>.
*/
package com.esofthead.mycollab.module.project.ui.components;

import com.esofthead.mycollab.module.project.view.ProjectView;
import com.esofthead.mycollab.vaadin.mvp.AbstractPageView;

/**
* @author MyCollab Ltd
* @since 5.0.4
*/
public class TransparentContainer extends AbstractPageView {
private ProjectView host;

public ProjectView getHost() {
return host;
}

public void setHost(ProjectView host) {
this.host = host;
}

public TransparentContainer navigateToContainer(String viewId) {
return (TransparentContainer) host.gotoSubView(viewId);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* This file is part of mycollab-web.
*
* mycollab-web is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* mycollab-web is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with mycollab-web. If not, see <http://www.gnu.org/licenses/>.
*/
package com.esofthead.mycollab.module.project.view;

import com.esofthead.mycollab.vaadin.mvp.PageView;
import com.esofthead.mycollab.vaadin.ui.AbstractPresenter;

/**
* @author MyCollab Ltd
* @since 5.0.4
*/
public abstract class ProjectGenericPresenter<V extends PageView> extends AbstractPresenter<V> {
public ProjectGenericPresenter(Class<V> viewClass) {
super(viewClass);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@
* You should have received a copy of the GNU General Public License
* along with mycollab-web. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* This file is part of mycollab-web.
* <p>
* mycollab-web is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* mycollab-web is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with mycollab-web. If not, see <http://www.gnu.org/licenses/>.
*/
package com.esofthead.mycollab.module.project.view;

import com.esofthead.mycollab.common.GenericLinkUtils;
Expand All @@ -29,6 +45,7 @@
import com.esofthead.mycollab.module.project.i18n.*;
import com.esofthead.mycollab.module.project.service.ProjectService;
import com.esofthead.mycollab.module.project.ui.ProjectAssetsManager;
import com.esofthead.mycollab.module.project.ui.components.TransparentContainer;
import com.esofthead.mycollab.module.project.view.bug.TrackerPresenter;
import com.esofthead.mycollab.module.project.view.file.FilePresenter;
import com.esofthead.mycollab.module.project.view.message.MessagePresenter;
Expand Down Expand Up @@ -424,7 +441,11 @@ public void onClose(

@Override
public Component gotoSubView(String viewId) {
return myProjectTab.selectTab(viewId);
Component comp = myProjectTab.selectTab(viewId);
if (comp instanceof TransparentContainer) {
((TransparentContainer) comp).setHost(this);
}
return comp;
}

private void buildComponents() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package com.esofthead.mycollab.module.project.view.message;

import com.esofthead.mycollab.vaadin.mvp.AbstractPageView;
import com.esofthead.mycollab.module.project.ui.components.TransparentContainer;
import com.esofthead.mycollab.vaadin.mvp.ViewComponent;

/**
Expand All @@ -26,6 +26,6 @@
* @since 1.0
*/
@ViewComponent
public class MessageContainer extends AbstractPageView {
public class MessageContainer extends TransparentContainer {
private static final long serialVersionUID = 1L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.esofthead.mycollab.module.project.CurrentProjectVariables;
import com.esofthead.mycollab.module.project.ProjectRolePermissionCollections;
import com.esofthead.mycollab.module.project.ProjectTypeConstants;
import com.esofthead.mycollab.module.project.domain.Message;
import com.esofthead.mycollab.module.project.domain.criteria.MessageSearchCriteria;
import com.esofthead.mycollab.module.project.service.MessageService;
Expand All @@ -41,6 +42,7 @@
public class MessageListPresenter extends AbstractPresenter<MessageListView>
implements ListCommand<MessageSearchCriteria> {
private static final long serialVersionUID = 1L;

private MessageSearchCriteria searchCriteria;

public MessageListPresenter() {
Expand Down Expand Up @@ -83,6 +85,7 @@ protected void onGo(ComponentContainer container, ScreenData<?> data) {
breadCrumb.gotoMessageList();

MessageContainer messageContainer = (MessageContainer) container;
messageContainer.navigateToContainer(ProjectTypeConstants.MESSAGE);
messageContainer.removeAllComponents();
messageContainer.addComponent(view.getWidget());
doSearch((MessageSearchCriteria) data.getParams());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.esofthead.mycollab.eventmanager.EventBusFactory;
import com.esofthead.mycollab.module.project.CurrentProjectVariables;
import com.esofthead.mycollab.module.project.ProjectRolePermissionCollections;
import com.esofthead.mycollab.module.project.ProjectTypeConstants;
import com.esofthead.mycollab.module.project.domain.SimpleMessage;
import com.esofthead.mycollab.module.project.events.MessageEvent;
import com.esofthead.mycollab.module.project.service.MessageService;
Expand Down Expand Up @@ -98,6 +99,7 @@ protected void onGo(ComponentContainer container, ScreenData<?> data) {
if (CurrentProjectVariables
.canRead(ProjectRolePermissionCollections.MESSAGES)) {
MessageContainer messageContainer = (MessageContainer) container;
messageContainer.navigateToContainer(ProjectTypeConstants.MESSAGE);
messageContainer.removeAllComponents();
messageContainer.addComponent(view.getWidget());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,29 @@
* You should have received a copy of the GNU General Public License
* along with mycollab-web. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* This file is part of mycollab-web.
* <p>
* mycollab-web is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* mycollab-web is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with mycollab-web. If not, see <http://www.gnu.org/licenses/>.
*/

package com.esofthead.mycollab.module.project.view.milestone;

import com.esofthead.mycollab.eventmanager.EventBusFactory;
import com.esofthead.mycollab.module.project.CurrentProjectVariables;
import com.esofthead.mycollab.module.project.ProjectRolePermissionCollections;
import com.esofthead.mycollab.module.project.ProjectTypeConstants;
import com.esofthead.mycollab.module.project.domain.Milestone;
import com.esofthead.mycollab.module.project.events.MilestoneEvent;
import com.esofthead.mycollab.module.project.service.MilestoneService;
Expand All @@ -38,7 +55,6 @@
* @since 2.0
*/
public class MilestoneAddPresenter extends AbstractPresenter<MilestoneAddView> {

private static final long serialVersionUID = 1L;

public MilestoneAddPresenter() {
Expand All @@ -52,7 +68,7 @@ protected void postInitView() {
private static final long serialVersionUID = 1L;

@Override
public void onSave(final Milestone milestone) {
public void onSave(Milestone milestone) {
int milestoneId = saveMilestone(milestone);
EventBusFactory.getInstance().post(new MilestoneEvent.GotoRead(this, milestoneId));
}
Expand All @@ -67,7 +83,7 @@ public void onCancel() {
}

@Override
public void onSaveAndNew(final Milestone milestone) {
public void onSaveAndNew(Milestone milestone) {
saveMilestone(milestone);
EventBusFactory.getInstance().post(
new MilestoneEvent.GotoAdd(this, null));
Expand All @@ -80,6 +96,7 @@ protected void onGo(ComponentContainer container, ScreenData<?> data) {
if (CurrentProjectVariables
.canWrite(ProjectRolePermissionCollections.MILESTONES)) {
MilestoneContainer milestoneContainer = (MilestoneContainer) container;
milestoneContainer.navigateToContainer(ProjectTypeConstants.MILESTONE);
milestoneContainer.removeAllComponents();
milestoneContainer.addComponent(view.getWidget());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package com.esofthead.mycollab.module.project.view.milestone;

import com.esofthead.mycollab.vaadin.mvp.AbstractPageView;
import com.esofthead.mycollab.module.project.ui.components.TransparentContainer;
import com.esofthead.mycollab.vaadin.mvp.ViewComponent;

/**
Expand All @@ -26,7 +26,7 @@
* @since 1.0
*/
@ViewComponent
public class MilestoneContainer extends AbstractPageView {
public class MilestoneContainer extends TransparentContainer {
private static final long serialVersionUID = 1L;

}
Loading

0 comments on commit 6ab1457

Please sign in to comment.