http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/ConfirmableAjaxBorder.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/ConfirmableAjaxBorder.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/ConfirmableAjaxBorder.java index dd6c2a7..81c8468 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/ConfirmableAjaxBorder.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/ConfirmableAjaxBorder.java @@ -1,177 +1,177 @@ -/* - * 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.common; - -import java.io.Serializable; -import java.util.function.Consumer; - -import org.apache.wicket.ajax.AjaxEventBehavior; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; -import org.apache.wicket.markup.html.border.Border; -import org.apache.wicket.markup.html.form.Form; -import org.apache.wicket.markup.html.panel.EmptyPanel; -import org.apache.wicket.model.Model; - -import com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog; -import com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton; -import com.googlecode.wicket.jquery.ui.widget.dialog.DialogButtons; -import com.googlecode.wicket.jquery.ui.widget.dialog.DialogIcon; -import com.googlecode.wicket.jquery.ui.widget.dialog.MessageFormDialog; - -public abstract class ConfirmableAjaxBorder extends Border { - private static final long serialVersionUID = 1L; - private static final String DIALOG_ID = "dialog"; - protected final Form<?> form = new Form<>("form"); - private final ConfirmableBorderDialog dialog; - - public ConfirmableAjaxBorder(String id, String title, String message) { - this(id, title, message, null, null); - } - - public ConfirmableAjaxBorder(String id, String title, String message, Form<?> form) { - this(id, title, message, form, null); - } - - public ConfirmableAjaxBorder(String id, String title, String message, ConfirmableBorderDialog dialog) { - this(id, title, message, null, dialog); - } - - public ConfirmableAjaxBorder(String id, String title, String message, Form<?> userForm, ConfirmableBorderDialog dialog) { - super(id, Model.of(message)); - if (dialog == null) { - this.dialog = new ConfirmableBorderDialog(DIALOG_ID, title, message, userForm == null ? form : userForm); - form.add(this.dialog); - } else { - this.dialog = dialog; - form.add(new EmptyPanel(DIALOG_ID)); - } - this.dialog.setSubmitHandler((Consumer<AjaxRequestTarget> & Serializable)(t)->onSubmit(t)); - this.dialog.setErrorHandler((Consumer<AjaxRequestTarget> & Serializable)(t)->onError(t)); - setOutputMarkupId(true); - } - - public AbstractFormDialog<?> getDialog() { - return dialog; - } - - @Override - protected void onInitialize() { - super.onInitialize(); - add(new AjaxEventBehavior("click") { - private static final long serialVersionUID = 1L; - - @Override - protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { - super.updateAjaxAttributes(attributes); - ConfirmableAjaxBorder.this.updateAjaxAttributes(attributes); - } - - @Override - protected void onEvent(AjaxRequestTarget target) { - if (isClickable()) { - dialog.open(target); - } - } - }); - addToBorder(form); - } - - protected boolean isClickable() { - return true; - } - - /** - * Gives a chance to the specializations to modify the attributes. - * - * @param attributes attributes - */ - protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { - } - - protected void onEvent(AjaxRequestTarget target) { - dialog.open(target); - } - - /** - * Triggered when the form is submitted, but the validation failed - * - * @param target the {@link AjaxRequestTarget} - * @param form the {@link Form} - */ - protected void onError(AjaxRequestTarget target) { - } - - /** - * Triggered when the form is submitted, and the validation succeed - * - * @param target the {@link AjaxRequestTarget} - * @param form the {@link Form} - */ - protected abstract void onSubmit(AjaxRequestTarget target); - - public static class ConfirmableBorderDialog extends MessageFormDialog { - private static final long serialVersionUID = 1L; - private Form<?> form; - private Consumer<AjaxRequestTarget> submitHandler = null; - private Consumer<AjaxRequestTarget> errorHandler = null; - - public ConfirmableBorderDialog(String id, String title, String message) { - this(id, title, message, null); - } - - public ConfirmableBorderDialog(String id, String title, String message, Form<?> form) { - super(id, title, message, DialogButtons.OK_CANCEL, DialogIcon.WARN); - this.form = form; - } - - public void setSubmitHandler(Consumer<AjaxRequestTarget> submitHandler) { - this.submitHandler = submitHandler; - } - - public void setErrorHandler(Consumer<AjaxRequestTarget> errorHandler) { - this.errorHandler = errorHandler; - } - - @Override - public DialogButton getSubmitButton() { - return this.findButton(OK); - } - - @Override - public Form<?> getForm() { - return this.form; - } - - @Override - protected void onError(AjaxRequestTarget target) { - super.close(target, null); // closes the dialog on error. - if (errorHandler != null) { - errorHandler.accept(target); - } - } - - @Override - protected void onSubmit(AjaxRequestTarget target) { - if (submitHandler != null) { - submitHandler.accept(target); - } - } - } -} +/* + * 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.common; + +import java.io.Serializable; +import java.util.function.Consumer; + +import org.apache.wicket.ajax.AjaxEventBehavior; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.ajax.attributes.AjaxRequestAttributes; +import org.apache.wicket.markup.html.border.Border; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.markup.html.panel.EmptyPanel; +import org.apache.wicket.model.Model; + +import com.googlecode.wicket.jquery.ui.widget.dialog.AbstractFormDialog; +import com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton; +import com.googlecode.wicket.jquery.ui.widget.dialog.DialogButtons; +import com.googlecode.wicket.jquery.ui.widget.dialog.DialogIcon; +import com.googlecode.wicket.jquery.ui.widget.dialog.MessageFormDialog; + +public abstract class ConfirmableAjaxBorder extends Border { + private static final long serialVersionUID = 1L; + private static final String DIALOG_ID = "dialog"; + protected final Form<?> form = new Form<>("form"); + private final ConfirmableBorderDialog dialog; + + public ConfirmableAjaxBorder(String id, String title, String message) { + this(id, title, message, null, null); + } + + public ConfirmableAjaxBorder(String id, String title, String message, Form<?> form) { + this(id, title, message, form, null); + } + + public ConfirmableAjaxBorder(String id, String title, String message, ConfirmableBorderDialog dialog) { + this(id, title, message, null, dialog); + } + + public ConfirmableAjaxBorder(String id, String title, String message, Form<?> userForm, ConfirmableBorderDialog dialog) { + super(id, Model.of(message)); + if (dialog == null) { + this.dialog = new ConfirmableBorderDialog(DIALOG_ID, title, message, userForm == null ? form : userForm); + form.add(this.dialog); + } else { + this.dialog = dialog; + form.add(new EmptyPanel(DIALOG_ID)); + } + this.dialog.setSubmitHandler((Consumer<AjaxRequestTarget> & Serializable)(t)->onSubmit(t)); + this.dialog.setErrorHandler((Consumer<AjaxRequestTarget> & Serializable)(t)->onError(t)); + setOutputMarkupId(true); + } + + public AbstractFormDialog<?> getDialog() { + return dialog; + } + + @Override + protected void onInitialize() { + super.onInitialize(); + add(new AjaxEventBehavior("click") { + private static final long serialVersionUID = 1L; + + @Override + protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { + super.updateAjaxAttributes(attributes); + ConfirmableAjaxBorder.this.updateAjaxAttributes(attributes); + } + + @Override + protected void onEvent(AjaxRequestTarget target) { + if (isClickable()) { + dialog.open(target); + } + } + }); + addToBorder(form); + } + + protected boolean isClickable() { + return true; + } + + /** + * Gives a chance to the specializations to modify the attributes. + * + * @param attributes attributes + */ + protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { + } + + protected void onEvent(AjaxRequestTarget target) { + dialog.open(target); + } + + /** + * Triggered when the form is submitted, but the validation failed + * + * @param target the {@link AjaxRequestTarget} + * @param form the {@link Form} + */ + protected void onError(AjaxRequestTarget target) { + } + + /** + * Triggered when the form is submitted, and the validation succeed + * + * @param target the {@link AjaxRequestTarget} + * @param form the {@link Form} + */ + protected abstract void onSubmit(AjaxRequestTarget target); + + public static class ConfirmableBorderDialog extends MessageFormDialog { + private static final long serialVersionUID = 1L; + private Form<?> form; + private Consumer<AjaxRequestTarget> submitHandler = null; + private Consumer<AjaxRequestTarget> errorHandler = null; + + public ConfirmableBorderDialog(String id, String title, String message) { + this(id, title, message, null); + } + + public ConfirmableBorderDialog(String id, String title, String message, Form<?> form) { + super(id, title, message, DialogButtons.OK_CANCEL, DialogIcon.WARN); + this.form = form; + } + + public void setSubmitHandler(Consumer<AjaxRequestTarget> submitHandler) { + this.submitHandler = submitHandler; + } + + public void setErrorHandler(Consumer<AjaxRequestTarget> errorHandler) { + this.errorHandler = errorHandler; + } + + @Override + public DialogButton getSubmitButton() { + return this.findButton(OK); + } + + @Override + public Form<?> getForm() { + return this.form; + } + + @Override + protected void onError(AjaxRequestTarget target) { + super.close(target, null); // closes the dialog on error. + if (errorHandler != null) { + errorHandler.accept(target); + } + } + + @Override + protected void onSubmit(AjaxRequestTarget target) { + if (submitHandler != null) { + submitHandler.accept(target); + } + } + } +}
http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/HeaderPanel.html ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/HeaderPanel.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/HeaderPanel.html index 3f72418..24c7a40 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/HeaderPanel.html +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/HeaderPanel.html @@ -1,27 +1,27 @@ -<?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:panel> - <div id="header"> - <span wicket:id="appName"></span> - </div> - </wicket:panel> +<?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:panel> + <div id="header"> + <span wicket:id="appName"></span> + </div> + </wicket:panel> </html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/HeaderPanel.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/HeaderPanel.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/HeaderPanel.java index 16dfd76..5c1218e 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/HeaderPanel.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/HeaderPanel.java @@ -1,32 +1,32 @@ -/* - * 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.common; - -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.util.string.Strings; - -public class HeaderPanel extends BasePanel { - private static final long serialVersionUID = 1L; - - public HeaderPanel(String id, String appName) { - super(id); - setOutputMarkupPlaceholderTag(true); - add(new Label("appName", Strings.isEmpty(appName) ? " " : appName).setEscapeModelStrings(false)); - } -} +/* + * 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.common; + +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.util.string.Strings; + +public class HeaderPanel extends BasePanel { + private static final long serialVersionUID = 1L; + + public HeaderPanel(String id, String appName) { + super(id); + setOutputMarkupPlaceholderTag(true); + add(new Label("appName", Strings.isEmpty(appName) ? " " : appName).setEscapeModelStrings(false)); + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/OmPagingNavigator.html ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/OmPagingNavigator.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/OmPagingNavigator.html index 9b178ca..d9e9391 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/OmPagingNavigator.html +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/OmPagingNavigator.html @@ -1,28 +1,28 @@ -<?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:panel> - <a wicket:id="first" class="goto icon ui-icon ui-icon-seek-first"></a> - <a wicket:id="prev" class="goto icon ui-icon ui-icon-seek-prev"></a> - <span wicket:id="navigation" class="goto"> - <a wicket:id="pageLink" href="#"><span wicket:id="pageNumber">5</span></a> - </span> - <a wicket:id="next" class="goto icon ui-icon ui-icon-seek-next"></a> - <a wicket:id="last" class="goto icon ui-icon ui-icon-seek-end"></a> - </wicket:panel> +<?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:panel> + <a wicket:id="first" class="goto icon ui-icon ui-icon-seek-first"></a> + <a wicket:id="prev" class="goto icon ui-icon ui-icon-seek-prev"></a> + <span wicket:id="navigation" class="goto"> + <a wicket:id="pageLink" href="#"><span wicket:id="pageNumber">5</span></a> + </span> + <a wicket:id="next" class="goto icon ui-icon ui-icon-seek-next"></a> + <a wicket:id="last" class="goto icon ui-icon ui-icon-seek-end"></a> + </wicket:panel> </html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/OmPagingNavigator.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/OmPagingNavigator.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/OmPagingNavigator.java index 596ab5f..8f5b7cf 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/OmPagingNavigator.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/OmPagingNavigator.java @@ -1,32 +1,32 @@ -/* - * 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.common; - -import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator; -import org.apache.wicket.markup.html.navigation.paging.IPageable; - -public class OmPagingNavigator extends AjaxPagingNavigator { - - private static final long serialVersionUID = 1L; - - public OmPagingNavigator(String id, IPageable pageable) { - super(id, pageable); - } - -} +/* + * 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.common; + +import org.apache.wicket.ajax.markup.html.navigation.paging.AjaxPagingNavigator; +import org.apache.wicket.markup.html.navigation.paging.IPageable; + +public class OmPagingNavigator extends AjaxPagingNavigator { + + private static final long serialVersionUID = 1L; + + public OmPagingNavigator(String id, IPageable pageable) { + super(id, pageable); + } + +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/menu/MenuPanel.html ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/menu/MenuPanel.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/menu/MenuPanel.html index 0912301..c9f997f 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/menu/MenuPanel.html +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/menu/MenuPanel.html @@ -1,25 +1,25 @@ -<?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:panel> - <div wicket:id="menu" class="ui-widget-header"></div> -</wicket:panel> -</html> +<?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:panel> + <div wicket:id="menu" class="ui-widget-header"></div> +</wicket:panel> +</html> http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/menu/MenuPanel.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/menu/MenuPanel.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/menu/MenuPanel.java index f22381f..b15d93d 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/menu/MenuPanel.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/menu/MenuPanel.java @@ -1,69 +1,69 @@ -/* - * 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.common.menu; - -import java.util.List; - -import org.apache.openmeetings.web.common.BasePanel; -import org.apache.wicket.AttributeModifier; -import org.apache.wicket.core.request.handler.IPartialPageRequestHandler; -import org.apache.wicket.markup.html.list.ListItem; -import org.apache.wicket.util.string.Strings; - -import com.googlecode.wicket.jquery.core.Options; -import com.googlecode.wicket.jquery.ui.widget.menu.IMenuItem; -import com.googlecode.wicket.jquery.ui.widget.menu.Menu; - -/** - * Loads the menu items into the main area - * - * @author sebawagner - * - */ -public class MenuPanel extends BasePanel { - private static final long serialVersionUID = 1L; - - public MenuPanel(String id, List<IMenuItem> menus) { - super(id); - setOutputMarkupPlaceholderTag(true); - setMarkupId(id); - add(new Menu("menu", menus, new Options().set("icons", "{ submenu: 'ui-icon-triangle-1-s' }") - .set("position", "{ my: 'left top', at: 'left bottom'}")) - { - private static final long serialVersionUID = 1L; - - @Override - protected void addMenuItem(ListItem<IMenuItem> item, IMenuItem menuItem) { - super.addMenuItem(item, menuItem); - MenuItem m = (MenuItem)menuItem; - item.add(AttributeModifier.append("class", m.isTop() ? "top" : "sub")); - if (!Strings.isEmpty(m.getDesc())) { - item.add(AttributeModifier.append("title", m.getDesc())); - } - if (!Strings.isEmpty(m.getIcon())) { - item.add(AttributeModifier.append("class", m.getIcon())); - } - } - }); - } - - public void update(IPartialPageRequestHandler target) { - target.add(this); - } -} +/* + * 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.common.menu; + +import java.util.List; + +import org.apache.openmeetings.web.common.BasePanel; +import org.apache.wicket.AttributeModifier; +import org.apache.wicket.core.request.handler.IPartialPageRequestHandler; +import org.apache.wicket.markup.html.list.ListItem; +import org.apache.wicket.util.string.Strings; + +import com.googlecode.wicket.jquery.core.Options; +import com.googlecode.wicket.jquery.ui.widget.menu.IMenuItem; +import com.googlecode.wicket.jquery.ui.widget.menu.Menu; + +/** + * Loads the menu items into the main area + * + * @author sebawagner + * + */ +public class MenuPanel extends BasePanel { + private static final long serialVersionUID = 1L; + + public MenuPanel(String id, List<IMenuItem> menus) { + super(id); + setOutputMarkupPlaceholderTag(true); + setMarkupId(id); + add(new Menu("menu", menus, new Options().set("icons", "{ submenu: 'ui-icon-triangle-1-s' }") + .set("position", "{ my: 'left top', at: 'left bottom'}")) + { + private static final long serialVersionUID = 1L; + + @Override + protected void addMenuItem(ListItem<IMenuItem> item, IMenuItem menuItem) { + super.addMenuItem(item, menuItem); + MenuItem m = (MenuItem)menuItem; + item.add(AttributeModifier.append("class", m.isTop() ? "top" : "sub")); + if (!Strings.isEmpty(m.getDesc())) { + item.add(AttributeModifier.append("title", m.getDesc())); + } + if (!Strings.isEmpty(m.getIcon())) { + item.add(AttributeModifier.append("class", m.getIcon())); + } + } + }); + } + + public void update(IPartialPageRequestHandler target) { + target.add(this); + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/DataViewContainer.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/DataViewContainer.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/DataViewContainer.java index bef8153..a9fd58d 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/DataViewContainer.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/DataViewContainer.java @@ -1,53 +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.web.data; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import org.apache.openmeetings.db.entity.IDataProviderEntity; -import org.apache.openmeetings.web.admin.SearchableDataView; -import org.apache.openmeetings.web.common.PagedEntityListPanel; -import org.apache.wicket.markup.html.WebMarkupContainer; - -public class DataViewContainer<T extends IDataProviderEntity> implements Serializable { - private static final long serialVersionUID = 1L; - public WebMarkupContainer container; - public SearchableDataView<T> view; - public PagedEntityListPanel navigator; - private List<OmOrderByBorder<T>> orderLinks = new ArrayList<>(); - - public DataViewContainer(WebMarkupContainer container, SearchableDataView<T> view, PagedEntityListPanel navigator) { - this.container = container; - this.view = view; - this.navigator = navigator; - } - - public DataViewContainer<T> addLink(OmOrderByBorder<T> link) { - orderLinks.add(link); - return this; - } - - public OmOrderByBorder<T>[] getLinks() { - @SuppressWarnings("unchecked") - OmOrderByBorder<T>[] a = new OmOrderByBorder[0]; - return orderLinks.toArray(a); - } -} +/* + * 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.data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import org.apache.openmeetings.db.entity.IDataProviderEntity; +import org.apache.openmeetings.web.admin.SearchableDataView; +import org.apache.openmeetings.web.common.PagedEntityListPanel; +import org.apache.wicket.markup.html.WebMarkupContainer; + +public class DataViewContainer<T extends IDataProviderEntity> implements Serializable { + private static final long serialVersionUID = 1L; + public WebMarkupContainer container; + public SearchableDataView<T> view; + public PagedEntityListPanel navigator; + private List<OmOrderByBorder<T>> orderLinks = new ArrayList<>(); + + public DataViewContainer(WebMarkupContainer container, SearchableDataView<T> view, PagedEntityListPanel navigator) { + this.container = container; + this.view = view; + this.navigator = navigator; + } + + public DataViewContainer<T> addLink(OmOrderByBorder<T> link) { + orderLinks.add(link); + return this; + } + + public OmOrderByBorder<T>[] getLinks() { + @SuppressWarnings("unchecked") + OmOrderByBorder<T>[] a = new OmOrderByBorder[0]; + return orderLinks.toArray(a); + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/OmOrderByBorder.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/OmOrderByBorder.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/OmOrderByBorder.java index f0e077c..7625924 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/OmOrderByBorder.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/OmOrderByBorder.java @@ -1,45 +1,45 @@ -/* - * 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.data; - -import org.apache.openmeetings.db.entity.IDataProviderEntity; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.extensions.ajax.markup.html.repeater.data.sort.AjaxFallbackOrderByBorder; - -public class OmOrderByBorder<T extends IDataProviderEntity> extends AjaxFallbackOrderByBorder<String> { - private static final long serialVersionUID = 1L; - private DataViewContainer<T> container; - - public OmOrderByBorder(final String id, final String property, DataViewContainer<T> container) { - super(id, property, container.view.getDataProvider()); - this.container = container; - setOutputMarkupId(true); - } - - @Override - protected void onSortChanged() { - container.view.setCurrentPage(0); - } - - @Override - protected void onAjaxClick(AjaxRequestTarget target) { - target.add(container.container, container.navigator); - target.add(container.getLinks()); - } -} +/* + * 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.data; + +import org.apache.openmeetings.db.entity.IDataProviderEntity; +import org.apache.wicket.ajax.AjaxRequestTarget; +import org.apache.wicket.extensions.ajax.markup.html.repeater.data.sort.AjaxFallbackOrderByBorder; + +public class OmOrderByBorder<T extends IDataProviderEntity> extends AjaxFallbackOrderByBorder<String> { + private static final long serialVersionUID = 1L; + private DataViewContainer<T> container; + + public OmOrderByBorder(final String id, final String property, DataViewContainer<T> container) { + super(id, property, container.view.getDataProvider()); + this.container = container; + setOutputMarkupId(true); + } + + @Override + protected void onSortChanged() { + container.view.setCurrentPage(0); + } + + @Override + protected void onAjaxClick(AjaxRequestTarget target) { + target.add(container.container, container.navigator); + target.add(container.getLinks()); + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/SearchableDataProvider.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/SearchableDataProvider.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/SearchableDataProvider.java index 15c160d..6c88d6b 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/SearchableDataProvider.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/data/SearchableDataProvider.java @@ -1,92 +1,92 @@ -/* - * 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.data; - -import static org.apache.openmeetings.web.app.Application.getBean; - -import java.util.Iterator; - -import org.apache.openmeetings.db.dao.IDataProviderDao; -import org.apache.openmeetings.db.entity.IDataProviderEntity; -import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; -import org.apache.wicket.model.CompoundPropertyModel; -import org.apache.wicket.model.IModel; - -/** - * provides function to fill paging tables - * - * @author swagner - * - * @param <T> - */ -public class SearchableDataProvider<T extends IDataProviderEntity> extends SortableDataProvider<T, String> { - private static final long serialVersionUID = 1L; - protected Class<? extends IDataProviderDao<T>> clazz; - protected String search = null; - - public SearchableDataProvider(Class<? extends IDataProviderDao<T>> c) { - this.clazz = c; - } - - @Override - public void detach() { - // does nothing - } - - protected IDataProviderDao<T> getDao() { - return getBean(clazz); - } - - protected String getSortStr() { - String result = null; - if (getSort() != null) { - result = getSort().getProperty() + " " + (getSort().isAscending() ? "ASC" : "DESC"); - } - return result; - } - - @Override - public Iterator<? extends T> iterator(long first, long count) { - return (search == null && getSort() == null - ? getDao().get((int)first, (int)count) - : getDao().get(search, (int)first, (int)count, getSortStr())).iterator(); - } - - @Override - public long size() { - return search == null ? getDao().count() : getDao().count(search); - } - - @Override - public IModel<T> model(T object) { - return new CompoundPropertyModel<>(object); - } - - public void setSearch(String search) { - if (search != null && !search.trim().isEmpty()) { - this.search = search.trim(); - } else { - this.search = null; - } - } - - public String getSearch() { - return search; - } -} +/* + * 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.data; + +import static org.apache.openmeetings.web.app.Application.getBean; + +import java.util.Iterator; + +import org.apache.openmeetings.db.dao.IDataProviderDao; +import org.apache.openmeetings.db.entity.IDataProviderEntity; +import org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider; +import org.apache.wicket.model.CompoundPropertyModel; +import org.apache.wicket.model.IModel; + +/** + * provides function to fill paging tables + * + * @author swagner + * + * @param <T> + */ +public class SearchableDataProvider<T extends IDataProviderEntity> extends SortableDataProvider<T, String> { + private static final long serialVersionUID = 1L; + protected Class<? extends IDataProviderDao<T>> clazz; + protected String search = null; + + public SearchableDataProvider(Class<? extends IDataProviderDao<T>> c) { + this.clazz = c; + } + + @Override + public void detach() { + // does nothing + } + + protected IDataProviderDao<T> getDao() { + return getBean(clazz); + } + + protected String getSortStr() { + String result = null; + if (getSort() != null) { + result = getSort().getProperty() + " " + (getSort().isAscending() ? "ASC" : "DESC"); + } + return result; + } + + @Override + public Iterator<? extends T> iterator(long first, long count) { + return (search == null && getSort() == null + ? getDao().get((int)first, (int)count) + : getDao().get(search, (int)first, (int)count, getSortStr())).iterator(); + } + + @Override + public long size() { + return search == null ? getDao().count() : getDao().count(search); + } + + @Override + public IModel<T> model(T object) { + return new CompoundPropertyModel<>(object); + } + + public void setSearch(String search) { + if (search != null && !search.trim().isEmpty()) { + this.search = search.trim(); + } else { + this.search = null; + } + } + + public String getSearch() { + return search; + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/ActivatePage.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/ActivatePage.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/ActivatePage.java index 727f4e7..ed02171 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/ActivatePage.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/ActivatePage.java @@ -1,51 +1,51 @@ -/* - * 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.pages; - -import static org.apache.openmeetings.web.app.Application.getBean; - -import java.util.Date; - -import org.apache.openmeetings.db.dao.user.UserDao; -import org.apache.openmeetings.db.entity.user.User; -import org.apache.openmeetings.db.entity.user.User.Right; -import org.apache.openmeetings.db.util.AuthLevelUtil; -import org.apache.openmeetings.web.app.Application; -import org.apache.wicket.request.mapper.parameter.PageParameters; - -public class ActivatePage extends BaseNotInitedPage { - private static final long serialVersionUID = 1L; - public static final String ACTIVATION_PARAM = "u"; - - public ActivatePage(PageParameters pp) { - String userHash = pp.get(ACTIVATION_PARAM).toString(); - if (userHash != null) { - User user = getBean(UserDao.class).getUserByActivationHash(userHash); - - if (user != null && !AuthLevelUtil.hasLoginLevel(user.getRights())) { - // activate - user.getRights().add(Right.Login); - user.setUpdated(new Date()); - - getBean(UserDao.class).update(user, null); - } - } - setResponsePage(Application.get().getSignInPageClass()); - } -} +/* + * 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.pages; + +import static org.apache.openmeetings.web.app.Application.getBean; + +import java.util.Date; + +import org.apache.openmeetings.db.dao.user.UserDao; +import org.apache.openmeetings.db.entity.user.User; +import org.apache.openmeetings.db.entity.user.User.Right; +import org.apache.openmeetings.db.util.AuthLevelUtil; +import org.apache.openmeetings.web.app.Application; +import org.apache.wicket.request.mapper.parameter.PageParameters; + +public class ActivatePage extends BaseNotInitedPage { + private static final long serialVersionUID = 1L; + public static final String ACTIVATION_PARAM = "u"; + + public ActivatePage(PageParameters pp) { + String userHash = pp.get(ACTIVATION_PARAM).toString(); + if (userHash != null) { + User user = getBean(UserDao.class).getUserByActivationHash(userHash); + + if (user != null && !AuthLevelUtil.hasLoginLevel(user.getRights())) { + // activate + user.getRights().add(Right.Login); + user.setUpdated(new Date()); + + getBean(UserDao.class).update(user, null); + } + } + setResponsePage(Application.get().getSignInPageClass()); + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/NotInitedPage.html ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/NotInitedPage.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/NotInitedPage.html index 3171a21..a6896fa 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/NotInitedPage.html +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/NotInitedPage.html @@ -1,32 +1,32 @@ -<!DOCTYPE html> -<!-- - 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> - <!-- FIXME localized versions of this file need to be created --> - <div class="message"> - <b>OpenMeetings - Loading ...</b><br /> - The server is not yet completely initialized. Please try again in a couple of seconds.<br/> - If this message persists for several minutes contact your Sys-Administration.<br/> - If that message stays forever you should check the logs located in - <pre>openmeetings_install_dir/log</pre> folder, probably your database user/pwd/host is wrong! - </div> -</wicket:extend> -</html> +<!DOCTYPE html> +<!-- + 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> + <!-- FIXME localized versions of this file need to be created --> + <div class="message"> + <b>OpenMeetings - Loading ...</b><br /> + The server is not yet completely initialized. Please try again in a couple of seconds.<br/> + If this message persists for several minutes contact your Sys-Administration.<br/> + If that message stays forever you should check the logs located in + <pre>openmeetings_install_dir/log</pre> folder, probably your database user/pwd/host is wrong! + </div> +</wicket:extend> +</html> http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/NotInitedPage.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/NotInitedPage.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/NotInitedPage.java index b0e39a1..3cecb0a 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/NotInitedPage.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/NotInitedPage.java @@ -1,40 +1,40 @@ -/* - * 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.pages; - -import org.apache.openmeetings.util.InitializationContainer; -import org.apache.openmeetings.web.app.Application; -import org.apache.wicket.RestartResponseException; - -public class NotInitedPage extends BaseNotInitedPage { - private static final long serialVersionUID = 1L; - - public NotInitedPage() { - if (InitializationContainer.initComplete) { - continueToOriginalDestination(); - // Ups, no original destination. Go to the home page - throw new RestartResponseException(Application.get().getHomePage()); - } - } - - @Override - protected String getGaCode() { - return null; - } -} +/* + * 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.pages; + +import org.apache.openmeetings.util.InitializationContainer; +import org.apache.openmeetings.web.app.Application; +import org.apache.wicket.RestartResponseException; + +public class NotInitedPage extends BaseNotInitedPage { + private static final long serialVersionUID = 1L; + + public NotInitedPage() { + if (InitializationContainer.initComplete) { + continueToOriginalDestination(); + // Ups, no original destination. Go to the home page + throw new RestartResponseException(Application.get().getHomePage()); + } + } + + @Override + protected String getGaCode() { + return null; + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/ResetPage.html ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/ResetPage.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/ResetPage.html index 4f6d993..5e39f7b 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/ResetPage.html +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/ResetPage.html @@ -1,25 +1,25 @@ -<?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> - <div wicket:id="resetPassword"></div> - </wicket:extend> -</html> +<?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> + <div wicket:id="resetPassword"></div> + </wicket:extend> +</html> http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/ResetPage.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/ResetPage.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/ResetPage.java index 1f6dae0..45b93a5 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/ResetPage.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/ResetPage.java @@ -1,44 +1,44 @@ -/* - * 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.pages; - -import org.apache.openmeetings.db.dao.user.UserDao; -import org.apache.openmeetings.db.entity.user.User; -import org.apache.openmeetings.web.app.Application; -import org.apache.openmeetings.web.pages.auth.ResetPasswordDialog; -import org.apache.wicket.request.mapper.parameter.PageParameters; - -public class ResetPage extends BaseNotInitedPage { - private static final long serialVersionUID = 1L; - private final String RESET_PARAM = "hash"; - - public ResetPage(PageParameters pp){ - String resetHash = pp.get(RESET_PARAM).toString(); - if (resetHash != null){ - Object user = Application.getBean(UserDao.class).getUserByHash(resetHash); - if (user instanceof User){ - add(new ResetPasswordDialog("resetPassword", (User)user)); - } else { - setResponsePage(Application.get().getSignInPageClass()); - } - } else { - setResponsePage(Application.get().getSignInPageClass()); - } - } -} +/* + * 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.pages; + +import org.apache.openmeetings.db.dao.user.UserDao; +import org.apache.openmeetings.db.entity.user.User; +import org.apache.openmeetings.web.app.Application; +import org.apache.openmeetings.web.pages.auth.ResetPasswordDialog; +import org.apache.wicket.request.mapper.parameter.PageParameters; + +public class ResetPage extends BaseNotInitedPage { + private static final long serialVersionUID = 1L; + private final String RESET_PARAM = "hash"; + + public ResetPage(PageParameters pp){ + String resetHash = pp.get(RESET_PARAM).toString(); + if (resetHash != null){ + Object user = Application.getBean(UserDao.class).getUserByHash(resetHash); + if (user instanceof User){ + add(new ResetPasswordDialog("resetPassword", (User)user)); + } else { + setResponsePage(Application.get().getSignInPageClass()); + } + } else { + setResponsePage(Application.get().getSignInPageClass()); + } + } +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/KickMessageDialog.html ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/KickMessageDialog.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/KickMessageDialog.html index 1163346..a72f866 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/KickMessageDialog.html +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/KickMessageDialog.html @@ -1,29 +1,29 @@ -<?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:panel> - <table> - <tr> - <td wicket:id="message">[message]</td> - </tr> - </table> - </wicket:panel> +<?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:panel> + <table> + <tr> + <td wicket:id="message">[message]</td> + </tr> + </table> + </wicket:panel> </html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/KickMessageDialog.java ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/KickMessageDialog.java b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/KickMessageDialog.java index b2f489f..f2dad62 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/KickMessageDialog.java +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/KickMessageDialog.java @@ -1,58 +1,58 @@ -/* - * 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.pages.auth; - -import org.apache.openmeetings.web.app.Application; -import org.apache.openmeetings.web.app.WebSession; -import org.apache.wicket.core.request.handler.IPartialPageRequestHandler; -import org.apache.wicket.markup.html.basic.Label; - -import com.googlecode.wicket.jquery.core.JQueryBehavior; -import com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog; -import com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton; - -public class KickMessageDialog extends AbstractDialog<String> { - private static final long serialVersionUID = 1L; - - public KickMessageDialog(String id) { - super(id, ""); - } - - @Override - protected void onInitialize() { - super.onInitialize(); - add(new Label("message", getString("606"))); - }; - - @Override - public void onConfigure(JQueryBehavior behavior) { - super.onConfigure(behavior); - behavior.setOption("autoOpen", true); - behavior.setOption("closeOnEscape", false); - behavior.setOption("classes", "{'ui-dialog-titlebar': 'ui-corner-all no-close'}"); - behavior.setOption("resizable", false); - } - - @Override - public void onClose(IPartialPageRequestHandler handler, DialogButton button) { - WebSession.setKickedByAdmin(false); - Application.get().restartResponseAtSignInPage(); - } - -} +/* + * 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.pages.auth; + +import org.apache.openmeetings.web.app.Application; +import org.apache.openmeetings.web.app.WebSession; +import org.apache.wicket.core.request.handler.IPartialPageRequestHandler; +import org.apache.wicket.markup.html.basic.Label; + +import com.googlecode.wicket.jquery.core.JQueryBehavior; +import com.googlecode.wicket.jquery.ui.widget.dialog.AbstractDialog; +import com.googlecode.wicket.jquery.ui.widget.dialog.DialogButton; + +public class KickMessageDialog extends AbstractDialog<String> { + private static final long serialVersionUID = 1L; + + public KickMessageDialog(String id) { + super(id, ""); + } + + @Override + protected void onInitialize() { + super.onInitialize(); + add(new Label("message", getString("606"))); + }; + + @Override + public void onConfigure(JQueryBehavior behavior) { + super.onConfigure(behavior); + behavior.setOption("autoOpen", true); + behavior.setOption("closeOnEscape", false); + behavior.setOption("classes", "{'ui-dialog-titlebar': 'ui-corner-all no-close'}"); + behavior.setOption("resizable", false); + } + + @Override + public void onClose(IPartialPageRequestHandler handler, DialogButton button) { + WebSession.setKickedByAdmin(false); + Application.get().restartResponseAtSignInPage(); + } + +} http://git-wip-us.apache.org/repos/asf/openmeetings/blob/8e63647c/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/ResetPasswordDialog.html ---------------------------------------------------------------------- diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/ResetPasswordDialog.html b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/ResetPasswordDialog.html index fd73713..476a5d2 100644 --- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/ResetPasswordDialog.html +++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/pages/auth/ResetPasswordDialog.html @@ -1,43 +1,43 @@ -<?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:panel> - <form wicket:id="form"> - <table> - <tr> - <td><label wicket:for="login"><wicket:message key="314" /></label></td> - <td><input type="text" readonly wicket:id="login" /></td> - </tr> - <tr> - <td><label><wicket:message key="328" /></label></td> - <td><input type="password" wicket:id="password" /></td> - </tr> - <tr> - <td><label><wicket:message key="329" /></label></td> - <td><input type="password" wicket:id="confirmPassword" /></td> - </tr> - </table> - <span wicket:id="feedback"></span> - <input type="submit" wicket:id="submit" class="invisible-form-component"/> - </form> - <div wicket:id="confirmReset"></div> -</wicket:panel> +<?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:panel> + <form wicket:id="form"> + <table> + <tr> + <td><label wicket:for="login"><wicket:message key="314" /></label></td> + <td><input type="text" readonly wicket:id="login" /></td> + </tr> + <tr> + <td><label><wicket:message key="328" /></label></td> + <td><input type="password" wicket:id="password" /></td> + </tr> + <tr> + <td><label><wicket:message key="329" /></label></td> + <td><input type="password" wicket:id="confirmPassword" /></td> + </tr> + </table> + <span wicket:id="feedback"></span> + <input type="submit" wicket:id="submit" class="invisible-form-component"/> + </form> + <div wicket:id="confirmReset"></div> +</wicket:panel> </html> \ No newline at end of file
