You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2017/10/11 13:56:59 UTC

[1/2] openmeetings git commit: [OPENMEETINGS-1714] some issues are fixed

Repository: openmeetings
Updated Branches:
  refs/heads/master 29ada0326 -> 8eb27129f


http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentTemplate.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentTemplate.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentTemplate.java
new file mode 100644
index 0000000..5bdcce0
--- /dev/null
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentTemplate.java
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.service.mail.template.subject;
+
+import static org.apache.commons.lang3.time.FastDateFormat.MEDIUM;
+import static org.apache.commons.lang3.time.FastDateFormat.SHORT;
+
+import java.util.Date;
+import java.util.Locale;
+import java.util.TimeZone;
+
+import org.apache.commons.lang3.time.FastDateFormat;
+import org.apache.openmeetings.db.entity.calendar.Appointment;
+import org.apache.openmeetings.service.mail.template.DashOmTextLabel;
+import org.apache.openmeetings.service.mail.template.OmTextLabel;
+import org.apache.wicket.markup.html.WebMarkupContainer;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.panel.Fragment;
+import org.apache.wicket.util.string.Strings;
+
+public abstract class AppointmentTemplate extends SubjectEmailTemplate {
+	private static final long serialVersionUID = 1L;
+	protected Appointment a;
+	protected TimeZone tz;
+
+	public AppointmentTemplate(Locale locale, Appointment a, TimeZone tz) {
+		super(locale);
+		this.a = a;
+		this.tz = tz;
+	}
+
+	@Override
+	protected void onInitialize() {
+		super.onInitialize();
+		add(new Label("title", a.getTitle()));
+		add(new WebMarkupContainer("descContainer")
+				.add(new Label("descLbl", getString("1152", locale)))
+				.add(new Label("desc", a.getDescription()).setEscapeModelStrings(false))
+				.setVisible(!Strings.isEmpty(a.getDescription())));
+		add(new Label("startLbl", getString("1153", locale)));
+		add(new Label("start", format(a.getStart())));
+		add(new Label("endLbl", getString("1154", locale)));
+		add(new Label("end", format(a.getEnd())));
+	}
+
+	abstract String getPrefix();
+
+	@Override
+	Fragment getSubjectFragment() {
+		Fragment f = new Fragment(COMP_ID, "subject", this);
+		f.add(new OmTextLabel("prefix", getPrefix())
+				, new OmTextLabel("title", a.getTitle())
+				, new OmTextLabel("start", format(a.getStart(), SHORT))
+				, new DashOmTextLabel("dash")
+				, new OmTextLabel("end", format(a.getEnd(), SHORT))
+				);
+		return f;
+	}
+
+	protected String format(Date d) {
+		return format(d, MEDIUM);
+	}
+
+	protected String format(Date d, int fmt) {
+		return FastDateFormat.getDateTimeInstance(fmt, fmt, tz, locale).format(d);
+	}
+}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CanceledAppointmentTemplate.html
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CanceledAppointmentTemplate.html b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CanceledAppointmentTemplate.html
deleted file mode 100644
index 6c771c3..0000000
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CanceledAppointmentTemplate.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<html xmlns:wicket="http://wicket.apache.org">
-<wicket:extend>
-	<span wicket:id="titleLbl"></span>&nbsp;<span wicket:id="title"></span>
-	<div wicket:id="descContainer">
-		<br/>
-		<span wicket:id="descLbl"></span><br/>
-		&nbsp;<span wicket:id="desc"></span>
-	</div>
-	<br/>
-	<span wicket:id="startLbl"></span>&nbsp;<span wicket:id="start"></span><br/>
-	<span wicket:id="endLbl"></span>&nbsp;<span wicket:id="end"></span><br/>
-	<span wicket:id="invitorLbl"></span>&nbsp;<span wicket:id="invitor"></span><br/>
-</wicket:extend>
-</html>

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CanceledAppointmentTemplate.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CanceledAppointmentTemplate.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CanceledAppointmentTemplate.java
index 98650d0..fff5902 100644
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CanceledAppointmentTemplate.java
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CanceledAppointmentTemplate.java
@@ -26,38 +26,22 @@ import java.util.TimeZone;
 import org.apache.openmeetings.db.entity.calendar.Appointment;
 import org.apache.openmeetings.db.entity.user.User;
 import org.apache.openmeetings.db.util.LocaleHelper;
-import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.util.string.Strings;
 
-public class CanceledAppointmentTemplate extends AbstractAppointmentTemplate {
+public class CanceledAppointmentTemplate extends InvitedAppointmentTemplate {
 	private static final long serialVersionUID = 1L;
-	private final String invitorName;
 
 	private CanceledAppointmentTemplate(Locale locale, Appointment a, TimeZone tz, String invitorName) {
-		super(locale, a, tz);
-		this.invitorName = invitorName;
+		super(locale, a, tz, invitorName);
 	}
 
 	@Override
 	protected void onInitialize() {
 		super.onInitialize();
 		add(new Label("titleLbl", getString("1157", locale)));
-		add(new Label("title", a.getTitle()));
-		add(new WebMarkupContainer("descContainer")
-			.add(new Label("descLbl", getString("1152", locale)))
-			.add(new Label("desc", a.getDescription()).setEscapeModelStrings(false))
-			.setVisible(!Strings.isEmpty(a.getDescription()))
-			);
-		add(new Label("startLbl", getString("1153", locale)));
-		add(new Label("start", format(a.getStart())));
-		add(new Label("endLbl", getString("1154", locale)));
-		add(new Label("end", format(a.getEnd())));
-		add(new Label("invitorLbl", getString("1156", locale)));
-		add(new Label("invitor", invitorName));
 	}
 
-	public static AbstractSubjectEmailTemplate get(User u, Appointment a, TimeZone tz, String invitorName) {
+	public static SubjectEmailTemplate get(User u, Appointment a, TimeZone tz, String invitorName) {
 		ensureApplication(u.getLanguageId());
 		return new CanceledAppointmentTemplate(LocaleHelper.getLocale(u), a, tz, invitorName).create();
 	}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CreatedAppointmentTemplate.html
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CreatedAppointmentTemplate.html b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CreatedAppointmentTemplate.html
deleted file mode 100644
index 6c771c3..0000000
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CreatedAppointmentTemplate.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<html xmlns:wicket="http://wicket.apache.org">
-<wicket:extend>
-	<span wicket:id="titleLbl"></span>&nbsp;<span wicket:id="title"></span>
-	<div wicket:id="descContainer">
-		<br/>
-		<span wicket:id="descLbl"></span><br/>
-		&nbsp;<span wicket:id="desc"></span>
-	</div>
-	<br/>
-	<span wicket:id="startLbl"></span>&nbsp;<span wicket:id="start"></span><br/>
-	<span wicket:id="endLbl"></span>&nbsp;<span wicket:id="end"></span><br/>
-	<span wicket:id="invitorLbl"></span>&nbsp;<span wicket:id="invitor"></span><br/>
-</wicket:extend>
-</html>

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CreatedAppointmentTemplate.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CreatedAppointmentTemplate.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CreatedAppointmentTemplate.java
index 3e1271e..99a0e8c 100644
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CreatedAppointmentTemplate.java
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/CreatedAppointmentTemplate.java
@@ -26,38 +26,22 @@ import java.util.TimeZone;
 import org.apache.openmeetings.db.entity.calendar.Appointment;
 import org.apache.openmeetings.db.entity.user.User;
 import org.apache.openmeetings.db.util.LocaleHelper;
-import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.util.string.Strings;
 
-public class CreatedAppointmentTemplate extends AbstractAppointmentTemplate {
+public class CreatedAppointmentTemplate extends InvitedAppointmentTemplate {
 	private static final long serialVersionUID = 1L;
-	private final String invitorName;
 
 	private CreatedAppointmentTemplate(Locale locale, Appointment a, TimeZone tz, String invitorName) {
-		super(locale, a, tz);
-		this.invitorName = invitorName;
+		super(locale, a, tz, invitorName);
 	}
 
 	@Override
 	protected void onInitialize() {
 		super.onInitialize();
 		add(new Label("titleLbl", getString("1151", locale)));
-		add(new Label("title", a.getTitle()));
-		add(new WebMarkupContainer("descContainer")
-			.add(new Label("descLbl", getString("1152", locale)))
-			.add(new Label("desc", a.getDescription()).setEscapeModelStrings(false))
-			.setVisible(!Strings.isEmpty(a.getDescription()))
-			);
-		add(new Label("startLbl", getString("1153", locale)));
-		add(new Label("start", format(a.getStart())));
-		add(new Label("endLbl", getString("1154", locale)));
-		add(new Label("end", format(a.getEnd())));
-		add(new Label("invitorLbl", getString("1156", locale)));
-		add(new Label("invitor", invitorName));
 	}
 
-	public static AbstractSubjectEmailTemplate get(User u, Appointment a, TimeZone tz, String invitorName) {
+	public static SubjectEmailTemplate get(User u, Appointment a, TimeZone tz, String invitorName) {
 		ensureApplication(u.getLanguageId());
 		return new CreatedAppointmentTemplate(LocaleHelper.getLocale(u), a, tz, invitorName).create();
 	}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/InvitedAppointmentTemplate.html
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/InvitedAppointmentTemplate.html b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/InvitedAppointmentTemplate.html
new file mode 100644
index 0000000..2c97aa4
--- /dev/null
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/InvitedAppointmentTemplate.html
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:extend>
+	<span wicket:id="invitorLbl"></span>&nbsp;<span wicket:id="invitor"></span><br/>
+</wicket:extend>
+</html>

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/InvitedAppointmentTemplate.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/InvitedAppointmentTemplate.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/InvitedAppointmentTemplate.java
new file mode 100644
index 0000000..358af85
--- /dev/null
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/InvitedAppointmentTemplate.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.service.mail.template.subject;
+
+import java.util.Locale;
+import java.util.TimeZone;
+
+import org.apache.openmeetings.db.entity.calendar.Appointment;
+import org.apache.wicket.markup.html.basic.Label;
+
+public abstract class InvitedAppointmentTemplate extends AppointmentTemplate {
+	private static final long serialVersionUID = 1L;
+	protected final String invitorName;
+
+	protected InvitedAppointmentTemplate(Locale locale, Appointment a, TimeZone tz, String invitorName) {
+		super(locale, a, tz);
+		this.invitorName = invitorName;
+	}
+
+	@Override
+	protected void onInitialize() {
+		super.onInitialize();
+		add(new Label("invitorLbl", getString("1156", locale)));
+		add(new Label("invitor", invitorName));
+	}
+}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/RecordingExpiringTemplate.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/RecordingExpiringTemplate.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/RecordingExpiringTemplate.java
index d3ba618..a886ea9 100644
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/RecordingExpiringTemplate.java
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/RecordingExpiringTemplate.java
@@ -30,7 +30,7 @@ import org.apache.openmeetings.service.mail.template.OmTextLabel;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.panel.Fragment;
 
-public class RecordingExpiringTemplate extends AbstractSubjectEmailTemplate {
+public class RecordingExpiringTemplate extends SubjectEmailTemplate {
 	private static final long serialVersionUID = 1L;
 	private final Recording rec;
 	private long remainingDays;
@@ -43,7 +43,7 @@ public class RecordingExpiringTemplate extends AbstractSubjectEmailTemplate {
 		this.remainingDays = remainingDays;
 	}
 
-	public static AbstractSubjectEmailTemplate get(User u, Recording rec, long remainingDays) {
+	public static SubjectEmailTemplate get(User u, Recording rec, long remainingDays) {
 		ensureApplication(u.getLanguageId());
 		return new RecordingExpiringTemplate(u, rec, remainingDays).create();
 	}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/SubjectEmailTemplate.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/SubjectEmailTemplate.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/SubjectEmailTemplate.java
new file mode 100644
index 0000000..fbf146d
--- /dev/null
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/SubjectEmailTemplate.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.service.mail.template.subject;
+
+import java.util.Locale;
+
+import org.apache.openmeetings.service.mail.template.AbstractTemplatePanel;
+import org.apache.wicket.core.util.string.ComponentRenderer;
+import org.apache.wicket.markup.html.panel.Fragment;
+
+public abstract class SubjectEmailTemplate extends AbstractTemplatePanel {
+	private static final long serialVersionUID = 1L;
+	private String email = null;
+	private String subject = null;
+	private boolean created = false;
+
+	public SubjectEmailTemplate(Locale locale) {
+		super(locale);
+	}
+
+	SubjectEmailTemplate create() {
+		email = ComponentRenderer.renderComponent(this).toString();
+		subject = ComponentRenderer.renderComponent(getSubjectFragment()).toString();
+		created = true;
+		return this;
+	}
+
+	abstract Fragment getSubjectFragment();
+
+	public final String getEmail() {
+		if (!created) {
+			throw new RuntimeException("Not created!!");
+		}
+		return email;
+	}
+
+	public final String getSubject() {
+		if (!created) {
+			throw new RuntimeException("Not created!!");
+		}
+		return subject;
+	}
+}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/UpdatedAppointmentTemplate.html
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/UpdatedAppointmentTemplate.html b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/UpdatedAppointmentTemplate.html
deleted file mode 100644
index 6c771c3..0000000
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/UpdatedAppointmentTemplate.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<html xmlns:wicket="http://wicket.apache.org">
-<wicket:extend>
-	<span wicket:id="titleLbl"></span>&nbsp;<span wicket:id="title"></span>
-	<div wicket:id="descContainer">
-		<br/>
-		<span wicket:id="descLbl"></span><br/>
-		&nbsp;<span wicket:id="desc"></span>
-	</div>
-	<br/>
-	<span wicket:id="startLbl"></span>&nbsp;<span wicket:id="start"></span><br/>
-	<span wicket:id="endLbl"></span>&nbsp;<span wicket:id="end"></span><br/>
-	<span wicket:id="invitorLbl"></span>&nbsp;<span wicket:id="invitor"></span><br/>
-</wicket:extend>
-</html>

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/UpdatedAppointmentTemplate.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/UpdatedAppointmentTemplate.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/UpdatedAppointmentTemplate.java
index 48db297..c1dcec1 100644
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/UpdatedAppointmentTemplate.java
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/UpdatedAppointmentTemplate.java
@@ -26,38 +26,22 @@ import java.util.TimeZone;
 import org.apache.openmeetings.db.entity.calendar.Appointment;
 import org.apache.openmeetings.db.entity.user.User;
 import org.apache.openmeetings.db.util.LocaleHelper;
-import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.util.string.Strings;
 
-public class UpdatedAppointmentTemplate extends AbstractAppointmentTemplate {
+public class UpdatedAppointmentTemplate extends InvitedAppointmentTemplate {
 	private static final long serialVersionUID = 1L;
-	private final String invitorName;
 
 	private UpdatedAppointmentTemplate(Locale locale, Appointment a, TimeZone tz, String invitorName) {
-		super(locale, a, tz);
-		this.invitorName = invitorName;
+		super(locale, a, tz, invitorName);
 	}
 
 	@Override
 	protected void onInitialize() {
 		super.onInitialize();
 		add(new Label("titleLbl", getString("1155", locale)));
-		add(new Label("title", a.getTitle()));
-		add(new WebMarkupContainer("descContainer")
-			.add(new Label("descLbl", getString("1152", locale)))
-			.add(new Label("desc", a.getDescription()).setEscapeModelStrings(false))
-			.setVisible(!Strings.isEmpty(a.getDescription()))
-			);
-		add(new Label("startLbl", getString("1153", locale)));
-		add(new Label("start", format(a.getStart())));
-		add(new Label("endLbl", getString("1154", locale)));
-		add(new Label("end", format(a.getEnd())));
-		add(new Label("invitorLbl", getString("1156", locale)));
-		add(new Label("invitor", invitorName));
 	}
 
-	public static AbstractSubjectEmailTemplate get(User u, Appointment a, TimeZone tz, String invitorName) {
+	public static SubjectEmailTemplate get(User u, Appointment a, TimeZone tz, String invitorName) {
 		ensureApplication(u.getLanguageId());
 		return new UpdatedAppointmentTemplate(LocaleHelper.getLocale(u), a, tz, invitorName).create();
 	}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/notifier/MailNotifier.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/notifier/MailNotifier.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/notifier/MailNotifier.java
index be2399a..188019f 100644
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/notifier/MailNotifier.java
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/notifier/MailNotifier.java
@@ -30,7 +30,7 @@ import org.apache.openmeetings.db.entity.room.Invitation;
 import org.apache.openmeetings.db.entity.room.Invitation.MessageType;
 import org.apache.openmeetings.db.entity.user.User;
 import org.apache.openmeetings.db.util.TimezoneUtil;
-import org.apache.openmeetings.service.mail.template.subject.AbstractSubjectEmailTemplate;
+import org.apache.openmeetings.service.mail.template.subject.SubjectEmailTemplate;
 import org.apache.openmeetings.service.mail.template.subject.AppointmentReminderTemplate;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -52,7 +52,7 @@ public class MailNotifier implements INotifier {
 	@Override
 	public void notify(User u, Appointment a, Invitation inv) throws Exception {
 		TimeZone tz = timezoneUtil.getTimeZone(u.getTimeZoneId());
-		AbstractSubjectEmailTemplate t = AppointmentReminderTemplate.get(u, a, tz);
+		SubjectEmailTemplate t = AppointmentReminderTemplate.get(u, a, tz);
 		invitationManager.sendInvitationLink(inv, MessageType.Create, t.getSubject(), t.getEmail(), false);
 	}
 }

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/quartz/scheduler/ReminderJob.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/quartz/scheduler/ReminderJob.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/quartz/scheduler/ReminderJob.java
index 553c976..31f27e3 100644
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/quartz/scheduler/ReminderJob.java
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/quartz/scheduler/ReminderJob.java
@@ -25,7 +25,7 @@ import org.apache.openmeetings.core.mail.MailHandler;
 import org.apache.openmeetings.db.dao.user.UserDao;
 import org.apache.openmeetings.db.entity.user.User;
 import org.apache.openmeetings.service.calendar.AppointmentLogic;
-import org.apache.openmeetings.service.mail.template.subject.AbstractSubjectEmailTemplate;
+import org.apache.openmeetings.service.mail.template.subject.SubjectEmailTemplate;
 import org.apache.openmeetings.service.mail.template.subject.RecordingExpiringTemplate;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
@@ -62,7 +62,7 @@ public class ReminderJob extends AbstractJob {
 				if (u == null) {
 					log.debug("Unable to send expiration email due to recording owner is NULL, {}", rec);
 				} else {
-					AbstractSubjectEmailTemplate templ = RecordingExpiringTemplate.get(u, rec, days);
+					SubjectEmailTemplate templ = RecordingExpiringTemplate.get(u, rec, days);
 					mailHandler.send(u.getAddress().getEmail(), templ.getSubject(), templ.getEmail());
 				}
 			} else {

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/room/InvitationManager.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/room/InvitationManager.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/room/InvitationManager.java
index 9b4c7fa..9ba1f6a 100644
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/room/InvitationManager.java
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/room/InvitationManager.java
@@ -44,7 +44,7 @@ import org.apache.openmeetings.db.entity.user.User;
 import org.apache.openmeetings.db.entity.user.User.Type;
 import org.apache.openmeetings.db.util.TimezoneUtil;
 import org.apache.openmeetings.service.mail.template.InvitationTemplate;
-import org.apache.openmeetings.service.mail.template.subject.AbstractSubjectEmailTemplate;
+import org.apache.openmeetings.service.mail.template.subject.SubjectEmailTemplate;
 import org.apache.openmeetings.service.mail.template.subject.CanceledAppointmentTemplate;
 import org.apache.openmeetings.service.mail.template.subject.CreatedAppointmentTemplate;
 import org.apache.openmeetings.service.mail.template.subject.UpdatedAppointmentTemplate;
@@ -85,7 +85,7 @@ public class InvitationManager implements IInvitationManager {
 		User owner = a.getOwner();
 		String invitorName = owner.getFirstname() + " " + owner.getLastname();
 		TimeZone tz = timezoneUtil.getTimeZone(mm.getUser());
-		AbstractSubjectEmailTemplate t;
+		SubjectEmailTemplate t;
 		switch (type) {
 			case Cancel:
 				t = CanceledAppointmentTemplate.get(mm.getUser(), a, tz, invitorName);

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-web/src/test/java/org/apache/openmeetings/invitiation/TestInvitation.java
----------------------------------------------------------------------
diff --git a/openmeetings-web/src/test/java/org/apache/openmeetings/invitiation/TestInvitation.java b/openmeetings-web/src/test/java/org/apache/openmeetings/invitiation/TestInvitation.java
index b9c1f99..d327f7c 100644
--- a/openmeetings-web/src/test/java/org/apache/openmeetings/invitiation/TestInvitation.java
+++ b/openmeetings-web/src/test/java/org/apache/openmeetings/invitiation/TestInvitation.java
@@ -21,14 +21,23 @@ package org.apache.openmeetings.invitiation;
 import static org.apache.openmeetings.util.CalendarHelper.getDate;
 
 import java.time.LocalDateTime;
+import java.util.TimeZone;
 
+import org.apache.directory.api.util.Strings;
 import org.apache.openmeetings.AbstractWicketTester;
 import org.apache.openmeetings.db.dao.room.RoomDao;
+import org.apache.openmeetings.db.entity.calendar.Appointment;
 import org.apache.openmeetings.db.entity.room.Invitation;
 import org.apache.openmeetings.db.entity.room.Invitation.MessageType;
 import org.apache.openmeetings.db.entity.room.Invitation.Valid;
 import org.apache.openmeetings.db.entity.user.User;
+import org.apache.openmeetings.service.mail.template.subject.AppointmentReminderTemplate;
+import org.apache.openmeetings.service.mail.template.subject.CanceledAppointmentTemplate;
+import org.apache.openmeetings.service.mail.template.subject.CreatedAppointmentTemplate;
+import org.apache.openmeetings.service.mail.template.subject.SubjectEmailTemplate;
+import org.apache.openmeetings.service.mail.template.subject.UpdatedAppointmentTemplate;
 import org.apache.openmeetings.service.room.InvitationManager;
+import org.junit.Assert;
 import org.junit.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 
@@ -51,4 +60,23 @@ public class TestInvitation extends AbstractWicketTester {
 
 		invitationManager.sendInvitationLink(i, MessageType.Create, "subject", "message", false);
 	}
+
+	private void checkTemplate(SubjectEmailTemplate t) {
+		Assert.assertNotNull("Template should be created", t);
+		Assert.assertFalse("Subject should be not empty", Strings.isEmpty(t.getSubject()));
+		Assert.assertFalse("Boby should be not empty", Strings.isEmpty(t.getEmail()));
+	}
+
+	@Test
+	public void testTemplateGeneration() {
+		Appointment a = getAppointment();
+		String[] ids = TimeZone.getAvailableIDs();
+		for (User u : userDao.get(0, 100)) {
+			TimeZone tz = TimeZone.getTimeZone(ids[rnd.nextInt(ids.length)]);
+			checkTemplate(CreatedAppointmentTemplate.get(u, a, tz, u.getLogin()));
+			checkTemplate(CanceledAppointmentTemplate.get(u, a, tz, u.getLogin()));
+			checkTemplate(UpdatedAppointmentTemplate.get(u, a, tz, u.getLogin()));
+			checkTemplate(AppointmentReminderTemplate.get(u, a, tz));
+		}
+	}
 }


[2/2] openmeetings git commit: [OPENMEETINGS-1714] some issues are fixed

Posted by so...@apache.org.
[OPENMEETINGS-1714] some issues are fixed


Project: http://git-wip-us.apache.org/repos/asf/openmeetings/repo
Commit: http://git-wip-us.apache.org/repos/asf/openmeetings/commit/8eb27129
Tree: http://git-wip-us.apache.org/repos/asf/openmeetings/tree/8eb27129
Diff: http://git-wip-us.apache.org/repos/asf/openmeetings/diff/8eb27129

Branch: refs/heads/master
Commit: 8eb27129f9d1e4faa0705d82dcc9706a7d642d0a
Parents: 29ada03
Author: Maxim Solodovnik <so...@gmail.com>
Authored: Wed Oct 11 20:56:51 2017 +0700
Committer: Maxim Solodovnik <so...@gmail.com>
Committed: Wed Oct 11 20:56:51 2017 +0700

----------------------------------------------------------------------
 .../record/listener/async/BaseStreamWriter.java |  20 ++-
 .../listener/async/StreamAudioWriter.java       |  25 +--
 .../listener/async/StreamVideoWriter.java       |  15 +-
 .../db/dao/calendar/AppointmentDao.java         |  38 -----
 .../gui/ScreenHeightMouseListener.java          |  74 ---------
 .../screenshare/gui/ScreenMouseListener.java    |  78 ----------
 .../screenshare/gui/ScreenSharerFrame.java      |   9 +-
 .../gui/ScreenWidthMouseListener.java           |  74 ---------
 .../screenshare/gui/ScreenXMouseListener.java   |  75 ---------
 .../screenshare/gui/ScreenYMouseListener.java   |  76 ---------
 .../gui/listener/OmMouseInputAdapter.java       |  59 +++++++
 .../gui/listener/ScreenHeightMouseListener.java |  53 +++++++
 .../gui/listener/ScreenMouseListener.java       |  57 +++++++
 .../gui/listener/ScreenWidthMouseListener.java  |  53 +++++++
 .../gui/listener/ScreenXMouseListener.java      |  54 +++++++
 .../gui/listener/ScreenYMouseListener.java      |  55 +++++++
 .../caldav/handler/AbstractCalendarHandler.java |  40 ++++-
 .../calendar/caldav/handler/CtagHandler.java    |  58 +++----
 .../calendar/caldav/handler/EtagsHandler.java   | 116 +++++++-------
 .../caldav/handler/MultigetHandler.java         |  93 +++++------
 .../caldav/handler/WebDAVSyncHandler.java       | 156 +++++++++----------
 .../subject/AbstractAppointmentTemplate.html    |  27 ----
 .../subject/AbstractAppointmentTemplate.java    |  66 --------
 .../subject/AbstractSubjectEmailTemplate.java   |  59 -------
 .../subject/AppointmentReminderTemplate.html    |  32 ----
 .../subject/AppointmentReminderTemplate.java    |  16 +-
 .../template/subject/AppointmentTemplate.html   |  36 +++++
 .../template/subject/AppointmentTemplate.java   |  83 ++++++++++
 .../subject/CanceledAppointmentTemplate.html    |  33 ----
 .../subject/CanceledAppointmentTemplate.java    |  22 +--
 .../subject/CreatedAppointmentTemplate.html     |  33 ----
 .../subject/CreatedAppointmentTemplate.java     |  22 +--
 .../subject/InvitedAppointmentTemplate.html     |  24 +++
 .../subject/InvitedAppointmentTemplate.java     |  42 +++++
 .../subject/RecordingExpiringTemplate.java      |   4 +-
 .../template/subject/SubjectEmailTemplate.java  |  59 +++++++
 .../subject/UpdatedAppointmentTemplate.html     |  33 ----
 .../subject/UpdatedAppointmentTemplate.java     |  22 +--
 .../service/notifier/MailNotifier.java          |   4 +-
 .../service/quartz/scheduler/ReminderJob.java   |   4 +-
 .../service/room/InvitationManager.java         |   4 +-
 .../invitiation/TestInvitation.java             |  28 ++++
 42 files changed, 879 insertions(+), 1052 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/record/listener/async/BaseStreamWriter.java
----------------------------------------------------------------------
diff --git a/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/record/listener/async/BaseStreamWriter.java b/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/record/listener/async/BaseStreamWriter.java
index 808db25..3db92d9 100644
--- a/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/record/listener/async/BaseStreamWriter.java
+++ b/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/record/listener/async/BaseStreamWriter.java
@@ -28,12 +28,15 @@ import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.mina.core.buffer.IoBuffer;
 import org.apache.openmeetings.db.dao.record.RecordingMetaDataDao;
 import org.apache.openmeetings.db.entity.record.RecordingMetaData;
 import org.apache.openmeetings.db.entity.record.RecordingMetaData.Status;
 import org.apache.openmeetings.util.OmFileHelper;
 import org.red5.io.IStreamableFile;
+import org.red5.io.ITag;
 import org.red5.io.ITagWriter;
+import org.red5.io.flv.impl.Tag;
 import org.red5.logging.Red5LoggerFactory;
 import org.red5.server.api.scope.IScope;
 import org.red5.server.api.service.IStreamableFileService;
@@ -142,12 +145,12 @@ public abstract class BaseStreamWriter implements Runnable {
 
 					packetReceived(item);
 				} else if (dostopping || lastPackedRecieved + TIME_TO_WAIT_FOR_FRAME < System.currentTimeMillis()) {
-					log.debug(String.format("##REC:: none packets received for: %s minutes, exiting", (System.currentTimeMillis() - lastPackedRecieved) / MINUTE_MULTIPLIER));
+					log.debug("##REC:: none packets received for: {} minutes, exiting", (System.currentTimeMillis() - lastPackedRecieved) / MINUTE_MULTIPLIER);
 					stopping = true;
 					closeStream();
 				}
 				if (++counter % 5000 == 0) {
-					log.debug("##REC:: Stream writer is still listening:: " + file.getName());
+					log.debug("##REC:: Stream writer is still listening:: {}", file.getName());
 				}
 			} catch (InterruptedException e) {
 				log.error("##REC:: [run]", e);
@@ -191,10 +194,21 @@ public abstract class BaseStreamWriter implements Runnable {
 		}
 		try {
 			queue.put(streampacket);
-			log.trace("##REC:: Q put, successful: " + queue.size());
+			log.trace("##REC:: Q put, successful: {}", queue.size());
 		} catch (InterruptedException ignored) {
 			log.error("##REC:: [append]", ignored);
 		}
 	}
 
+	protected void write(int timeStamp, byte type, IoBuffer data) throws IOException {
+		log.trace("timeStamp :: {}", timeStamp);
+		ITag tag = new Tag();
+		tag.setDataType(type);
+
+		tag.setBodySize(data.limit());
+		tag.setTimestamp(timeStamp);
+		tag.setBody(data);
+
+		writer.writeTag(tag);
+	}
 }

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/record/listener/async/StreamAudioWriter.java
----------------------------------------------------------------------
diff --git a/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/record/listener/async/StreamAudioWriter.java b/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/record/listener/async/StreamAudioWriter.java
index d72a518..5e9bafe 100644
--- a/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/record/listener/async/StreamAudioWriter.java
+++ b/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/record/listener/async/StreamAudioWriter.java
@@ -29,8 +29,6 @@ import org.apache.openmeetings.db.dao.record.RecordingMetaDataDao;
 import org.apache.openmeetings.db.dao.record.RecordingMetaDeltaDao;
 import org.apache.openmeetings.db.entity.record.RecordingMetaData;
 import org.apache.openmeetings.db.entity.record.RecordingMetaDelta;
-import org.red5.io.ITag;
-import org.red5.io.flv.impl.Tag;
 import org.red5.logging.Red5LoggerFactory;
 import org.red5.server.api.scope.IScope;
 import org.slf4j.Logger;
@@ -170,15 +168,8 @@ public class StreamAudioWriter extends BaseStreamWriter {
 					metaDeltaDao.add(metaDelta);
 				}
 
-				log.trace("##REC:: timeStamp :: " + timeStamp);
-				ITag tag = new Tag();
-				tag.setDataType(streampacket.getDataType());
-
-				tag.setBodySize(data.limit());
-				tag.setTimestamp(timeStamp);
-				tag.setBody(data);
-
-				writer.writeTag(tag);
+				log.trace("##REC:: timeStamp :: {}", timeStamp);
+				write(timeStamp, streampacket.getDataType(), data);
 			}
 		} catch (Exception e) {
 			log.error("##REC:: [packetReceived]", e);
@@ -192,18 +183,18 @@ public class StreamAudioWriter extends BaseStreamWriter {
 			// Screen Data, cause there is no!
 
 			Date virtualTime = lastcurrentTime;
-			log.debug("##REC:: virtualTime: " + virtualTime);
-			log.debug("##REC:: startedSessionTimeDate: " + startedSessionTimeDate);
+			log.debug("##REC:: virtualTime: {}", virtualTime);
+			log.debug("##REC:: startedSessionTimeDate: {}", startedSessionTimeDate);
 
 			long deltaRecordingTime = virtualTime == null ? 0 : virtualTime.getTime() - startedSessionTimeDate.getTime();
 
-			log.debug("##REC:: lastTimeStamp :closeStream: " + lastTimeStamp);
-			log.debug("##REC:: lastStreamPacketTimeStamp :closeStream: " + lastStreamPacketTimeStamp);
-			log.debug("##REC:: deltaRecordingTime :closeStream: " + deltaRecordingTime);
+			log.debug("##REC:: lastTimeStamp :closeStream: {}", lastTimeStamp);
+			log.debug("##REC:: lastStreamPacketTimeStamp :closeStream: {}", lastStreamPacketTimeStamp);
+			log.debug("##REC:: deltaRecordingTime :closeStream: {}", deltaRecordingTime);
 
 			long deltaTimePaddingEnd = deltaRecordingTime - lastTimeStamp - initialDelta;
 
-			log.debug("##REC:: deltaTimePaddingEnd :: " + deltaTimePaddingEnd);
+			log.debug("##REC:: deltaTimePaddingEnd :: {}", deltaTimePaddingEnd);
 
 			RecordingMetaDelta metaDelta = new RecordingMetaDelta();
 

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/record/listener/async/StreamVideoWriter.java
----------------------------------------------------------------------
diff --git a/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/record/listener/async/StreamVideoWriter.java b/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/record/listener/async/StreamVideoWriter.java
index 87bbfec..022d043 100644
--- a/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/record/listener/async/StreamVideoWriter.java
+++ b/openmeetings-core/src/main/java/org/apache/openmeetings/core/data/record/listener/async/StreamVideoWriter.java
@@ -26,8 +26,6 @@ import java.util.Date;
 import org.apache.mina.core.buffer.IoBuffer;
 import org.apache.openmeetings.db.dao.record.RecordingMetaDataDao;
 import org.apache.openmeetings.db.entity.record.RecordingMetaData;
-import org.red5.io.ITag;
-import org.red5.io.flv.impl.Tag;
 import org.red5.logging.Red5LoggerFactory;
 import org.red5.server.api.scope.IScope;
 import org.slf4j.Logger;
@@ -49,7 +47,7 @@ public class StreamVideoWriter extends BaseStreamWriter {
 			log.trace("incoming timeStamp :: " + timeStamp);
 			if (startTimeStamp == -1 && KEYFRAME != streampacket.getFrameType()) {
 				//skip until keyframe
-				log.trace("no KEYFRAME, skipping ::" + streampacket.getFrameType());
+				log.trace("no KEYFRAME, skipping :: {}", streampacket.getFrameType());
 				return;
 			}
 			if (timeStamp <= 0) {
@@ -75,18 +73,9 @@ public class StreamVideoWriter extends BaseStreamWriter {
 				// That will be not bigger then long value
 				startTimeStamp = timeStamp;
 			}
-
 			timeStamp -= startTimeStamp;
 
-			log.trace("timeStamp :: " + timeStamp);
-			ITag tag = new Tag();
-			tag.setDataType(streampacket.getDataType());
-
-			tag.setBodySize(data.limit());
-			tag.setTimestamp(timeStamp);
-			tag.setBody(data);
-
-			writer.writeTag(tag);
+			write(timeStamp, streampacket.getDataType(), data);
 		} catch (Exception e) {
 			log.error("[packetReceived]", e);
 		}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/calendar/AppointmentDao.java
----------------------------------------------------------------------
diff --git a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/calendar/AppointmentDao.java b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/calendar/AppointmentDao.java
index e1dfbe6..b2b175a 100644
--- a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/calendar/AppointmentDao.java
+++ b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dao/calendar/AppointmentDao.java
@@ -27,7 +27,6 @@ import java.util.Date;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.TimeZone;
 
 import javax.persistence.EntityManager;
 import javax.persistence.PersistenceContext;
@@ -36,13 +35,11 @@ import javax.persistence.TypedQuery;
 import org.apache.openmeetings.db.dao.basic.ConfigurationDao;
 import org.apache.openmeetings.db.dao.room.IInvitationManager;
 import org.apache.openmeetings.db.dao.room.RoomDao;
-import org.apache.openmeetings.db.dao.user.UserDao;
 import org.apache.openmeetings.db.entity.calendar.Appointment;
 import org.apache.openmeetings.db.entity.calendar.Appointment.Reminder;
 import org.apache.openmeetings.db.entity.calendar.MeetingMember;
 import org.apache.openmeetings.db.entity.room.Invitation.MessageType;
 import org.apache.openmeetings.db.entity.room.Room;
-import org.apache.openmeetings.db.util.TimezoneUtil;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -58,14 +55,10 @@ public class AppointmentDao {
 	@Autowired
 	private MeetingMemberDao meetingMemberDao;
 	@Autowired
-	private UserDao userDao;
-	@Autowired
 	private RoomDao roomDao;
 	@Autowired
 	private ConfigurationDao cfgDao;
 	@Autowired
-	private TimezoneUtil timezoneUtil;
-	@Autowired
 	private IInvitationManager invitationManager;
 
 	/*
@@ -197,38 +190,7 @@ public class AppointmentDao {
 				.setParameter("title", title).setParameter("userId", userId).getResultList();
 	}
 
-	/**
-	 * @author becherer
-	 * @param userId
-	 * @return
-	 */
-	public List<Appointment> getForToday(Long userId) {
-		log.debug("getAppoitmentbyRangeAndMember : UserID - " + userId);
-
-		TimeZone timeZone = timezoneUtil.getTimeZone(userDao.get(userId));
-
-		Calendar startCal = Calendar.getInstance(timeZone);
-		startCal.set(Calendar.MINUTE, 0);
-		startCal.set(Calendar.HOUR, 0);
-		startCal.set(Calendar.SECOND, 1);
-
-		Calendar endCal = Calendar.getInstance(timeZone);
-		endCal.set(Calendar.MINUTE, 23);
-		endCal.set(Calendar.HOUR, 59);
-		endCal.set(Calendar.SECOND, 59);
-
-		TypedQuery<Appointment> query = em.createNamedQuery("appointmentsInRangeByUser", Appointment.class);
-
-		query.setParameter("userId", userId);
-
-		query.setParameter("start", startCal.getTime());
-		query.setParameter("end", endCal.getTime());
-
-		return query.getResultList();
-	}
-
 	// ---------------------------------------------------------------------------------------------
-
 	public Appointment getByRoom(Long userId, Long roomId) {
 		try {
 			List<Appointment> list = em.createNamedQuery("getAppointmentByOwnerRoomId", Appointment.class)

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenHeightMouseListener.java
----------------------------------------------------------------------
diff --git a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenHeightMouseListener.java b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenHeightMouseListener.java
deleted file mode 100644
index ee03bc5..0000000
--- a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenHeightMouseListener.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") +  you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.screenshare.gui;
-
-import java.awt.Component;
-import java.awt.Cursor;
-import java.awt.event.MouseEvent;
-
-import javax.swing.event.MouseInputAdapter;
-
-public class ScreenHeightMouseListener extends MouseInputAdapter  {
-	private final ScreenSharerFrame frame;
-	private double y = 0;
-
-	public ScreenHeightMouseListener(ScreenSharerFrame frame) {
-		this.frame = frame;
-	}
-
-	@Override
-	public void mouseEntered(MouseEvent e) {
-		frame.setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
-	}
-
-	@Override
-	public void mouseExited(MouseEvent e) {
-		frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-	}
-
-	@Override
-	public void mousePressed(MouseEvent e) {
-		frame.setShowWarning(false);
-		y = e.getY();
-	}
-
-	@Override
-	public void mouseReleased(MouseEvent e) {
-		frame.setShowWarning(true);
-	}
-
-	@Override
-	public void mouseDragged(MouseEvent e) {
-		if (!((Component)e.getSource()).isEnabled()) {
-			return;
-		}
-		double newY = e.getY();
-
-		int newHeight = frame.getDim().getSpinnerHeight() - (int)(y - newY);
-		int newSpinnerY = frame.getDim().getSpinnerY() + newHeight;
-
-		if (newSpinnerY >= 0 && newSpinnerY <= frame.getDim().getHeightMax()) {
-			frame.setDoUpdateBounds(false);
-			frame.setSpinnerHeight(newHeight);
-			frame.setDoUpdateBounds(true);
-			frame.updateVScreenBounds();
-			frame.calcRescaleFactors();
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenMouseListener.java
----------------------------------------------------------------------
diff --git a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenMouseListener.java b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenMouseListener.java
deleted file mode 100644
index ed561c3..0000000
--- a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenMouseListener.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") +  you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.screenshare.gui;
-
-import java.awt.Component;
-import java.awt.Cursor;
-import java.awt.event.MouseEvent;
-
-import javax.swing.event.MouseInputAdapter;
-
-public class ScreenMouseListener extends MouseInputAdapter {
-	private final ScreenSharerFrame frame;
-	private int x = 0;
-	private int y = 0;
-
-	public ScreenMouseListener(ScreenSharerFrame frame) {
-		this.frame = frame;
-	}
-
-	@Override
-	public void mouseEntered(MouseEvent e) {
-		frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
-	}
-
-	@Override
-	public void mouseExited(MouseEvent e) {
-		frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-	}
-
-	@Override
-	public void mousePressed(MouseEvent e) {
-		frame.setShowWarning(false);
-		this.x = e.getX();
-		this.y = e.getY();
-	}
-
-	@Override
-	public void mouseReleased(MouseEvent e) {
-		frame.setShowWarning(true);
-	}
-
-	@Override
-	public void mouseDragged(MouseEvent e) {
-		if (!((Component)e.getSource()).isEnabled()) {
-			return;
-		}
-		int newX = e.getX();
-		int newY = e.getY();
-
-		int newXPosition = frame.getDim().getSpinnerX() - (this.x - newX);
-		int newYPosition = frame.getDim().getSpinnerY() - (this.y - newY);
-		if (newXPosition >= 0) {
-			frame.setSpinnerX(newXPosition);
-		}
-		if (newYPosition >= 0) {
-			frame.setSpinnerY(newYPosition);
-		}
-
-		frame.calcRescaleFactors();
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenSharerFrame.java
----------------------------------------------------------------------
diff --git a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenSharerFrame.java b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenSharerFrame.java
index bbd5a65..24aed00 100644
--- a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenSharerFrame.java
+++ b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenSharerFrame.java
@@ -53,6 +53,11 @@ import javax.swing.event.DocumentListener;
 
 import org.apache.openmeetings.screenshare.Core;
 import org.apache.openmeetings.screenshare.gui.ScreenDimensions.ScreenQuality;
+import org.apache.openmeetings.screenshare.gui.listener.ScreenHeightMouseListener;
+import org.apache.openmeetings.screenshare.gui.listener.ScreenMouseListener;
+import org.apache.openmeetings.screenshare.gui.listener.ScreenWidthMouseListener;
+import org.apache.openmeetings.screenshare.gui.listener.ScreenXMouseListener;
+import org.apache.openmeetings.screenshare.gui.listener.ScreenYMouseListener;
 import org.slf4j.Logger;
 
 public class ScreenSharerFrame extends JFrame {
@@ -770,7 +775,7 @@ public class ScreenSharerFrame extends JFrame {
 	/**
 	 * Needs to be always invoked after every re-scaling
 	 */
-	void calcRescaleFactors() {
+	public void calcRescaleFactors() {
 		logger.trace("calcRescaleFactors -- ");
 		int resizeX = spinnerWidth.getValue();
 		int resizeY = spinnerHeight.getValue();
@@ -816,7 +821,7 @@ public class ScreenSharerFrame extends JFrame {
 	 * by using the vars from the Spinners
 	 *
 	 */
-	void updateVScreenBounds() {
+	public void updateVScreenBounds() {
 		double ratio = ((double)getDim().getWidth()) / getDim().getWidthMax();
 		int newWidth = (int)(getDim().getSpinnerWidth() * ratio);
 		int newX = (int)(getDim().getSpinnerX() * ratio);

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenWidthMouseListener.java
----------------------------------------------------------------------
diff --git a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenWidthMouseListener.java b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenWidthMouseListener.java
deleted file mode 100644
index 404887c..0000000
--- a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenWidthMouseListener.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") +  you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.screenshare.gui;
-
-import java.awt.Component;
-import java.awt.Cursor;
-import java.awt.event.MouseEvent;
-
-import javax.swing.event.MouseInputAdapter;
-
-public class ScreenWidthMouseListener extends MouseInputAdapter {
-	private final ScreenSharerFrame frame;
-	private double x = 0;
-
-	public ScreenWidthMouseListener(ScreenSharerFrame frame) {
-		this.frame = frame;
-	}
-
-	@Override
-	public void mouseEntered(MouseEvent e) {
-		frame.setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
-	}
-
-	@Override
-	public void mouseExited(MouseEvent e) {
-		frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-	}
-
-	@Override
-	public void mousePressed(MouseEvent e) {
-		frame.setShowWarning(false);
-		this.x = e.getX();
-	}
-
-	@Override
-	public void mouseReleased(MouseEvent e) {
-		frame.setShowWarning(true);
-	}
-
-	@Override
-	public void mouseDragged(MouseEvent e) {
-		if (!((Component)e.getSource()).isEnabled()) {
-			return;
-		}
-		double newX = e.getX();
-
-		int newWidth = frame.getDim().getSpinnerWidth() - (int)(x - newX);
-		int newSpinnerX = frame.getDim().getSpinnerX() + newWidth;
-
-		if (0 <= newSpinnerX && newSpinnerX <= frame.getDim().getWidthMax()) {
-			frame.setDoUpdateBounds(false);
-			frame.setSpinnerWidth(newWidth);
-			frame.setDoUpdateBounds(true);
-			frame.updateVScreenBounds();
-			frame.calcRescaleFactors();
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenXMouseListener.java
----------------------------------------------------------------------
diff --git a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenXMouseListener.java b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenXMouseListener.java
deleted file mode 100644
index 66106d2..0000000
--- a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenXMouseListener.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") +  you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.screenshare.gui;
-
-import java.awt.Component;
-import java.awt.Cursor;
-import java.awt.event.MouseEvent;
-
-import javax.swing.event.MouseInputAdapter;
-
-public class ScreenXMouseListener extends MouseInputAdapter {
-	private final ScreenSharerFrame frame;
-	private double x = 0;
-
-	public ScreenXMouseListener(ScreenSharerFrame frame) {
-		this.frame = frame;
-	}
-
-	@Override
-	public void mouseEntered(MouseEvent e) {
-		frame.setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
-	}
-
-	@Override
-	public void mouseExited(MouseEvent e) {
-		frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-	}
-
-	@Override
-	public void mousePressed(MouseEvent e) {
-		frame.setShowWarning(false);
-		this.x = e.getX();
-	}
-
-	@Override
-	public void mouseReleased(MouseEvent e) {
-		frame.setShowWarning(true);
-	}
-
-	@Override
-	public void mouseDragged(MouseEvent e) {
-		if (!((Component)e.getSource()).isEnabled()) {
-			return;
-		}
-		double newX = e.getX();
-		int delta = (int) (x - newX);
-		int newXPosition = frame.getDim().getSpinnerX() - delta;
-		int newWidth = frame.getDim().getSpinnerWidth() + delta;
-
-		if (newXPosition >= 0 && newWidth >= 0) {
-			frame.setDoUpdateBounds(false);
-			frame.setSpinnerX(newXPosition);
-			frame.setSpinnerWidth(newWidth);
-			frame.setDoUpdateBounds(true);
-			frame.updateVScreenBounds();
-			frame.calcRescaleFactors();
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenYMouseListener.java
----------------------------------------------------------------------
diff --git a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenYMouseListener.java b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenYMouseListener.java
deleted file mode 100644
index d1faf4b..0000000
--- a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/ScreenYMouseListener.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") +  you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.screenshare.gui;
-
-import java.awt.Component;
-import java.awt.Cursor;
-import java.awt.event.MouseEvent;
-
-import javax.swing.event.MouseInputAdapter;
-
-public class ScreenYMouseListener extends MouseInputAdapter {
-	private final ScreenSharerFrame frame;
-	private double y = 0;
-
-	public ScreenYMouseListener(ScreenSharerFrame frame) {
-		this.frame = frame;
-	}
-
-	@Override
-	public void mouseEntered(MouseEvent e) {
-		frame.setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));
-	}
-
-	@Override
-	public void mouseExited(MouseEvent e) {
-		frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-	}
-
-	@Override
-	public void mousePressed(MouseEvent e) {
-		frame.setShowWarning(false);
-		this.y = e.getY();
-	}
-
-	@Override
-	public void mouseReleased(MouseEvent e) {
-		frame.setShowWarning(true);
-	}
-
-	@Override
-	public void mouseDragged(MouseEvent e) {
-		if (!((Component)e.getSource()).isEnabled()) {
-			return;
-		}
-		double newY = e.getY();
-
-		int delta = (int) (y - newY);
-		int newYPosition = frame.getDim().getSpinnerY() - delta;
-		int newHeight = frame.getDim().getSpinnerHeight() + delta;
-
-		if (newYPosition >= 0 && newHeight >= 0) {
-			frame.setDoUpdateBounds(false);
-			frame.setSpinnerY(newYPosition);
-			frame.setSpinnerHeight(newHeight);
-			frame.setDoUpdateBounds(true);
-			frame.updateVScreenBounds();
-			frame.calcRescaleFactors();
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/OmMouseInputAdapter.java
----------------------------------------------------------------------
diff --git a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/OmMouseInputAdapter.java b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/OmMouseInputAdapter.java
new file mode 100644
index 0000000..c2d0856
--- /dev/null
+++ b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/OmMouseInputAdapter.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.screenshare.gui.listener;
+
+import java.awt.Cursor;
+import java.awt.event.MouseEvent;
+import java.util.function.Consumer;
+
+import javax.swing.event.MouseInputAdapter;
+
+import org.apache.openmeetings.screenshare.gui.ScreenSharerFrame;
+
+public abstract class OmMouseInputAdapter extends MouseInputAdapter {
+	private final int enterCursor;
+	protected Consumer<MouseEvent> cons;
+	protected final ScreenSharerFrame frame;
+
+	public OmMouseInputAdapter(ScreenSharerFrame frame, int enterCursor) {
+		this.frame = frame;
+		this.enterCursor = enterCursor;
+	}
+
+	@Override
+	public void mouseEntered(MouseEvent e) {
+		frame.setCursor(Cursor.getPredefinedCursor(enterCursor));
+	}
+
+	@Override
+	public void mouseExited(MouseEvent e) {
+		frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+	}
+
+	@Override
+	public void mousePressed(MouseEvent e) {
+		frame.setShowWarning(false);
+		cons.accept(e);
+	}
+
+	@Override
+	public void mouseReleased(MouseEvent e) {
+		frame.setShowWarning(true);
+	}
+}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenHeightMouseListener.java
----------------------------------------------------------------------
diff --git a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenHeightMouseListener.java b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenHeightMouseListener.java
new file mode 100644
index 0000000..beb1e47
--- /dev/null
+++ b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenHeightMouseListener.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.screenshare.gui.listener;
+
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.event.MouseEvent;
+
+import org.apache.openmeetings.screenshare.gui.ScreenSharerFrame;
+
+public class ScreenHeightMouseListener extends OmMouseInputAdapter {
+	private double y = 0;
+
+	public ScreenHeightMouseListener(ScreenSharerFrame frame) {
+		super(frame, Cursor.N_RESIZE_CURSOR);
+		cons = e -> {this.y = e.getY();};
+	}
+
+	@Override
+	public void mouseDragged(MouseEvent e) {
+		if (!((Component)e.getSource()).isEnabled()) {
+			return;
+		}
+		double newY = e.getY();
+
+		int newHeight = frame.getDim().getSpinnerHeight() - (int)(y - newY);
+		int newSpinnerY = frame.getDim().getSpinnerY() + newHeight;
+
+		if (newSpinnerY >= 0 && newSpinnerY <= frame.getDim().getHeightMax()) {
+			frame.setDoUpdateBounds(false);
+			frame.setSpinnerHeight(newHeight);
+			frame.setDoUpdateBounds(true);
+			frame.updateVScreenBounds();
+			frame.calcRescaleFactors();
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenMouseListener.java
----------------------------------------------------------------------
diff --git a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenMouseListener.java b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenMouseListener.java
new file mode 100644
index 0000000..263e3d9
--- /dev/null
+++ b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenMouseListener.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.screenshare.gui.listener;
+
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.event.MouseEvent;
+
+import org.apache.openmeetings.screenshare.gui.ScreenSharerFrame;
+
+public class ScreenMouseListener extends OmMouseInputAdapter {
+	private int x = 0;
+	private int y = 0;
+
+	public ScreenMouseListener(ScreenSharerFrame frame) {
+		super(frame, Cursor.HAND_CURSOR);
+		cons = e -> {
+			this.x = e.getX();
+			this.y = e.getY();
+		};
+	}
+
+	@Override
+	public void mouseDragged(MouseEvent e) {
+		if (!((Component)e.getSource()).isEnabled()) {
+			return;
+		}
+		int newX = e.getX();
+		int newY = e.getY();
+
+		int newXPosition = frame.getDim().getSpinnerX() - (this.x - newX);
+		int newYPosition = frame.getDim().getSpinnerY() - (this.y - newY);
+		if (newXPosition >= 0) {
+			frame.setSpinnerX(newXPosition);
+		}
+		if (newYPosition >= 0) {
+			frame.setSpinnerY(newYPosition);
+		}
+		frame.calcRescaleFactors();
+	}
+}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenWidthMouseListener.java
----------------------------------------------------------------------
diff --git a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenWidthMouseListener.java b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenWidthMouseListener.java
new file mode 100644
index 0000000..053fd15
--- /dev/null
+++ b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenWidthMouseListener.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.screenshare.gui.listener;
+
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.event.MouseEvent;
+
+import org.apache.openmeetings.screenshare.gui.ScreenSharerFrame;
+
+public class ScreenWidthMouseListener extends OmMouseInputAdapter {
+	private double x = 0;
+
+	public ScreenWidthMouseListener(ScreenSharerFrame frame) {
+		super(frame, Cursor.W_RESIZE_CURSOR);
+		cons = e -> {this.x = e.getX();};
+	}
+
+	@Override
+	public void mouseDragged(MouseEvent e) {
+		if (!((Component)e.getSource()).isEnabled()) {
+			return;
+		}
+		double newX = e.getX();
+
+		int newWidth = frame.getDim().getSpinnerWidth() - (int)(x - newX);
+		int newSpinnerX = frame.getDim().getSpinnerX() + newWidth;
+
+		if (0 <= newSpinnerX && newSpinnerX <= frame.getDim().getWidthMax()) {
+			frame.setDoUpdateBounds(false);
+			frame.setSpinnerWidth(newWidth);
+			frame.setDoUpdateBounds(true);
+			frame.updateVScreenBounds();
+			frame.calcRescaleFactors();
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenXMouseListener.java
----------------------------------------------------------------------
diff --git a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenXMouseListener.java b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenXMouseListener.java
new file mode 100644
index 0000000..8d61331
--- /dev/null
+++ b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenXMouseListener.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.screenshare.gui.listener;
+
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.event.MouseEvent;
+
+import org.apache.openmeetings.screenshare.gui.ScreenSharerFrame;
+
+public class ScreenXMouseListener extends OmMouseInputAdapter {
+	private double x = 0;
+
+	public ScreenXMouseListener(ScreenSharerFrame frame) {
+		super(frame, Cursor.W_RESIZE_CURSOR);
+		cons = e -> {this.x = e.getX();};
+	}
+
+	@Override
+	public void mouseDragged(MouseEvent e) {
+		if (!((Component)e.getSource()).isEnabled()) {
+			return;
+		}
+		double newX = e.getX();
+		int delta = (int) (x - newX);
+		int newXPosition = frame.getDim().getSpinnerX() - delta;
+		int newWidth = frame.getDim().getSpinnerWidth() + delta;
+
+		if (newXPosition >= 0 && newWidth >= 0) {
+			frame.setDoUpdateBounds(false);
+			frame.setSpinnerX(newXPosition);
+			frame.setSpinnerWidth(newWidth);
+			frame.setDoUpdateBounds(true);
+			frame.updateVScreenBounds();
+			frame.calcRescaleFactors();
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenYMouseListener.java
----------------------------------------------------------------------
diff --git a/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenYMouseListener.java b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenYMouseListener.java
new file mode 100644
index 0000000..445f397
--- /dev/null
+++ b/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screenshare/gui/listener/ScreenYMouseListener.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License") +  you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openmeetings.screenshare.gui.listener;
+
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.event.MouseEvent;
+
+import org.apache.openmeetings.screenshare.gui.ScreenSharerFrame;
+
+public class ScreenYMouseListener extends OmMouseInputAdapter {
+	private double y = 0;
+
+	public ScreenYMouseListener(ScreenSharerFrame frame) {
+		super(frame, Cursor.N_RESIZE_CURSOR);
+		cons = e -> {this.y = e.getY();};
+	}
+
+	@Override
+	public void mouseDragged(MouseEvent e) {
+		if (!((Component)e.getSource()).isEnabled()) {
+			return;
+		}
+		double newY = e.getY();
+
+		int delta = (int) (y - newY);
+		int newYPosition = frame.getDim().getSpinnerY() - delta;
+		int newHeight = frame.getDim().getSpinnerHeight() + delta;
+
+		if (newYPosition >= 0 && newHeight >= 0) {
+			frame.setDoUpdateBounds(false);
+			frame.setSpinnerY(newYPosition);
+			frame.setSpinnerHeight(newHeight);
+			frame.setDoUpdateBounds(true);
+			frame.updateVScreenBounds();
+			frame.calcRescaleFactors();
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/AbstractCalendarHandler.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/AbstractCalendarHandler.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/AbstractCalendarHandler.java
index 300302c..b459628 100644
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/AbstractCalendarHandler.java
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/AbstractCalendarHandler.java
@@ -18,22 +18,29 @@
  */
 package org.apache.openmeetings.service.calendar.caldav.handler;
 
+import static org.apache.openmeetings.util.OpenmeetingsVariables.getWebAppRootKey;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.commons.httpclient.HttpClient;
+import org.apache.jackrabbit.webdav.DavException;
+import org.apache.jackrabbit.webdav.client.methods.DavMethodBase;
 import org.apache.openmeetings.db.dao.calendar.AppointmentDao;
 import org.apache.openmeetings.db.entity.calendar.Appointment;
 import org.apache.openmeetings.db.entity.calendar.OmCalendar;
 import org.apache.openmeetings.service.calendar.caldav.IcalUtils;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import org.red5.logging.Red5LoggerFactory;
+import org.slf4j.Logger;
 
 /**
  * Abstract Class which contains all the common code for all Handlers.
  */
 public abstract class AbstractCalendarHandler implements CalendarHandler {
+	private static final Logger log = Red5LoggerFactory.getLogger(AbstractCalendarHandler.class, getWebAppRootKey());
 
-	//TODO: Check if protected is necessary.
 	protected HttpClient client;
 	protected OmCalendar calendar;
 	protected String path;
@@ -58,4 +65,27 @@ public abstract class AbstractCalendarHandler implements CalendarHandler {
 		}
 		return map;
 	}
+
+	@Override
+	public OmCalendar syncItems() {
+		DavMethodBase method = null;
+		try {
+			method = internalSyncItems();
+		} catch (IOException | DavException e) {
+			log.error("Error during the execution of calendar-multiget Report.", e);
+		} catch (Exception e) {
+			log.error("Severe Error during the execution of calendar-multiget Report.", e);
+		} finally {
+			releaseConnection(method);
+		}
+		return calendar;
+	}
+
+	void releaseConnection(DavMethodBase method) {
+		if (method != null) {
+			method.releaseConnection();
+		}
+	}
+
+	abstract DavMethodBase internalSyncItems() throws IOException, DavException;
 }

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/CtagHandler.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/CtagHandler.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/CtagHandler.java
index e73bf71..fd3dfbb 100644
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/CtagHandler.java
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/CtagHandler.java
@@ -18,9 +18,15 @@
  */
 package org.apache.openmeetings.service.calendar.caldav.handler;
 
+import static javax.servlet.http.HttpServletResponse.SC_OK;
+import static org.apache.openmeetings.util.OpenmeetingsVariables.getWebAppRootKey;
+
+import java.io.IOException;
+
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.jackrabbit.webdav.DavException;
 import org.apache.jackrabbit.webdav.MultiStatusResponse;
+import org.apache.jackrabbit.webdav.client.methods.DavMethodBase;
 import org.apache.jackrabbit.webdav.property.DavPropertyName;
 import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
 import org.apache.jackrabbit.webdav.property.DavPropertySet;
@@ -35,11 +41,6 @@ import org.osaf.caldav4j.methods.PropFindMethod;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
 
-import java.io.IOException;
-
-import static org.apache.openmeetings.util.OpenmeetingsVariables.getWebAppRootKey;
-import static org.apache.jackrabbit.webdav.DavServletResponse.SC_OK;
-
 /**
  * Class for Syncing through the help of Ctags.
  * It checks if the Ctag of the Calendar has changed.
@@ -58,45 +59,30 @@ public class CtagHandler extends AbstractCalendarHandler {
 	}
 
 	@Override
-	public OmCalendar syncItems() {
+	DavMethodBase internalSyncItems() throws IOException, DavException {
 		//Calendar already inited.
 
-		PropFindMethod propFindMethod = null;
-
-		try {
-			DavPropertyNameSet properties = new DavPropertyNameSet();
-			properties.add(DNAME_GETCTAG);
+		DavPropertyNameSet properties = new DavPropertyNameSet();
+		properties.add(DNAME_GETCTAG);
 
-			propFindMethod = new PropFindMethod(path, properties, CalDAVConstants.DEPTH_0);
-			client.executeMethod(propFindMethod);
+		PropFindMethod method = new PropFindMethod(path, properties, CalDAVConstants.DEPTH_0);
+		client.executeMethod(method);
 
-			if (propFindMethod.succeeded()) {
-				for (MultiStatusResponse response : propFindMethod.getResponseBodyAsMultiStatus().getResponses()) {
-					DavPropertySet set = response.getProperties(SC_OK);
-					String ctag = AppointmentManager.getTokenFromProperty(set.get(DNAME_GETCTAG));
+		if (method.succeeded()) {
+			for (MultiStatusResponse response : method.getResponseBodyAsMultiStatus().getResponses()) {
+				DavPropertySet set = response.getProperties(SC_OK);
+				String ctag = AppointmentManager.getTokenFromProperty(set.get(DNAME_GETCTAG));
 
-					if (ctag != null && !ctag.equals(calendar.getToken())) {
-						EtagsHandler etagsHandler = new EtagsHandler(path, calendar, client, appointmentDao, utils);
-						etagsHandler.syncItems();
-						calendar.setToken(ctag);
-					}
+				if (ctag != null && !ctag.equals(calendar.getToken())) {
+					EtagsHandler etagsHandler = new EtagsHandler(path, calendar, client, appointmentDao, utils);
+					etagsHandler.syncItems();
+					calendar.setToken(ctag);
 				}
-			} else {
-				log.error("Error executing PROPFIND Method, with status Code: "
-						+ propFindMethod.getStatusCode());
-			}
-
-		} catch (IOException | DavException e) {
-			log.error("Error during the execution of calendar-multiget Report.", e);
-		} catch (Exception e) {
-			log.error("Severe Error during the execution of calendar-multiget Report.", e);
-		} finally {
-			if (propFindMethod != null) {
-				propFindMethod.releaseConnection();
 			}
+		} else {
+			log.error("Error executing PROPFIND Method, with status Code: {}", method.getStatusCode());
 		}
-
-		return calendar;
+		return method;
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/EtagsHandler.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/EtagsHandler.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/EtagsHandler.java
index 3627d91..a037220 100644
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/EtagsHandler.java
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/EtagsHandler.java
@@ -34,6 +34,7 @@ import org.apache.commons.httpclient.Header;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.jackrabbit.webdav.DavException;
 import org.apache.jackrabbit.webdav.MultiStatusResponse;
+import org.apache.jackrabbit.webdav.client.methods.DavMethodBase;
 import org.apache.jackrabbit.webdav.property.DavPropertyName;
 import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
 import org.apache.openmeetings.db.dao.calendar.AppointmentDao;
@@ -76,7 +77,7 @@ public class EtagsHandler extends AbstractCalendarHandler {
 	}
 
 	@Override
-	public OmCalendar syncItems() {
+	DavMethodBase internalSyncItems() throws IOException, DavException {
 		Long ownerId = this.calendar.getOwner().getId();
 		Map<String, Appointment> map = listToMap(appointmentDao.getHrefsbyCalendar(calendar.getId()),
 				appointmentDao.getbyCalendar(calendar.getId()));
@@ -87,76 +88,65 @@ public class EtagsHandler extends AbstractCalendarHandler {
 		CompFilter vcalendar = new CompFilter(Calendar.VCALENDAR);
 		vcalendar.addCompFilter(new CompFilter(Component.VEVENT));
 
-		CalDAVReportMethod reportMethod = null;
-		try {
-			CalendarQuery query = new CalendarQuery(properties, vcalendar, map.isEmpty() ? new CalendarData() : null, false, false);
-			reportMethod = new CalDAVReportMethod(path, query, CalDAVConstants.DEPTH_1);
-			client.executeMethod(reportMethod);
-			if (reportMethod.succeeded()) {
-				MultiStatusResponse[] multiStatusResponses = reportMethod.getResponseBodyAsMultiStatus().getResponses();
-				if (map.isEmpty()) {
-					//Initializing the Calendar for the first time.
-
-					//Parse the responses into Appointments
-					for (MultiStatusResponse response : multiStatusResponses) {
-						if (response.getStatus()[0].getStatusCode() == SC_OK) {
-							String etag = CalendarDataProperty.getEtagfromResponse(response);
-							Calendar ical = CalendarDataProperty.getCalendarfromResponse(response);
-							Appointment appointments = utils.parseCalendartoAppointment(
-									ical, response.getHref(), etag, calendar);
-
-							appointmentDao.update(appointments, ownerId);
-						}
+		CalendarQuery query = new CalendarQuery(properties, vcalendar, map.isEmpty() ? new CalendarData() : null, false, false);
+		CalDAVReportMethod method = new CalDAVReportMethod(path, query, CalDAVConstants.DEPTH_1);
+		client.executeMethod(method);
+		if (method.succeeded()) {
+			MultiStatusResponse[] multiStatusResponses = method.getResponseBodyAsMultiStatus().getResponses();
+			if (map.isEmpty()) {
+				//Initializing the Calendar for the first time.
+
+				//Parse the responses into Appointments
+				for (MultiStatusResponse response : multiStatusResponses) {
+					if (response.getStatus()[0].getStatusCode() == SC_OK) {
+						String etag = CalendarDataProperty.getEtagfromResponse(response);
+						Calendar ical = CalendarDataProperty.getCalendarfromResponse(response);
+						Appointment appointments = utils.parseCalendartoAppointment(
+								ical, response.getHref(), etag, calendar);
+
+						appointmentDao.update(appointments, ownerId);
 					}
-				} else {
-					//Calendar has been inited before
-					List<String> currenthrefs = new ArrayList<>();
-
-					for (MultiStatusResponse response : multiStatusResponses) {
-						if (response.getStatus()[0].getStatusCode() == SC_OK) {
-							Appointment appointment = map.get(response.getHref());
-
-							//Event updated
-							if (appointment != null) {
-								String origetag = appointment.getEtag(),
-										currentetag = CalendarDataProperty.getEtagfromResponse(response);
-
-								//If etag is modified
-								if (!currentetag.equals(origetag)) {
-									currenthrefs.add(appointment.getHref());
-								}
-								map.remove(response.getHref());
-							} else {
-								// The orig list of events doesn't contain this event.
-								currenthrefs.add(response.getHref());
+				}
+			} else {
+				//Calendar has been inited before
+				List<String> currenthrefs = new ArrayList<>();
+
+				for (MultiStatusResponse response : multiStatusResponses) {
+					if (response.getStatus()[0].getStatusCode() == SC_OK) {
+						Appointment appointment = map.get(response.getHref());
+
+						//Event updated
+						if (appointment != null) {
+							String origetag = appointment.getEtag(),
+									currentetag = CalendarDataProperty.getEtagfromResponse(response);
+
+							//If etag is modified
+							if (!currentetag.equals(origetag)) {
+								currenthrefs.add(appointment.getHref());
 							}
+							map.remove(response.getHref());
+						} else {
+							// The orig list of events doesn't contain this event.
+							currenthrefs.add(response.getHref());
 						}
 					}
+				}
 
-					//Remaining Events have been deleted on the server, thus delete them
-					for (Map.Entry<String, Appointment> entry : map.entrySet()) {
-						appointmentDao.delete(entry.getValue(), ownerId);
-					}
-
-					//Get the rest of the events through a Multiget Handler.
-					MultigetHandler multigetHandler = new MultigetHandler(currenthrefs, path,
-							calendar, client, appointmentDao, utils);
-					return multigetHandler.syncItems();
+				//Remaining Events have been deleted on the server, thus delete them
+				for (Map.Entry<String, Appointment> entry : map.entrySet()) {
+					appointmentDao.delete(entry.getValue(), ownerId);
 				}
-			} else {
-				log.error("Report Method return Status: {} for calId {} ", reportMethod.getStatusCode(), calendar.getId());
-			}
-		} catch (IOException | DavException e) {
-			log.error("Error during the execution of calendar-multiget Report.", e);
-		} catch (Exception e) {
-			log.error("Severe Error during the execution of calendar-multiget Report.", e);
-		} finally {
-			if (reportMethod != null) {
-				reportMethod.releaseConnection();
+
+				//Get the rest of the events through a Multiget Handler.
+				MultigetHandler multigetHandler = new MultigetHandler(currenthrefs, path,
+						calendar, client, appointmentDao, utils);
+				releaseConnection(method);
+				return multigetHandler.internalSyncItems();
 			}
+		} else {
+			log.error("Report Method return Status: {} for calId {} ", method.getStatusCode(), calendar.getId());
 		}
-
-		return calendar;
+		return method;
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/MultigetHandler.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/MultigetHandler.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/MultigetHandler.java
index d773d31..99e3ce3 100644
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/MultigetHandler.java
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/MultigetHandler.java
@@ -28,6 +28,7 @@ import java.util.Map;
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.jackrabbit.webdav.DavException;
 import org.apache.jackrabbit.webdav.MultiStatusResponse;
+import org.apache.jackrabbit.webdav.client.methods.DavMethodBase;
 import org.apache.jackrabbit.webdav.property.DavPropertyName;
 import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
 import org.apache.openmeetings.db.dao.calendar.AppointmentDao;
@@ -89,68 +90,54 @@ public class MultigetHandler extends AbstractCalendarHandler {
 	}
 
 	@Override
-	public OmCalendar syncItems() {
+	DavMethodBase internalSyncItems() throws IOException, DavException {
 		Long ownerId = this.calendar.getOwner().getId();
 		if (!isMultigetDisabled) {
-
-			CalDAVReportMethod reportMethod = null;
-
-			try {
-				reportMethod = new CalDAVReportMethod(path, query, CalDAVConstants.DEPTH_1);
-
-				client.executeMethod(reportMethod);
-
-				if (reportMethod.succeeded()) {
-					//Map for each Href as key and Appointment as Value.
-					Map<String, Appointment> map = listToMap(appointmentDao.getHrefsbyCalendar(calendar.getId()),
-							appointmentDao.getbyCalendar(calendar.getId()));
-
-					for (MultiStatusResponse response : reportMethod.getResponseBodyAsMultiStatus().getResponses()) {
-						if (response.getStatus()[0].getStatusCode() == SC_OK) {
-							Appointment a = map.get(response.getHref());
-
-							//Check if it's an updated Appointment
-							if (a != null) {
-								String origetag = a.getEtag(),
-										currentetag = CalendarDataProperty.getEtagfromResponse(response);
-
-								//If etag is modified
-								if (!currentetag.equals(origetag)) {
-									if (onlyEtag) {
-										a.setEtag(currentetag);
-									} else {
-										Calendar calendar = CalendarDataProperty.getCalendarfromResponse(response);
-										a = utils.parseCalendartoAppointment(a, calendar, currentetag);
-									}
-									appointmentDao.update(a, ownerId);
+			CalDAVReportMethod method = new CalDAVReportMethod(path, query, CalDAVConstants.DEPTH_1);
+
+			client.executeMethod(method);
+			if (method.succeeded()) {
+				//Map for each Href as key and Appointment as Value.
+				Map<String, Appointment> map = listToMap(appointmentDao.getHrefsbyCalendar(calendar.getId()),
+						appointmentDao.getbyCalendar(calendar.getId()));
+
+				for (MultiStatusResponse response : method.getResponseBodyAsMultiStatus().getResponses()) {
+					if (response.getStatus()[0].getStatusCode() == SC_OK) {
+						Appointment a = map.get(response.getHref());
+
+						//Check if it's an updated Appointment
+						if (a != null) {
+							String origetag = a.getEtag(),
+									currentetag = CalendarDataProperty.getEtagfromResponse(response);
+
+							//If etag is modified
+							if (!currentetag.equals(origetag)) {
+								if (onlyEtag) {
+									a.setEtag(currentetag);
+								} else {
+									Calendar calendar = CalendarDataProperty.getCalendarfromResponse(response);
+									a = utils.parseCalendartoAppointment(a, calendar, currentetag);
 								}
-							} else if (!onlyEtag) {
-								//Else it's a new Appointment
-								// i.e. parse into a new Appointment
-								// Only applicable when we get calendar data along with etag.
-								String etag = CalendarDataProperty.getEtagfromResponse(response);
-								Calendar ical = CalendarDataProperty.getCalendarfromResponse(response);
-								Appointment appointments = utils.parseCalendartoAppointment(
-										ical, response.getHref(), etag, calendar);
-								appointmentDao.update(appointments, ownerId);
+								appointmentDao.update(a, ownerId);
 							}
+						} else if (!onlyEtag) {
+							//Else it's a new Appointment
+							// i.e. parse into a new Appointment
+							// Only applicable when we get calendar data along with etag.
+							String etag = CalendarDataProperty.getEtagfromResponse(response);
+							Calendar ical = CalendarDataProperty.getCalendarfromResponse(response);
+							Appointment appointments = utils.parseCalendartoAppointment(
+									ical, response.getHref(), etag, calendar);
+							appointmentDao.update(appointments, ownerId);
 						}
 					}
-				} else {
-					log.error("Report Method return Status: {} for calId {}", reportMethod.getStatusCode(), calendar.getId());
-				}
-			} catch (IOException | DavException e) {
-				log.error("Error during the execution of calendar-multiget Report.", e);
-			} catch (Exception e) {
-				log.error("Severe Error during the execution of calendar-multiget Report.", e);
-			} finally {
-				if (reportMethod != null) {
-					reportMethod.releaseConnection();
 				}
+			} else {
+				log.error("Report Method return Status: {} for calId {}", method.getStatusCode(), calendar.getId());
 			}
+			return method;
 		}
-
-		return calendar;
+		return null;
 	}
 
 	// Doesn't handle Creation, Updation and Deletion of events.

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/WebDAVSyncHandler.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/WebDAVSyncHandler.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/WebDAVSyncHandler.java
index baf434b..3dde420 100644
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/WebDAVSyncHandler.java
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/calendar/caldav/handler/WebDAVSyncHandler.java
@@ -19,8 +19,22 @@
 package org.apache.openmeetings.service.calendar.caldav.handler;
 
 
+import static javax.servlet.http.HttpServletResponse.SC_FORBIDDEN;
+import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND;
+import static javax.servlet.http.HttpServletResponse.SC_OK;
+import static javax.servlet.http.HttpServletResponse.SC_PRECONDITION_FAILED;
+import static org.apache.jackrabbit.webdav.DavServletResponse.SC_INSUFFICIENT_SPACE_ON_RESOURCE;
+import static org.apache.openmeetings.util.OpenmeetingsVariables.getWebAppRootKey;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.commons.httpclient.HttpClient;
+import org.apache.jackrabbit.webdav.DavException;
 import org.apache.jackrabbit.webdav.MultiStatusResponse;
+import org.apache.jackrabbit.webdav.client.methods.DavMethodBase;
 import org.apache.jackrabbit.webdav.property.DavPropertyName;
 import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
 import org.apache.openmeetings.db.dao.calendar.AppointmentDao;
@@ -33,18 +47,6 @@ import org.osaf.caldav4j.model.response.CalendarDataProperty;
 import org.red5.logging.Red5LoggerFactory;
 import org.slf4j.Logger;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import static org.apache.jackrabbit.webdav.DavServletResponse.SC_INSUFFICIENT_SPACE_ON_RESOURCE;
-import static org.apache.jackrabbit.webdav.DavServletResponse.SC_OK;
-import static org.apache.jackrabbit.webdav.DavServletResponse.SC_FORBIDDEN;
-import static org.apache.jackrabbit.webdav.DavServletResponse.SC_PRECONDITION_FAILED;
-import static org.apache.jackrabbit.webdav.DavServletResponse.SC_NOT_FOUND;
-import static org.apache.openmeetings.util.OpenmeetingsVariables.getWebAppRootKey;
-
 /**
  * Class used to sync events using WebDAV-Sync defined in RFC 6578.
  * This handles the additional HTTP Status Code 507, which specifies for further sync required.
@@ -62,89 +64,77 @@ public class WebDAVSyncHandler extends AbstractCalendarHandler {
 	}
 
 	@Override
-	public OmCalendar syncItems() {
+	DavMethodBase internalSyncItems() throws IOException, DavException {
 		boolean additionalSyncNeeded = false;
 
-		SyncMethod syncMethod = null;
-
-		try {
-			DavPropertyNameSet properties = new DavPropertyNameSet();
-			properties.add(DavPropertyName.GETETAG);
-
-			//Create report to get
-			SyncReportInfo reportInfo = new SyncReportInfo(calendar.getToken(), properties,
-					SyncReportInfo.SYNC_LEVEL_1);
-			syncMethod = new SyncMethod(path, reportInfo);
-			client.executeMethod(syncMethod);
-
-			if (syncMethod.succeeded()) {
-				List<String> currenthrefs = new ArrayList<>();
-
-				//Map of Href and the Appointments, belonging to it.
-				Map<String, Appointment> map = listToMap(appointmentDao.getHrefsbyCalendar(calendar.getId()),
-						appointmentDao.getbyCalendar(calendar.getId()));
-
-				for (MultiStatusResponse response : syncMethod.getResponseBodyAsMultiStatus().getResponses()) {
-					int status = response.getStatus()[0].getStatusCode();
-					if (status == SC_OK) {
-						Appointment a = map.get(response.getHref());
-
-						if (a != null) {
-							//Old Event to get
-							String origetag = a.getEtag(),
-									currentetag = CalendarDataProperty.getEtagfromResponse(response);
-
-							//If event modified, only then get it.
-							if (!currentetag.equals(origetag)) {
-								currenthrefs.add(response.getHref());
-							}
-						} else {
-							//New Event, to get
+		DavPropertyNameSet properties = new DavPropertyNameSet();
+		properties.add(DavPropertyName.GETETAG);
+
+		//Create report to get
+		SyncReportInfo reportInfo = new SyncReportInfo(calendar.getToken(), properties, SyncReportInfo.SYNC_LEVEL_1);
+		SyncMethod method = new SyncMethod(path, reportInfo);
+		client.executeMethod(method);
+
+		if (method.succeeded()) {
+			List<String> currenthrefs = new ArrayList<>();
+
+			//Map of Href and the Appointments, belonging to it.
+			Map<String, Appointment> map = listToMap(appointmentDao.getHrefsbyCalendar(calendar.getId()),
+					appointmentDao.getbyCalendar(calendar.getId()));
+
+			for (MultiStatusResponse response : method.getResponseBodyAsMultiStatus().getResponses()) {
+				int status = response.getStatus()[0].getStatusCode();
+				if (status == SC_OK) {
+					Appointment a = map.get(response.getHref());
+
+					if (a != null) {
+						//Old Event to get
+						String origetag = a.getEtag(),
+								currentetag = CalendarDataProperty.getEtagfromResponse(response);
+
+						//If event modified, only then get it.
+						if (!currentetag.equals(origetag)) {
 							currenthrefs.add(response.getHref());
 						}
-					} else if (status == SC_NOT_FOUND) {
-						//Delete the Appointments not found on the server.
-						Appointment a = map.get(response.getHref());
+					} else {
+						//New Event, to get
+						currenthrefs.add(response.getHref());
+					}
+				} else if (status == SC_NOT_FOUND) {
+					//Delete the Appointments not found on the server.
+					Appointment a = map.get(response.getHref());
 
-						//Only if the event exists on the database, delete it.
-						if (a != null) {
-							appointmentDao.delete(a, calendar.getOwner().getId());
-						}
-					} else if (status == SC_INSUFFICIENT_SPACE_ON_RESOURCE) {
-						additionalSyncNeeded = true;
+					//Only if the event exists on the database, delete it.
+					if (a != null) {
+						appointmentDao.delete(a, calendar.getOwner().getId());
 					}
+				} else if (status == SC_INSUFFICIENT_SPACE_ON_RESOURCE) {
+					additionalSyncNeeded = true;
 				}
+			}
 
 
-				MultigetHandler multigetHandler = new MultigetHandler(currenthrefs, path,
-						calendar, client, appointmentDao, utils);
-				multigetHandler.syncItems();
-
-				//Set the new token
-				calendar.setToken(syncMethod.getResponseSynctoken());
-			} else if (syncMethod.getStatusCode() == SC_FORBIDDEN ||
-					syncMethod.getStatusCode() == SC_PRECONDITION_FAILED) {
+			MultigetHandler multigetHandler = new MultigetHandler(currenthrefs, path,
+					calendar, client, appointmentDao, utils);
+			multigetHandler.syncItems();
 
-				//Specific case where a server might sometimes forget the sync token
-				//Thus requiring a full sync needed to be done.
-				log.info("Sync Token not accepted by server. Doing a full sync again.");
-				calendar.setToken(null);
-				additionalSyncNeeded = true;
-			} else {
-				log.error("Error in Sync Method Response with status code {}", syncMethod.getStatusCode());
-			}
+			//Set the new token
+			calendar.setToken(method.getResponseSynctoken());
+		} else if (method.getStatusCode() == SC_FORBIDDEN || method.getStatusCode() == SC_PRECONDITION_FAILED) {
 
-		} catch (IOException e) {
-			log.error("Error while executing the SyncMethod Report.", e);
-		} catch (Exception e) {
-			log.error("Severe Error while executing the SyncMethod Report.", e);
-		} finally {
-			if (syncMethod != null) {
-				syncMethod.releaseConnection();
-			}
+			//Specific case where a server might sometimes forget the sync token
+			//Thus requiring a full sync needed to be done.
+			log.info("Sync Token not accepted by server. Doing a full sync again.");
+			calendar.setToken(null);
+			additionalSyncNeeded = true;
+		} else {
+			log.error("Error in Sync Method Response with status code {}", method.getStatusCode());
 		}
-
-		return additionalSyncNeeded ? syncItems() : calendar;
+		if (additionalSyncNeeded) {
+			releaseConnection(method);
+			return internalSyncItems();
+		}
+		return method;
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AbstractAppointmentTemplate.html
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AbstractAppointmentTemplate.html b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AbstractAppointmentTemplate.html
deleted file mode 100644
index dbfdea4..0000000
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AbstractAppointmentTemplate.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<html xmlns:wicket="http://wicket.apache.org">
-<wicket:extend>
-	<wicket:child/>
-
-	<wicket:fragment wicket:id="subject"><span wicket:id="prefix"></span> <span wicket:id="title"></span> <span
-		wicket:id="start"></span><span wicket:id="dash"></span><span wicket:id="end"></span></wicket:fragment>
-</wicket:extend>
-</html>

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AbstractAppointmentTemplate.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AbstractAppointmentTemplate.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AbstractAppointmentTemplate.java
deleted file mode 100644
index 9f8045a..0000000
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AbstractAppointmentTemplate.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") +  you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.service.mail.template.subject;
-
-import static org.apache.commons.lang3.time.FastDateFormat.MEDIUM;
-import static org.apache.commons.lang3.time.FastDateFormat.SHORT;
-
-import java.util.Date;
-import java.util.Locale;
-import java.util.TimeZone;
-
-import org.apache.commons.lang3.time.FastDateFormat;
-import org.apache.openmeetings.db.entity.calendar.Appointment;
-import org.apache.openmeetings.service.mail.template.DashOmTextLabel;
-import org.apache.openmeetings.service.mail.template.OmTextLabel;
-import org.apache.wicket.markup.html.panel.Fragment;
-
-public abstract class AbstractAppointmentTemplate extends AbstractSubjectEmailTemplate {
-	private static final long serialVersionUID = 1L;
-	protected Appointment a;
-	protected TimeZone tz;
-
-	public AbstractAppointmentTemplate(Locale locale, Appointment a, TimeZone tz) {
-		super(locale);
-		this.a = a;
-		this.tz = tz;
-	}
-
-	abstract String getPrefix();
-
-	@Override
-	Fragment getSubjectFragment() {
-		Fragment f = new Fragment(COMP_ID, "subject", this);
-		f.add(new OmTextLabel("prefix", getPrefix())
-				, new OmTextLabel("title", a.getTitle())
-				, new OmTextLabel("start", format(a.getStart(), SHORT))
-				, new DashOmTextLabel("dash")
-				, new OmTextLabel("end", format(a.getEnd(), SHORT))
-				);
-		return f;
-	}
-
-	protected String format(Date d) {
-		return format(d, MEDIUM);
-	}
-
-	protected String format(Date d, int fmt) {
-		return FastDateFormat.getDateTimeInstance(fmt, fmt, tz, locale).format(d);
-	}
-}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AbstractSubjectEmailTemplate.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AbstractSubjectEmailTemplate.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AbstractSubjectEmailTemplate.java
deleted file mode 100644
index 0574c1d..0000000
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AbstractSubjectEmailTemplate.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") +  you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.service.mail.template.subject;
-
-import java.util.Locale;
-
-import org.apache.openmeetings.service.mail.template.AbstractTemplatePanel;
-import org.apache.wicket.core.util.string.ComponentRenderer;
-import org.apache.wicket.markup.html.panel.Fragment;
-
-public abstract class AbstractSubjectEmailTemplate extends AbstractTemplatePanel {
-	private static final long serialVersionUID = 1L;
-	private String email = null;
-	private String subject = null;
-	private boolean created = false;
-
-	public AbstractSubjectEmailTemplate(Locale locale) {
-		super(locale);
-	}
-
-	AbstractSubjectEmailTemplate create() {
-		email = ComponentRenderer.renderComponent(this).toString();
-		subject = ComponentRenderer.renderComponent(getSubjectFragment()).toString();
-		created = true;
-		return this;
-	}
-
-	abstract Fragment getSubjectFragment();
-
-	public final String getEmail() {
-		if (!created) {
-			throw new RuntimeException("Not created!!");
-		}
-		return email;
-	}
-
-	public final String getSubject() {
-		if (!created) {
-			throw new RuntimeException("Not created!!");
-		}
-		return subject;
-	}
-}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentReminderTemplate.html
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentReminderTemplate.html b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentReminderTemplate.html
deleted file mode 100644
index 4f3b0bf..0000000
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentReminderTemplate.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<html xmlns:wicket="http://wicket.apache.org">
-<wicket:extend>
-	<span wicket:id="titleLbl"></span>&nbsp;<span wicket:id="title"></span>
-	<div wicket:id="descContainer">
-		<br/>
-		<span wicket:id="descLbl"></span><br/>
-		&nbsp;<span wicket:id="desc"></span>
-	</div>
-	<br/>
-	<span wicket:id="startLbl"></span>&nbsp;<span wicket:id="start"></span><br/>
-	<span wicket:id="endLbl"></span>&nbsp;<span wicket:id="end"></span><br/>
-</wicket:extend>
-</html>

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentReminderTemplate.java
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentReminderTemplate.java b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentReminderTemplate.java
index 6142f02..744cd1c 100644
--- a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentReminderTemplate.java
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentReminderTemplate.java
@@ -26,11 +26,9 @@ import java.util.TimeZone;
 import org.apache.openmeetings.db.entity.calendar.Appointment;
 import org.apache.openmeetings.db.entity.user.User;
 import org.apache.openmeetings.db.util.LocaleHelper;
-import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.html.basic.Label;
-import org.apache.wicket.util.string.Strings;
 
-public class AppointmentReminderTemplate extends AbstractAppointmentTemplate {
+public class AppointmentReminderTemplate extends AppointmentTemplate {
 	private static final long serialVersionUID = 1L;
 
 	private AppointmentReminderTemplate(Locale locale, Appointment a, TimeZone tz) {
@@ -41,19 +39,9 @@ public class AppointmentReminderTemplate extends AbstractAppointmentTemplate {
 	protected void onInitialize() {
 		super.onInitialize();
 		add(new Label("titleLbl", getString("1158", locale)));
-		add(new Label("title", a.getTitle()));
-		add(new WebMarkupContainer("descContainer")
-			.add(new Label("descLbl", getString("1152", locale)))
-			.add(new Label("desc", a.getDescription()).setEscapeModelStrings(false))
-			.setVisible(!Strings.isEmpty(a.getDescription()))
-			);
-		add(new Label("startLbl", getString("1153", locale)));
-		add(new Label("start", format(a.getStart())));
-		add(new Label("endLbl", getString("1154", locale)));
-		add(new Label("end", format(a.getEnd())));
 	}
 
-	public static AbstractSubjectEmailTemplate get(User u, Appointment a, TimeZone tz) {
+	public static SubjectEmailTemplate get(User u, Appointment a, TimeZone tz) {
 		ensureApplication(u.getLanguageId());
 		return new AppointmentReminderTemplate(LocaleHelper.getLocale(u), a, tz).create();
 	}

http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8eb27129/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentTemplate.html
----------------------------------------------------------------------
diff --git a/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentTemplate.html b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentTemplate.html
new file mode 100644
index 0000000..a19fee9
--- /dev/null
+++ b/openmeetings-service/src/main/java/org/apache/openmeetings/service/mail/template/subject/AppointmentTemplate.html
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<html xmlns:wicket="http://wicket.apache.org">
+<wicket:extend>
+	<span wicket:id="titleLbl"></span>&nbsp;<span wicket:id="title"></span>
+	<div wicket:id="descContainer">
+		<br/>
+		<span wicket:id="descLbl"></span><br/>
+		&nbsp;<span wicket:id="desc"></span>
+	</div>
+	<br/>
+	<span wicket:id="startLbl"></span>&nbsp;<span wicket:id="start"></span><br/>
+	<span wicket:id="endLbl"></span>&nbsp;<span wicket:id="end"></span><br/>
+	<wicket:child/>
+
+	<wicket:fragment wicket:id="subject"><span wicket:id="prefix"></span> <span wicket:id="title"></span> <span
+		wicket:id="start"></span><span wicket:id="dash"></span><span wicket:id="end"></span></wicket:fragment>
+</wicket:extend>
+</html>