public DownloadResult convertFromSObject(SDownloadResult input, DownloadResult result, DatabaseSession session) throws BimserverDatabaseException { if (input == null) { return null; } if (input instanceof SCheckoutResult) { return convertFromSObject((SCheckoutResult)input, session); } result.setProjectName(input.getProjectName()); result.setRevisionNr(input.getRevisionNr()); result.setFile(input.getFile()); result.setSerializerOid(input.getSerializerOid()); return result; }
public SDownloadResult convertToSObject(DownloadResult input) { if (input == null) { return null; } if (input instanceof CheckoutResult) { return convertToSObject((CheckoutResult)input); } SDownloadResult result = new SDownloadResult(); result.setOid(input.getOid()); result.setRid(input.getRid()); result.setProjectName(input.getProjectName()); result.setRevisionNr(input.getRevisionNr()); result.setFile(input.getFile()); result.setSerializerOid(input.getSerializerOid()); return result; }
public Object sGet(SField sField) { if (sField.getName().equals("projectName")) { return getProjectName(); } if (sField.getName().equals("revisionNr")) { return getRevisionNr(); } if (sField.getName().equals("file")) { return getFile(); } if (sField.getName().equals("serializerOid")) { return getSerializerOid(); } if (sField.getName().equals("oid")) { return getOid(); } if (sField.getName().equals("rid")) { return getRid(); } throw new RuntimeException("Field " + sField.getName() + " not found"); }
LOGGER.error("Invalid topicId: " + topicId); } else { DataSource dataSource = checkoutResult.getFile().getDataSource(); PluginConfiguration pluginConfiguration = getBimServer().getPluginSettingsCache().getPluginSettings(checkoutResult.getSerializerOid());
public DownloadResult convertFromSObject(SDownloadResult input, DatabaseSession session) throws BimserverDatabaseException { if (session == null) { throw new BimserverDatabaseException("session == null, use the other method"); } LOGGER.info("Potential unlinked object created"); DownloadResult result = convertFromSObject(input, StoreFactory.eINSTANCE.createDownloadResult(), session); ((IdEObjectImpl)result).setOid(input.getOid()); ((IdEObjectImpl)result).setRid(input.getRid()); return result; }
@Override public InputStream getDownloadData(String baseAddress, String token, long topicId) throws IOException { try { SDownloadResult downloadData = get(ServiceInterface.class).getDownloadData(topicId); return downloadData.getFile().getInputStream(); } catch (ServerException e) { LOGGER.error("", e); } catch (UserException e) { LOGGER.error("", e); } catch (PublicInterfaceNotFoundException e) { LOGGER.error("", e); } return null; }
public Object newInstance() { return new org.bimserver.interfaces.objects.SDownloadResult(); } }));
public void sSet(SField sField, Object val) { if (sField.getName().equals("projectName")) { setProjectName((String)val); return; } if (sField.getName().equals("revisionNr")) { setRevisionNr((Integer)val); return; } if (sField.getName().equals("file")) { setFile((DataHandler)val); return; } if (sField.getName().equals("serializerOid")) { setSerializerOid((Long)val); return; } if (sField.getName().equals("oid")) { setOid((Long)val); return; } if (sField.getName().equals("rid")) { setRid((Integer)val); return; } throw new RuntimeException("Field " + sField.getName() + " not found"); }