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 2012/09/14 08:05:48 UTC

svn commit: r1384652 - in /incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web: app/ components/ components/admin/ components/admin/labels/ components/user/ components/user/calendar/ pages/ pages/auth/

Author: solomax
Date: Fri Sep 14 06:05:47 2012
New Revision: 1384652

URL: http://svn.apache.org/viewvc?rev=1384652&view=rev
Log:
Wicket: ConfirmableAjaxLink is added; licenses are added

Added:
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/ConfirmableAjaxLink.java
Modified:
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/app/WebSession.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/UserPanel.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/AdminBaseFormPanel.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/labels/LangPanel.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/ChatPanel.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/calendar/CalendarPanel.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/MainPage.html
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/MainPage.java
    incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/auth/SignInPage.html

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/app/WebSession.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/app/WebSession.java?rev=1384652&r1=1384651&r2=1384652&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/app/WebSession.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/app/WebSession.java Fri Sep 14 06:05:47 2012
@@ -78,6 +78,9 @@ public class WebSession extends Abstract
 		
 		if (u instanceof Users) {
 			userId = ((Users)u).getUser_id();
+			if (null == getId()) {
+				bind();
+			}
 			Application.get().addLiveSession(this);
 			return true;
 		}

Added: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/ConfirmableAjaxLink.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/ConfirmableAjaxLink.java?rev=1384652&view=auto
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/ConfirmableAjaxLink.java (added)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/ConfirmableAjaxLink.java Fri Sep 14 06:05:47 2012
@@ -0,0 +1,48 @@
+/*
+ * 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.web.components;
+
+import org.apache.wicket.Component;
+import org.apache.wicket.ajax.attributes.AjaxCallListener;
+import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+
+public abstract class ConfirmableAjaxLink extends AjaxLink<Void> {
+	private static final long serialVersionUID = 7301747891668537168L;
+	private String confirmText;
+
+	public ConfirmableAjaxLink(String id, String text) {
+		super(id);
+		confirmText = text;
+	}
+
+	//TODO confirm need to be replaced with jQuery modal dialog
+	@Override
+	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
+		super.updateAjaxAttributes(attributes);
+		attributes.getAjaxCallListeners().add(new AjaxCallListener() {
+			private static final long serialVersionUID = 485123450543463471L;
+
+			@Override
+			public CharSequence getPrecondition(Component component) {
+				return "if (!confirm('" + confirmText + "')) {hideBusyIndicator(); return false;}";
+			}
+		});
+	}
+}

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/UserPanel.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/UserPanel.java?rev=1384652&r1=1384651&r2=1384652&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/UserPanel.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/UserPanel.java Fri Sep 14 06:05:47 2012
@@ -1,3 +1,21 @@
+/*
+ * 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.web.components;
 
 import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/AdminBaseFormPanel.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/AdminBaseFormPanel.java?rev=1384652&r1=1384651&r2=1384652&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/AdminBaseFormPanel.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/AdminBaseFormPanel.java Fri Sep 14 06:05:47 2012
@@ -1,3 +1,21 @@
+/*
+ * 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.web.components.admin;
 
 import org.apache.wicket.ajax.AjaxRequestTarget;

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/labels/LangPanel.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/labels/LangPanel.java?rev=1384652&r1=1384651&r2=1384652&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/labels/LangPanel.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/labels/LangPanel.java Fri Sep 14 06:05:47 2012
@@ -37,8 +37,6 @@ import org.apache.wicket.markup.html.for
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.repeater.Item;
 import org.apache.wicket.markup.repeater.data.DataView;
-import org.apache.wicket.model.CompoundPropertyModel;
-import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
 
 public class LangPanel extends AdminPanel {

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/ChatPanel.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/ChatPanel.java?rev=1384652&r1=1384651&r2=1384652&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/ChatPanel.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/ChatPanel.java Fri Sep 14 06:05:47 2012
@@ -1,3 +1,21 @@
+/*
+ * 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.web.components.user;
 
 import org.apache.openmeetings.web.components.UserPanel;

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/calendar/CalendarPanel.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/calendar/CalendarPanel.java?rev=1384652&r1=1384651&r2=1384652&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/calendar/CalendarPanel.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/user/calendar/CalendarPanel.java Fri Sep 14 06:05:47 2012
@@ -1,3 +1,21 @@
+/*
+ * 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.web.components.user.calendar;
 
 import org.apache.openmeetings.web.components.UserPanel;

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/MainPage.html
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/MainPage.html?rev=1384652&r1=1384651&r2=1384652&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/MainPage.html (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/MainPage.html Fri Sep 14 06:05:47 2012
@@ -27,13 +27,17 @@
 		<script type="text/javascript" src="js/jquery-ui-1.8.23.custom.min.js"></script>
 		<link media="screen" type="text/css" rel="stylesheet" href="css/jquery-ui-1.8.23.custom.css"/>
 		<script type="text/javascript">
+			function showBusyIndicator() {
+				$('#busy_indicator').show();
+			}
+			function hideBusyIndicator() {
+				$('#busy_indicator').hide();
+			}
 			$(function() {
-				Wicket.Event.subscribe('/ajax/call/failure'
-					, function(jqEvent, attributes, jqXHR, errorThrown, textStatus) { $('#busy_indicator').hide();});
-				Wicket.Event.subscribe('/ajax/call/before'
-						, function(jqEvent, attributes, jqXHR, errorThrown, textStatus) { $('#busy_indicator').show();});
-				Wicket.Event.subscribe('/ajax/call/success'
-						, function(jqEvent, attributes, jqXHR, errorThrown, textStatus) { $('#busy_indicator').hide();});
+				Wicket.Event.subscribe('/ajax/call/failure', hideBusyIndicator);
+				Wicket.Event.subscribe('/ajax/call/before', showBusyIndicator);
+				Wicket.Event.subscribe('/ajax/call/success', hideBusyIndicator);
+				Wicket.Event.subscribe('/ajax/call/complete', hideBusyIndicator);
 			});
 		</script>
 	</wicket:head>

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/MainPage.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/MainPage.java?rev=1384652&r1=1384651&r2=1384652&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/MainPage.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/MainPage.java Fri Sep 14 06:05:47 2012
@@ -19,11 +19,12 @@
 package org.apache.openmeetings.web.pages;
 
 import org.apache.openmeetings.web.app.Application;
+import org.apache.openmeetings.web.app.WebSession;
+import org.apache.openmeetings.web.components.ConfirmableAjaxLink;
 import org.apache.openmeetings.web.components.MenuPanel;
 import org.apache.openmeetings.web.components.user.ChatPanel;
 import org.apache.wicket.MarkupContainer;
 import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.ajax.markup.html.AjaxLink;
 import org.apache.wicket.authroles.authorization.strategies.role.annotations.AuthorizeInstantiation;
 import org.apache.wicket.markup.html.WebMarkupContainer;
 
@@ -38,7 +39,7 @@ public class MainPage extends BasePage {
 		add(contents);
 		menu = new MenuPanel("menu", contents);
 		add(menu);
-		add(new AjaxLink<Void>("logout") {
+		add(new ConfirmableAjaxLink("logout", WebSession.getString(634L)) {
 			private static final long serialVersionUID = -2994610981053570537L;
 
 			@Override

Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/auth/SignInPage.html
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/auth/SignInPage.html?rev=1384652&r1=1384651&r2=1384652&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/auth/SignInPage.html (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/pages/auth/SignInPage.html Fri Sep 14 06:05:47 2012
@@ -27,12 +27,16 @@
 			#login .ui-dialog .ui-dialog-titlebar-close {
 				display: none;
 			}
+			#login input {
+				width: 100px;
+			}
 		</style>
 		<script type="text/javascript">
 			$(function(){
 				$('#login').dialog({
 					closeOnEscape: false
 					, resizable: false
+					, width: 400
 					, open: function(event, ui) {
 						$(".ui-dialog-titlebar-close").hide();
 					}