public Image[] getAllImages() { DomainFactory factory = getDomainFactory(); List l = factory.find("from AppImage", 5000); return AppImageVoAssembler.createAppImageVoCollectionFromAppImage(l).toIAppImageArray(); }
public Image getImage(int imageId) { DomainFactory factory = getDomainFactory(); AppImage domImage = (AppImage)factory.getDomainObject(AppImage.class, imageId); return AppImageVoAssembler.create(domImage); }
public ims.admin.vo.AppImageVo getImageById(Integer id) { return AppImageVoAssembler.create((AppImage) getDomainFactory().getDomainObject(AppImage.class, id)); }
public AppImageVoCollection listImages(AppImageVo filter) { DomainFactory factory = getDomainFactory(); StringBuffer cond = new StringBuffer(); ArrayList names = new ArrayList(); ArrayList values = new ArrayList(); String andStr = ""; if (filter != null) { if (filter.getImagePath() != null && filter.getImagePath().length() > 0) { cond.append(andStr + " upper(i.imagePath) like :path"); names.add("path"); values.add("%" + filter.getImagePath().toUpperCase() + "%"); andStr = " and "; } if (filter.getIsSystem() != null) { cond.append(andStr + " i.isSystem = :system"); names.add("system"); values.add(filter.getIsSystem()); andStr = " and "; } if (filter.getIsActive() == null || filter.getIsActive().booleanValue()) { cond.append(andStr + " i.isActive = :isActive "); names.add("isActive"); values.add(Boolean.TRUE); andStr = " and "; } } String hql = " from AppImage i "; if (!andStr.equals("")) { hql += " where "; hql += cond.toString(); } List images = factory.find(hql,names,values); return AppImageVoAssembler.createAppImageVoCollectionFromAppImage(images).sort(); }
public void deleteImage(AppImageVo image) throws ForeignKeyViolationException { DomainFactory factory = getDomainFactory(); AppImage domImage = AppImageVoAssembler.extractAppImage(factory, image); factory.delete(domImage); }
public AppImageVoCollection list16x16Icons(String name) { return AppImageVoAssembler.createAppImageVoCollectionFromAppImage(getDomainFactory().find("from AppImage as appImage where (appImage.height = :height and appImage.width = :width and appImage.imagePath like '%" + name + "%')", new String[]{"height", "width"}, new Object[]{16, 16}, 1000)); }