[OFBIZ-7529] Part 1 of "Delete stale java files from applications and framework". Deleted following files/directories and references -

applications/content/src/main/java/org/ofbiz/content/report
applications/content/src/main/java/org/ofbiz/content/report/JREntityListIteratorDataSource.java
applications/content/src/main/java/org/ofbiz/content/report/JRMapCollectionDataSource.java

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1754634 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mridul Pathak
2016-07-31 06:04:09 +00:00
parent 7d0ac17753
commit 5577e005d7
4 changed files with 0 additions and 163 deletions
@@ -1,85 +0,0 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/
package org.apache.ofbiz.content.report;
import net.sf.jasperreports.engine.JRDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRField;
import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.entity.GenericEntity;
import org.apache.ofbiz.entity.GenericEntityException;
import org.apache.ofbiz.entity.util.EntityListIterator;
/**
* <code>JREntityListIteratorDataSource</code>
*/
public class JREntityListIteratorDataSource implements JRDataSource {
public static final String module = JREntityListIteratorDataSource.class.getName();
private EntityListIterator entityListIterator = null;
private GenericEntity currentEntity = null;
public JREntityListIteratorDataSource(EntityListIterator entityListIterator) {
this.entityListIterator = entityListIterator;
}
public boolean next() throws JRException {
if (this.entityListIterator == null) {
return false;
}
Object nextObj = this.entityListIterator.next();
if (nextObj != null) {
if (nextObj instanceof GenericEntity) {
this.currentEntity = (GenericEntity) nextObj;
} else {
throw new JRException("Current collection object does not seem to be a GenericEntity (or GenericValue or GenericPK).");
}
return true;
} else {
// nothing left, close here...
try {
this.entityListIterator.close();
} catch (GenericEntityException e) {
Debug.logError(e, "Error closing EntityListIterator in Jasper Reports DataSource", module);
throw new JRException(e);
}
this.entityListIterator = null;
return false;
}
}
public Object getFieldValue(JRField jrField) throws JRException {
Object value = null;
if (this.currentEntity != null) {
try {
value = this.currentEntity.get(jrField.getName());
} catch (IllegalArgumentException e) {
try {
value = this.currentEntity.get(org.apache.ofbiz.entity.model.ModelUtil.dbNameToVarName(jrField.getName()));
} catch (IllegalArgumentException ex) {
throw new JRException("The specified field name [" + jrField.getName() + "] is not a valid field-name for the entity: " + this.currentEntity.getEntityName(), e);
}
}
}
return value;
}
}
@@ -1,75 +0,0 @@
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/
package org.apache.ofbiz.content.report;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import net.sf.jasperreports.engine.JRDataSource;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JRField;
/**
* <code>JRMapCollectionDataSource</code>
*/
public class JRMapCollectionDataSource implements JRDataSource {
private Collection data = null;
private Iterator iterator = null;
private Map currentMap = null;
public JRMapCollectionDataSource(Collection mapCollection) {
this.data = mapCollection;
if (data != null) {
this.iterator = data.iterator();
}
}
public boolean next() throws JRException {
boolean hasNext = false;
if (this.iterator != null) {
hasNext = this.iterator.hasNext();
if (hasNext) {
try {
this.currentMap = (Map) this.iterator.next();
} catch (Exception e) {
throw new JRException("Current collection object does not seem to be a Map.", e);
}
}
}
return hasNext;
}
public Object getFieldValue(JRField jrField) throws JRException {
Object value = null;
if (currentMap != null) {
value = currentMap.get(jrField.getName());
}
return value;
}
}