Package com.agiletec.plugins.jacms.aps.system.services.resource.model

Examples of com.agiletec.plugins.jacms.aps.system.services.resource.model.ResourceRecordVO


 
  @Override
  public ResourceInterface loadTrashedResource(String id) throws ApsSystemException{
    ResourceInterface resource = null;
    try {
      ResourceRecordVO resourceVo = this.getTrashedResourceDAO().getTrashedResource(id);
      if (null != resourceVo) {
        resource = this.createResource(resourceVo);
        ApsSystemUtils.getLogger().info("loaded trashed resource " + id);
      }
    } catch (Throwable t) {
View Full Code Here


  }
 
  @Override
  public void removeFromTrash(String resourceId) throws ApsSystemException {
    try {
      ResourceRecordVO resourceVo = this.getTrashedResourceDAO().getTrashedResource(resourceId);
      if (null != resourceVo) {
        ResourceInterface resource = this.createResource(resourceVo);
        this.removeFromTrash(resource);
      }
    } catch (Throwable t) {
View Full Code Here

*/
public class TrashedResourceDAO extends AbstractDAO implements ITrashedResourceDAO {
 
  @Override
  public ResourceRecordVO getTrashedResource(String id) {
    ResourceRecordVO resourceVo = null;
    Connection conn = null;
    PreparedStatement stat = null;
    ResultSet res = null;
    try {
      conn = this.getConnection();
      stat = conn.prepareStatement(SELECT_TRASHED_RESOURCE);
      stat.setString(1, id);
      res = stat.executeQuery();
      if (res.next()) {
        resourceVo = new ResourceRecordVO();
        resourceVo.setId(id);
        resourceVo.setResourceType(res.getString(1));
        resourceVo.setDescr(res.getString(2));
        resourceVo.setMainGroup(res.getString(3));
        resourceVo.setXml(res.getString(4));
      }
    } catch (Throwable t) {
      processDaoException(t, "Error loading record for trashed resource", "getTrashedResource");
    } finally {
      closeDaoResources(res, stat, conn);
View Full Code Here

    this.init();
  }
 
  public void testGetTrashedResource () {
    String resourceId = "66";
    ResourceRecordVO resourceVO = _trashedResourceDAO.getTrashedResource(resourceId);
    assertNotNull(resourceVO);
    assertEquals(resourceId, resourceVO.getId());
    assertEquals("configurazione", resourceVO.getDescr());
    assertEquals("free", resourceVO.getMainGroup());
    assertEquals("Attach", resourceVO.getResourceType());
    assertNotNull(resourceVO.getXml());
    assertTrue(resourceVO.getXml().length() > 0 );
  }
View Full Code Here

   
    assertNotNull(resource);
   
    _trashedResourceDAO.addTrashedResource(resource);
   
    ResourceRecordVO resourceVO = _trashedResourceDAO.getTrashedResource(resource.getId());
    assertNotNull(resourceVO);
    assertEquals( resource.getDescr(), resourceVO.getDescr());
    assertEquals( resource.getMainGroup(), resourceVO.getMainGroup());
    assertEquals( resource.getResourcePrototype().getType(), resourceVO.getResourceType());
    assertEquals( resource.getXML(), resourceVO.getXml());
   
    _trashedResourceDAO.delTrashedResource(resource.getId());
  }
View Full Code Here

      assertEquals("Image", resourceInterface.getType());
      assertEquals(resourceId, resourceInterface.getId());
     
      this._resourceManager.deleteResource(resourceInterface);
     
      ResourceRecordVO recordVO = _trashedResourceDAO.getTrashedResource(resourceId);
      assertNotNull(recordVO);
      assertEquals(resourceId, recordVO.getId());
      assertEquals("tux", recordVO.getDescr());
    } catch (Throwable t) {
      if (this._resourceManager.loadResource(resourceId) != null) {
        this._resourceManager.deleteResource(originaryResourceInterface);
      }
      if (this._trashedResourceDAO.getTrashedResource(resourceId) == null) {
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jacms.aps.system.services.resource.model.ResourceRecordVO

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.