Changeset 2152
- Timestamp:
- Apr 6, 2006, 3:05:12 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/clients/web/net/sf/basedb/clients/web/plugins/SimpleExport.java
r1875 r2152 152 152 } 153 153 } 154 guiContexts.add(new GuiContext(Item.REPORTERSCORE, GuiContext.Type.LIST)); 154 155 } 155 156 } -
trunk/src/core/net/sf/basedb/core/Metadata.java
r1993 r2152 245 245 org.hibernate.Session session = dc.getHibernateSession(); 246 246 Object value = null; 247 BasicDatadata = null;247 Object data = null; 248 248 if (item instanceof BasicItem) 249 249 { … … 254 254 data = (BasicData)item; 255 255 } 256 else if (item instanceof ReporterScore) 257 { 258 data = ((ReporterScore)item).getData(); 259 } 256 260 else 257 261 { 258 throw new AssertionError("Item: " + item + " is not a BasicItem or BasicData");262 throw new AssertionError("Item: " + item + " is not a BasicItem, BasicData or ReporterScore"); 259 263 } 260 264 … … 265 269 if (value instanceof BasicData) 266 270 { 267 data = (BasicData)value; 268 Class<? extends BasicData> dataClass = null; 271 BasicData bData = (BasicData)value; 272 data = value; 273 Class<?> dataClass = null; 269 274 // If it is a proxy we must reload it using the current session 270 275 if (data instanceof org.hibernate.proxy.HibernateProxy) 271 276 { 272 277 dataClass = org.hibernate.proxy.HibernateProxyHelper.getClassWithoutInitializingProxy(data); 273 data = HibernateUtil.loadData(session, dataClass, data.getId());278 data = HibernateUtil.loadData(session, dataClass, bData.getId()); 274 279 } 275 280 else -
trunk/src/core/net/sf/basedb/core/ReporterScore.java
r2150 r2152 66 66 } 67 67 68 ReporterListScoreData getData() 69 { 70 return data; 71 } 72 68 73 /** 69 74 Get the reporter. -
trunk/www/common/export/submit_export.jsp
r2105 r2152 41 41 import="net.sf.basedb.core.ItemQuery" 42 42 import="net.sf.basedb.core.DataQuery" 43 import="net.sf.basedb.core.ReporterScoreQuery" 43 44 import="net.sf.basedb.core.Metadata" 44 45 import="net.sf.basedb.core.Path" … … 53 54 import="net.sf.basedb.core.query.Hql" 54 55 import="net.sf.basedb.core.data.BasicData" 56 import="net.sf.basedb.core.data.ReporterListScoreData" 55 57 import="net.sf.basedb.util.FileUtil" 56 58 import="net.sf.basedb.clients.web.Base" … … 132 134 entityName = rba.getRawDataType().getEntityName(); 133 135 } 136 if (itemType == Item.REPORTERSCORE) 137 { 138 entityName = ReporterListScoreData.class.getName(); 139 } 134 140 135 141 final Metadata metadata = entityName == null ? … … 234 240 235 241 boolean basicItems = false; 242 boolean basicDatas = false; 236 243 int exportedItems = 0; 237 244 do … … 245 252 { 246 253 result = ((DataQuery)query).iterate(dc); 247 basicItems = false; 254 basicDatas = true; 255 } 256 else if (query instanceof ReporterScoreQuery) 257 { 258 result = ((ReporterScoreQuery)query).iterate(dc); 248 259 } 249 260 exportedItems = 0; … … 252 263 exportedItems++; 253 264 Object item = result.next(); 254 int id = basicItems ? ((BasicItem)item).getId() : ((BasicData)item).getId(); 265 int id = 0; 266 if (basicItems) 267 { 268 id = ((BasicItem)item).getId(); 269 } 270 else if (basicDatas) 271 { 272 id = ((BasicData)item).getId(); 273 } 255 274 AnnotationSet as = null; 256 275 org.jdom.Element itemElement = null;
Note: See TracChangeset
for help on using the changeset viewer.