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/12/06 05:26:40 UTC
svn commit: r1417735 [3/3] - in /incubator/openmeetings/trunk/singlewebapp:
WebContent/languages/ docs/
src/org/apache/openmeetings/persistence/beans/domain/
src/org/apache/openmeetings/servlet/outputhandler/
src/org/apache/openmeetings/test/labels/ sr...
Modified: incubator/openmeetings/trunk/singlewebapp/docs/JUnitTesting.html
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/docs/JUnitTesting.html?rev=1417735&r1=1417734&r2=1417735&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/docs/JUnitTesting.html (original)
+++ incubator/openmeetings/trunk/singlewebapp/docs/JUnitTesting.html Thu Dec 6 04:26:37 2012
@@ -703,7 +703,7 @@ limitations under the License.
<li>Select Arguments tab </li>
<li>Add the following code to the VM section
<div class="xmlcode">
- -javaagent:${workspace_loc:Openmeetings}/build/lib/om/openjpa-bundle-2.2.0.jar
+ -javaagent:${workspace_loc:Openmeetings}/build/lib/om/openjpa-bundle-2.2.1.jar
-Dwebapps.root=${workspace_loc:Openmeetings}/dist/red5/webapps/openmeetings
</div>
</li>
Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/domain/Organisation_Users.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/domain/Organisation_Users.java?rev=1417735&r1=1417734&r2=1417735&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/domain/Organisation_Users.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/persistence/beans/domain/Organisation_Users.java Thu Dec 6 04:26:37 2012
@@ -165,15 +165,16 @@ public class Organisation_Users implemen
if (obj == null) {
return false;
}
- if (getClass() != obj.getClass()) {
- return false;
- }
- Organisation_Users other = (Organisation_Users) obj;
- if (organisation_users_id == null) {
- if (other.organisation_users_id != null) {
+ if (obj instanceof Organisation_Users) {
+ Organisation_Users other = (Organisation_Users) obj;
+ if (organisation_users_id == null) {
+ if (other.organisation_users_id != null) {
+ return false;
+ }
+ } else if (!organisation_users_id.equals(other.organisation_users_id)) {
return false;
}
- } else if (!organisation_users_id.equals(other.organisation_users_id)) {
+ } else {
return false;
}
return true;
Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/LangExport.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/LangExport.java?rev=1417735&r1=1417734&r2=1417735&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/LangExport.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/servlet/outputhandler/LangExport.java Thu Dec 6 04:26:37 2012
@@ -39,6 +39,7 @@ import org.apache.openmeetings.remote.re
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
+import org.dom4j.Namespace;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.XMLWriter;
import org.red5.logging.Red5LoggerFactory;
@@ -55,6 +56,32 @@ public class LangExport extends HttpServ
private static final long serialVersionUID = 243294279856160463L;
private static final Logger log = Red5LoggerFactory.getLogger(
LangExport.class, OpenmeetingsVariables.webAppRootKey);
+ public static final String FILE_COMMENT = ""
+ + "\n"
+ + " Licensed to the Apache Software Foundation (ASF) under one\n"
+ + " or more contributor license agreements. See the NOTICE file\n"
+ + " distributed with this work for additional information\n"
+ + " regarding copyright ownership. The ASF licenses this file\n"
+ + " to you under the Apache License, Version 2.0 (the\n"
+ + " \"License\"); you may not use this file except in compliance\n"
+ + " with the License. You may obtain a copy of the License at\n"
+ + " \n"
+ + " http://www.apache.org/licenses/LICENSE-2.0\n"
+ + " \n"
+ + " Unless required by applicable law or agreed to in writing,\n"
+ + " software distributed under the License is distributed on an\n"
+ + " \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n"
+ + " KIND, either express or implied. See the License for the\n"
+ + " specific language governing permissions and limitations\n"
+ + " under the License.\n"
+ + " \n"
+ + "\n"
+ + "\n"
+ + "###############################################\n"
+ + "This File is auto-generated by the LanguageEditor \n"
+ + "to add new Languages or modify/customize it use the LanguageEditor \n"
+ + "see http://incubator.apache.org/openmeetings/LanguageEditor.html for Details \n"
+ + "###############################################";
public Sessionmanagement getSessionManagement() {
try {
@@ -169,7 +196,7 @@ public class LangExport extends HttpServ
// httpServletResponse.setHeader("Content-Length", ""+
// rf.length());
- this.serializetoXML(out, "UTF-8", doc);
+ serializetoXML(out, "UTF-8", doc);
out.flush();
out.close();
@@ -186,16 +213,24 @@ public class LangExport extends HttpServ
}
}
- public Document createDocument(List<Fieldlanguagesvalues> flvList, List<Fieldlanguagesvalues> untranslatedList) throws Exception {
+ public static Document createDocument() {
Document document = DocumentHelper.createDocument();
document.setXMLEncoding("UTF-8");
- document.addComment("###############################################\n"
- + "This File is auto-generated by the LanguageEditor \n"
- + "to add new Languages or modify/customize it use the LanguageEditor \n"
- + "see http://incubator.apache.org/openmeetings/LanguageEditor.html for Details \n"
- + "###############################################");
-
+ document.addComment(LangExport.FILE_COMMENT);
+ return document;
+ }
+
+ public static Element createRoot(Document document) {
Element root = document.addElement("language");
+ root.add(new Namespace("xsi",
+ "http://www.w3.org/2001/XMLSchema-instance"));
+ root.add(new Namespace("noNamespaceSchemaLocation", "language.xsd"));
+ return root;
+ }
+
+ public Document createDocument(List<Fieldlanguagesvalues> flvList, List<Fieldlanguagesvalues> untranslatedList) throws Exception {
+ Document document = createDocument();
+ Element root = createRoot(document);
for (Fieldlanguagesvalues flv : flvList) {
Element eTemp = root.addElement("string")
@@ -220,7 +255,7 @@ public class LangExport extends HttpServ
return document;
}
- public void serializetoXML(OutputStream out, String aEncodingScheme,
+ public static void serializetoXML(OutputStream out, String aEncodingScheme,
Document doc) throws Exception {
OutputFormat outformat = OutputFormat.createPrettyPrint();
outformat.setEncoding(aEncodingScheme);
Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/test/labels/FillLabels.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/test/labels/FillLabels.java?rev=1417735&r1=1417734&r2=1417735&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/test/labels/FillLabels.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/test/labels/FillLabels.java Thu Dec 6 04:26:37 2012
@@ -19,12 +19,9 @@
package org.apache.openmeetings.test.labels;
import java.io.File;
-import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FilenameFilter;
-import java.io.InputStream;
-import java.io.OutputStream;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -32,14 +29,12 @@ import java.util.Map.Entry;
import org.apache.openmeetings.persistence.beans.lang.Fieldlanguagesvalues;
import org.apache.openmeetings.persistence.beans.lang.Fieldvalues;
+import org.apache.openmeetings.servlet.outputhandler.LangExport;
+import org.apache.openmeetings.utils.OmFileHelper;
import org.dom4j.Document;
import org.dom4j.DocumentException;
-import org.dom4j.DocumentHelper;
import org.dom4j.Element;
-import org.dom4j.Namespace;
-import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
-import org.dom4j.io.XMLWriter;
import org.junit.Test;
/**
@@ -64,11 +59,11 @@ import org.junit.Test;
*/
public class FillLabels {
- private final String basePath = "./WebContent/languages/";
+ private final String basePath = "WebContent/languages/";
private final String masterLangFile = "english.xml";
- private final String[] excludeFiles = { masterLangFile, "errorvalues.xml",
+ private final String[] excludeFiles = { "errorvalues.xml",
"countries.xml", "timezones.xml", "languages.xml" };
/**
@@ -81,58 +76,42 @@ public class FillLabels {
private Map<Long, Fieldlanguagesvalues> masterLabels;
@Test
- public void test() {
-
- try {
-
- // Read master file
- masterLabels = parseToLabelsArray(masterLangFile);
-
- File languagesFilesFolder = new File(basePath);
-
- for (File file : languagesFilesFolder
- .listFiles(new FilenameFilter() {
- public boolean accept(File file, String string1) {
- if (!string1.endsWith("xml")) {
+ public void test() throws Exception {
+ OmFileHelper.setOmHome(System.getProperty("om.home", "."));
+ // Read master file
+ File base = new File(OmFileHelper.getOmHome(), basePath);
+ masterLabels = parseToLabelsArray(new File(base, masterLangFile));
+
+ File langFolder = new File(OmFileHelper.getOmHome(), basePath);
+
+ for (File file : langFolder.listFiles(new FilenameFilter() {
+ public boolean accept(File file, String string1) {
+ if (!string1.endsWith("xml")) {
+ return false;
+ }
+ for (String excludeFileName : excludeFiles) {
+ if (string1.equals(excludeFileName)) {
return false;
}
- for (String excludeFileName : excludeFiles) {
- if (string1.equals(excludeFileName)) {
- return false;
- }
- }
- return true;
}
- })) {
+ return true;
+ }
+ })) {
- Map<Long, Fieldlanguagesvalues> labelsArray = parseToLabelsArray(file
- .getName());
+ Map<Long, Fieldlanguagesvalues> labelsArray = parseToLabelsArray(file);
- for (Entry<Long, Fieldlanguagesvalues> entryMaster : masterLabels.entrySet()) {
-
- for (long replaceId : replaceIds) {
- if (replaceId == entryMaster.getKey()) {
- labelsArray.put(entryMaster.getKey(), entryMaster.getValue());
- }
- }
-
- if (!labelsArray.containsKey(entryMaster.getKey())) {
+ for (Entry<Long, Fieldlanguagesvalues> entryMaster : masterLabels.entrySet()) {
+ for (long replaceId : replaceIds) {
+ if (replaceId == entryMaster.getKey()) {
labelsArray.put(entryMaster.getKey(), entryMaster.getValue());
}
-
}
-
- OutputStream out = new FileOutputStream(basePath
- + file.getName());
-
- this.serializetoXML(out, "UTF-8", createDocument(labelsArray));
-
+ if (!labelsArray.containsKey(entryMaster.getKey())) {
+ labelsArray.put(entryMaster.getKey(), entryMaster.getValue());
+ }
}
-
- } catch (Exception er) {
- er.printStackTrace();
+ LangExport.serializetoXML(new FileOutputStream(file), "UTF-8", createDocument(labelsArray));
}
-
}
/**
@@ -142,14 +121,12 @@ public class FillLabels {
* @throws FileNotFoundException
* @throws DocumentException
*/
- private Map<Long, Fieldlanguagesvalues> parseToLabelsArray(String fileName)
+ private Map<Long, Fieldlanguagesvalues> parseToLabelsArray(File file)
throws FileNotFoundException, DocumentException {
Map<Long, Fieldlanguagesvalues> labelsArray = new LinkedHashMap<Long, Fieldlanguagesvalues>();
-
- InputStream is = new FileInputStream(basePath + fileName);
SAXReader reader = new SAXReader();
- Document document = reader.read(is);
+ Document document = reader.read(file);
Element root = document.getRootElement();
@@ -166,6 +143,7 @@ public class FillLabels {
Fieldvalues fLabel = new Fieldvalues();
fLabel.setName(fieldName);
fValue.setFieldvalues(fLabel);
+
labelsArray.put(fieldvalues_id, fValue);
}
@@ -181,40 +159,8 @@ public class FillLabels {
*/
private Document createDocument(Map<Long, Fieldlanguagesvalues> labelsArray)
throws Exception {
-
- Document document = DocumentHelper.createDocument();
- document.setXMLEncoding("UTF-8");
- document.addComment(""
- + "\n"
- + " Licensed to the Apache Software Foundation (ASF) under one\n"
- + " or more contributor license agreements. See the NOTICE file\n"
- + " distributed with this work for additional information\n"
- + " regarding copyright ownership. The ASF licenses this file\n"
- + " to you under the Apache License, Version 2.0 (the\n"
- + " \"License\"); you may not use this file except in compliance\n"
- + " with the License. You may obtain a copy of the License at\n"
- + " \n"
- + " http://www.apache.org/licenses/LICENSE-2.0\n"
- + " \n"
- + " Unless required by applicable law or agreed to in writing,\n"
- + " software distributed under the License is distributed on an\n"
- + " \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n"
- + " KIND, either express or implied. See the License for the\n"
- + " specific language governing permissions and limitations\n"
- + " under the License.\n"
- + " \n"
- + "\n"
- + "\n"
- + "###############################################\n"
- + "This File is auto-generated by the LanguageEditor \n"
- + "to add new Languages or modify/customize it use the LanguageEditor \n"
- + "see http://incubator.apache.org/openmeetings/LanguageEditor.html for Details \n"
- + "###############################################");
-
- Element root = document.addElement("language");
- root.add(new Namespace("xsi",
- "http://www.w3.org/2001/XMLSchema-instance"));
- root.add(new Namespace("noNamespaceSchemaLocation", "language.xsd"));
+ Document document = LangExport.createDocument();
+ Element root = LangExport.createRoot(document);
for (Entry<Long, Fieldlanguagesvalues> entryLabel : labelsArray.entrySet()) {
Element eTemp = root.addElement("string")
@@ -226,22 +172,4 @@ public class FillLabels {
return document;
}
-
- /**
- * write XML
- *
- * @param out
- * @param aEncodingScheme
- * @param doc
- * @throws Exception
- */
- private void serializetoXML(OutputStream out, String aEncodingScheme,
- Document doc) throws Exception {
- OutputFormat outformat = OutputFormat.createPrettyPrint();
- outformat.setEncoding(aEncodingScheme);
- XMLWriter writer = new XMLWriter(out, outformat);
- writer.write(doc);
- writer.flush();
- }
-
}
Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/groups/AddUsersForm.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/groups/AddUsersForm.java?rev=1417735&r1=1417734&r2=1417735&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/groups/AddUsersForm.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/groups/AddUsersForm.java Thu Dec 6 04:26:37 2012
@@ -70,9 +70,8 @@ public class AddUsersForm extends Form<V
add(new AjaxButton("search", Model.of(WebSession.getString(182L))) {
private static final long serialVersionUID = -4752180617634945030L;
- protected void onAfterSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
- usersToAdd.clear();
- usersInList.clear();
+ protected void onAfterSubmit(AjaxRequestTarget target, Form<?> form) {
+ clear();
usersInList.addAll(Application.getBean(UsersDao.class).get(userSearchText));
target.add(users);
}
@@ -81,13 +80,13 @@ public class AddUsersForm extends Form<V
add(new AjaxButton("add", Model.of(WebSession.getString(175L))) {
private static final long serialVersionUID = 5553555064487161840L;
- protected void onAfterSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
+ protected void onAfterSubmit(AjaxRequestTarget target, Form<?> form) {
UsersDao userDao = Application.getBean(UsersDao.class);
for (Users u : usersToAdd) {
- boolean found = false;
List<Organisation_Users> orgUsers = u.getOrganisation_users();
+ boolean found = false;
for (Organisation_Users ou : orgUsers) {
- if (ou.getOrganisation().getOrganisation_id() == organisation.getOrganisation_id()) {
+ if (ou.getOrganisation().getOrganisation_id().equals(organisation.getOrganisation_id())) {
found = true;
break;
}
@@ -105,6 +104,11 @@ public class AddUsersForm extends Form<V
});
}
+ public void clear() {
+ usersToAdd.clear();
+ usersInList.clear();
+ }
+
public void setOrganisation(Organisation org) {
organisation = org;
}
Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/groups/GroupsPanel.html
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/groups/GroupsPanel.html?rev=1417735&r1=1417734&r2=1417735&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/groups/GroupsPanel.html (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/groups/GroupsPanel.html Thu Dec 6 04:26:37 2012
@@ -69,7 +69,7 @@
<fieldset>
<legend><wicket:ommessage key="170" /></legend>
<div class="formelement">
- <label><wicket:ommessage key="132" /></label><input type="text" wicket:id="name" />
+ <label><wicket:ommessage key="171" /></label><input type="text" wicket:id="name" />
</div>
<div class="formelement">
<label style="font-weight: bold;"><wicket:ommessage key="273" /></label>
Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/groups/GroupsPanel.java
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/groups/GroupsPanel.java?rev=1417735&r1=1417734&r2=1417735&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/groups/GroupsPanel.java (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/groups/GroupsPanel.java Thu Dec 6 04:26:37 2012
@@ -56,7 +56,16 @@ public class GroupsPanel extends AdminPa
super(id);
final WebMarkupContainer listContainer = new WebMarkupContainer("listContainer");
final WebMarkupContainer addUsersBtn = new WebMarkupContainer("addUsersBtn");
-
+ addUsersBtn.add(new AjaxEventBehavior("onclick") {
+ private static final long serialVersionUID = 6037994365235148885L;
+
+ protected void onEvent(AjaxRequestTarget target) {
+ addUsersForm.clear();
+ target.add(addUsersForm);
+ target.appendJavaScript("addUsers();");
+ }
+ });
+
//Adding the Group Form
form = new GroupForm("form", listContainer, new Organisation()){
private static final long serialVersionUID = -3042797340375988889L;
@@ -64,13 +73,13 @@ public class GroupsPanel extends AdminPa
@Override
protected void onModelChanged() {
super.onModelChanged();
- if (getModelObject().getOrganisation_id() == null) {
- addUsersBtn.add(AttributeModifier.replace("class", "formNewButton disabled")
- , AttributeModifier.replace("onclick", ""));
+ boolean orgEmpty = getModelObject().getOrganisation_id() == null;
+ if (orgEmpty) {
+ addUsersBtn.add(AttributeModifier.replace("class", "formNewButton disabled"));
} else {
- addUsersBtn.add(AttributeModifier.replace("class", "formNewButton")
- , AttributeModifier.replace("onclick", "addUsers();"));
+ addUsersBtn.add(AttributeModifier.replace("class", "formNewButton"));
}
+ addUsersBtn.setEnabled(!orgEmpty);
addUsersForm.setOrganisation(getModelObject());
}
Modified: incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/rooms/RoomsPanel.html
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/rooms/RoomsPanel.html?rev=1417735&r1=1417734&r2=1417735&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/rooms/RoomsPanel.html (original)
+++ incubator/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/components/admin/rooms/RoomsPanel.html Thu Dec 6 04:26:37 2012
@@ -167,10 +167,10 @@
<label><wicket:ommessage key="1513" /></label><input type="checkbox" class="formcheckbox" wicket:id="chatModerated" />
</div>
<div class="formelement">
- <label><wicket:ommessage key="1513" /></label><input type="checkbox" class="formcheckbox" wicket:id="chatOpened" />
+ <label><wicket:ommessage key="1515" /></label><input type="checkbox" class="formcheckbox" wicket:id="chatOpened" />
</div>
<div class="formelement">
- <label><wicket:ommessage key="1513" /></label><input type="checkbox" class="formcheckbox" wicket:id="filesOpened" />
+ <label><wicket:ommessage key="1516" /></label><input type="checkbox" class="formcheckbox" wicket:id="filesOpened" />
</div>
<div class="formelement">
<label><wicket:ommessage key="1526" /></label><input type="checkbox" class="formcheckbox" wicket:id="autoVideoSelect" />
Modified: incubator/openmeetings/trunk/singlewebapp/xdocs/JUnitTesting.xml
URL: http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/xdocs/JUnitTesting.xml?rev=1417735&r1=1417734&r2=1417735&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/xdocs/JUnitTesting.xml (original)
+++ incubator/openmeetings/trunk/singlewebapp/xdocs/JUnitTesting.xml Thu Dec 6 04:26:37 2012
@@ -83,7 +83,7 @@
<li>Select Arguments tab </li>
<li>Add the following code to the VM section
<div class="xmlcode">
- -javaagent:${workspace_loc:Openmeetings}/build/lib/om/openjpa-bundle-2.2.0.jar
+ -javaagent:${workspace_loc:Openmeetings}/build/lib/om/openjpa-bundle-2.2.1.jar
-Dwebapps.root=${workspace_loc:Openmeetings}/dist/red5/webapps/openmeetings
</div>
</li>