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 2016/08/16 03:02:54 UTC
svn commit: r1756466 - in /openmeetings/application:
branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/
branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/
trunk/openmeetings-install/src/main...
Author: solomax
Date: Tue Aug 16 03:02:54 2016
New Revision: 1756466
URL: http://svn.apache.org/viewvc?rev=1756466&view=rev
Log:
[OPENMEETINGS-1448] 'PROCESSING' as status is being handled as expected
Added:
openmeetings/application/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/RecordingStatusConverter.java
openmeetings/application/branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/RecordingStatusConverter.java
openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/backup/RecordingStatusConverter.java
Modified:
openmeetings/application/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java
openmeetings/application/branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java
openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java
Modified: openmeetings/application/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java?rev=1756466&r1=1756465&r2=1756466&view=diff
==============================================================================
--- openmeetings/application/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java (original)
+++ openmeetings/application/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java Tue Aug 16 03:02:54 2016
@@ -799,7 +799,7 @@ public class BackupImport {
}
return list;
}
-
+
//FIXME (need to be removed in later versions) HACK to fix old properties
public List<Recording> readRecordingList(File baseDir, String fileName, String listNodeName) throws Exception {
List<Recording> list = new ArrayList<>();
@@ -813,6 +813,7 @@ public class BackupImport {
matcher.bind(Long.class, LongTransform.class);
matcher.bind(Integer.class, IntegerTransform.class);
registry.bind(Date.class, DateConverter.class);
+ registry.bind(Recording.Status.class, RecordingStatusConverter.class);
InputNode root = NodeBuilder.read(new FileInputStream(xml));
InputNode root1 = NodeBuilder.read(new FileInputStream(xml)); //HACK to handle old isFolder
@@ -843,7 +844,7 @@ public class BackupImport {
}
return list;
}
-
+
public List<User> readUserList(InputStream xml, String listNodeName) throws Exception {
return readUserList(new InputSource(xml), listNodeName);
}
Added: openmeetings/application/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/RecordingStatusConverter.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/RecordingStatusConverter.java?rev=1756466&view=auto
==============================================================================
--- openmeetings/application/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/RecordingStatusConverter.java (added)
+++ openmeetings/application/branches/3.1.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/RecordingStatusConverter.java Tue Aug 16 03:02:54 2016
@@ -0,0 +1,47 @@
+/*
+ * 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.backup;
+
+import org.apache.openmeetings.db.entity.record.Recording;
+import org.apache.openmeetings.db.entity.record.Recording.Status;
+import org.simpleframework.xml.stream.InputNode;
+import org.simpleframework.xml.stream.OutputNode;
+
+public class RecordingStatusConverter extends OmConverter<Recording.Status> {
+ private static final String PROCESSING = "PROCESSING";
+ public RecordingStatusConverter() {}
+
+ @Override
+ public Recording.Status read(InputNode node) throws Exception {
+ Recording.Status result = null;
+ String val = node.getValue();
+ try {
+ result = Recording.Status.valueOf(val);
+ } catch (Exception e) {
+ result = PROCESSING.equals(val) ? Status.CONVERTING : Status.NONE;
+ }
+ return result;
+ }
+
+ @Override
+ public void write(OutputNode node, Recording.Status value) throws Exception {
+ node.setData(true);
+ node.setValue(value == null ? Status.NONE.name() : value.name());
+ }
+}
Modified: openmeetings/application/branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java?rev=1756466&r1=1756465&r2=1756466&view=diff
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java (original)
+++ openmeetings/application/branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java Tue Aug 16 03:02:54 2016
@@ -780,7 +780,7 @@ public class BackupImport {
}
return list;
}
-
+
//FIXME (need to be removed in later versions) HACK to fix old properties
public List<Recording> readRecordingList(File baseDir, String fileName, String listNodeName) throws Exception {
List<Recording> list = new ArrayList<>();
@@ -794,6 +794,7 @@ public class BackupImport {
matcher.bind(Long.class, LongTransform.class);
matcher.bind(Integer.class, IntegerTransform.class);
registry.bind(Date.class, DateConverter.class);
+ registry.bind(Recording.Status.class, RecordingStatusConverter.class);
InputNode root = NodeBuilder.read(new FileInputStream(xml));
InputNode root1 = NodeBuilder.read(new FileInputStream(xml)); //HACK to handle old isFolder
@@ -826,7 +827,7 @@ public class BackupImport {
}
return list;
}
-
+
public List<User> readUserList(InputStream xml, String listNodeName) throws Exception {
return readUserList(new InputSource(xml), listNodeName);
}
Added: openmeetings/application/branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/RecordingStatusConverter.java
URL: http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/RecordingStatusConverter.java?rev=1756466&view=auto
==============================================================================
--- openmeetings/application/branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/RecordingStatusConverter.java (added)
+++ openmeetings/application/branches/3.2.x/openmeetings-install/src/main/java/org/apache/openmeetings/backup/RecordingStatusConverter.java Tue Aug 16 03:02:54 2016
@@ -0,0 +1,47 @@
+/*
+ * 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.backup;
+
+import org.apache.openmeetings.db.entity.record.Recording;
+import org.apache.openmeetings.db.entity.record.Recording.Status;
+import org.simpleframework.xml.stream.InputNode;
+import org.simpleframework.xml.stream.OutputNode;
+
+public class RecordingStatusConverter extends OmConverter<Recording.Status> {
+ private static final String PROCESSING = "PROCESSING";
+ public RecordingStatusConverter() {}
+
+ @Override
+ public Recording.Status read(InputNode node) throws Exception {
+ Recording.Status result = null;
+ String val = node.getValue();
+ try {
+ result = Recording.Status.valueOf(val);
+ } catch (Exception e) {
+ result = PROCESSING.equals(val) ? Status.CONVERTING : Status.NONE;
+ }
+ return result;
+ }
+
+ @Override
+ public void write(OutputNode node, Recording.Status value) throws Exception {
+ node.setData(true);
+ node.setValue(value == null ? Status.NONE.name() : value.name());
+ }
+}
Modified: openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java
URL: http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java?rev=1756466&r1=1756465&r2=1756466&view=diff
==============================================================================
--- openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java (original)
+++ openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/backup/BackupImport.java Tue Aug 16 03:02:54 2016
@@ -780,7 +780,7 @@ public class BackupImport {
}
return list;
}
-
+
//FIXME (need to be removed in later versions) HACK to fix old properties
public List<Recording> readRecordingList(File baseDir, String fileName, String listNodeName) throws Exception {
List<Recording> list = new ArrayList<>();
@@ -794,6 +794,7 @@ public class BackupImport {
matcher.bind(Long.class, LongTransform.class);
matcher.bind(Integer.class, IntegerTransform.class);
registry.bind(Date.class, DateConverter.class);
+ registry.bind(Recording.Status.class, RecordingStatusConverter.class);
InputNode root = NodeBuilder.read(new FileInputStream(xml));
InputNode root1 = NodeBuilder.read(new FileInputStream(xml)); //HACK to handle old isFolder
@@ -826,7 +827,7 @@ public class BackupImport {
}
return list;
}
-
+
public List<User> readUserList(InputStream xml, String listNodeName) throws Exception {
return readUserList(new InputSource(xml), listNodeName);
}
Added: openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/backup/RecordingStatusConverter.java
URL: http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/backup/RecordingStatusConverter.java?rev=1756466&view=auto
==============================================================================
--- openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/backup/RecordingStatusConverter.java (added)
+++ openmeetings/application/trunk/openmeetings-install/src/main/java/org/apache/openmeetings/backup/RecordingStatusConverter.java Tue Aug 16 03:02:54 2016
@@ -0,0 +1,47 @@
+/*
+ * 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.backup;
+
+import org.apache.openmeetings.db.entity.record.Recording;
+import org.apache.openmeetings.db.entity.record.Recording.Status;
+import org.simpleframework.xml.stream.InputNode;
+import org.simpleframework.xml.stream.OutputNode;
+
+public class RecordingStatusConverter extends OmConverter<Recording.Status> {
+ private static final String PROCESSING = "PROCESSING";
+ public RecordingStatusConverter() {}
+
+ @Override
+ public Recording.Status read(InputNode node) throws Exception {
+ Recording.Status result = null;
+ String val = node.getValue();
+ try {
+ result = Recording.Status.valueOf(val);
+ } catch (Exception e) {
+ result = PROCESSING.equals(val) ? Status.CONVERTING : Status.NONE;
+ }
+ return result;
+ }
+
+ @Override
+ public void write(OutputNode node, Recording.Status value) throws Exception {
+ node.setData(true);
+ node.setValue(value == null ? Status.NONE.name() : value.name());
+ }
+}