/**
- * Wandelt eine Entity-Liste in eine SimpleList von SimpleHashes um.
+ * Converts Entity-List to SimpleList of SimpleHashes.
* @param aList ist eine Liste von Entity
* @return eine freemarker.template.SimpleList von SimpleHashes.
*/
public static SimpleList makeSimpleList(EntityList aList) throws StorageObjectException
{
- SimpleList simpleList = new SimpleList();
+ SimpleList simpleList = new SimpleList();
if (aList != null) {
- for(int i=0;i<aList.size();i++){
+ for(int i=0;i<aList.size();i++) {
simpleList.add(makeSimpleHash(aList.elementAt(i)));
}
}
* @return SimpleHash mit den entsprechenden freemarker Daten
*
*/
- public static SimpleHash makeSimpleHash(Entity entity) {
- if (entity != null) {
- return makeSimpleHash(entity.getValues());
- }
- else {
- //theLog.printWarning("Entity ist <null>");
- return null;
- }
- }
+ public static SimpleHash makeSimpleHash(Entity entity) {
+ if (entity != null)
+ return makeSimpleHash(entity.getValues());
+ else
+ return null;
+ }
/**
* Konvertiert ein Hashtable mit den keys und values als String
/**
- * Wandelt EntityListe in SimpleHash um, und versieht die Liste mit StandardInfos,
- * die aus EntityList kommen.
+ * Converts EntityList in SimpleHash and adds additional information
+ * to the returned SimpleHash
*
* @param entList
* @return SimpleHash returns SimpleHash with the converted EntityList plus
* additional Data about the list.
* @exception StorageObjectException
*/
- public static SimpleHash makeSimpleHashWithEntitylistInfos(EntityList entList) throws StorageObjectException {
- SimpleHash modelRoot = new SimpleHash();
- if (entList!=null) {
- modelRoot.put("contentlist", makeSimpleList(entList));
- modelRoot.put("count", new SimpleScalar((new Integer(entList.getCount())).toString()));
- if (entList.getWhere()!=null) {
- modelRoot.put("where", new SimpleScalar(entList.getWhere()));
- modelRoot.put("where_encoded", new SimpleScalar(URLEncoder.encode(entList.getWhere())));
- }
-
- if(entList.getOrder()!=null) {
- modelRoot.put("order", new SimpleScalar(entList.getOrder()));
- modelRoot.put("order_encoded", new SimpleScalar(URLEncoder.encode(entList.getOrder())));
- }
- modelRoot.put("from", new SimpleScalar((new Integer(entList.getFrom())).toString()));
- modelRoot.put("to", new SimpleScalar((new Integer(entList.getTo())).toString()));
-
- if (entList.hasNextBatch())
- modelRoot.put("next", new SimpleScalar((new Integer(entList.getNextBatch())).toString()));
- if (entList.hasPrevBatch())
- modelRoot.put("prev", new SimpleScalar((new Integer(entList.getPrevBatch())).toString()));
+
+ public static SimpleHash makeSimpleHashWithEntitylistInfos(EntityList entList) throws StorageObjectException {
+ SimpleHash modelRoot = new SimpleHash();
+ if (entList!=null) {
+ modelRoot.put("contentlist", makeSimpleList(entList));
+ modelRoot.put("count", new SimpleScalar((new Integer(entList.getCount())).toString()));
+ if (entList.getWhere()!=null) {
+ modelRoot.put("where", new SimpleScalar(entList.getWhere()));
+ modelRoot.put("where_encoded", new SimpleScalar(URLEncoder.encode(entList.getWhere())));
+ }
+ if(entList.getOrder()!=null) {
+ modelRoot.put("order", new SimpleScalar(entList.getOrder()));
+ modelRoot.put("order_encoded", new SimpleScalar(URLEncoder.encode(entList.getOrder())));
}
- return modelRoot;
+ modelRoot.put("from", new SimpleScalar((new Integer(entList.getFrom())).toString()));
+ modelRoot.put("to", new SimpleScalar((new Integer(entList.getTo())).toString()));
+
+ if (entList.hasNextBatch())
+ modelRoot.put("next", new SimpleScalar((new Integer(entList.getNextBatch())).toString()));
+ if (entList.hasPrevBatch())
+ modelRoot.put("prev", new SimpleScalar((new Integer(entList.getPrevBatch())).toString()));
}
+ return modelRoot;
+ }
/**
* Private methods to get template from a templateFilename