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

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


    }
    return version;
  }
 
  public ResourceInterface getTrashedResource(String id) {
    ResourceInterface resource = null
    try {
      resource  = this.getTrashedResourceManager().loadTrashedResource(id);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "getTrashedResource");
      throw new RuntimeException("Errore in caricamento risorsa, id " + id, t);
View Full Code Here


    Set<String> trashRemovedResources = null;
    Iterator<String> it = resourceIds.iterator();
    String id = null;
    while (it.hasNext()) {
      id = (String)it.next();
      ResourceInterface resourceInterfaceArchived = null;
      ResourceInterface resourceInterfaceTrashed = null;
      try {
        resourceInterfaceTrashed = this.getTrashedResourceManager().loadTrashedResource(id);
        resourceInterfaceArchived = this.getResourceManager().loadResource(id);
        if (!(null != resourceInterfaceArchived || null != resourceInterfaceTrashed)) {
          if (null == trashRemovedResources) {
View Full Code Here

    List<String> archivedResources = null;
    if (null != resourceIds) {
      Iterator<String> it = resourceIds.iterator();
      String id = null;
      while (it.hasNext()) {
        ResourceInterface resourceInterface = null;
        id = (String) it.next();
        try {
          resourceInterface = this.getResourceManager().loadResource(id);
          if (null != resourceInterface) {
            if ( null == archivedResources) {
View Full Code Here

      return resources;
  }
 
  @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);
View Full Code Here

    Iterator<String> it = resourceIds.iterator();
    String id = null;
    while (it.hasNext()) {
      id = (String) it.next();
      if (null == archivedResources || !archivedResources.contains(id)) {
        ResourceInterface resourceInterface = null;
        try {
          resourceInterface = this.getTrashedResourceManager().loadTrashedResource(id);
          if (null != resourceInterface) {
            if (null == trashedResources) {
              trashedResources = new ArrayList<String>();
View Full Code Here

    return resource;
  }
 
  @Override
  public void restoreResource(String resourceId) throws ApsSystemException {
    ResourceInterface resource = this.loadTrashedResource(resourceId);
    if (null != resource) {
      try {
        boolean isProtected = !Group.FREE_GROUP_NAME.equals(resource.getMainGroup());
        String folder = this.getSubfolder(resource);
        String folderDest = resource.getFolder();
        if (resource.isMultiInstance()) {
          AbstractMultiInstanceResource multiResource = (AbstractMultiInstanceResource) resource;
          Map<String, ResourceInstance> instancesMap = multiResource.getInstances();
          Iterator<ResourceInstance> iter = instancesMap.values().iterator();
          while (iter.hasNext()) {
            ResourceInstance resourceInstance = iter.next();
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) {
        ApsSystemUtils.logThrowable(t, this, "removeFromTrash");
        throw new ApsSystemException("Error removing Trashed Resource", t);
View Full Code Here

     * @throws ApsSystemException
     */
    private ResourceInterface createResource(ResourceRecordVO resourceVo) throws ApsSystemException {
    String resourceType = resourceVo.getResourceType();
    String resourceXML = resourceVo.getXml();
    ResourceInterface resource = this.getResourceManager().createResourceType(resourceType);
    this.fillEmptyResourceFromXml(resource, resourceXML);
    resource.setMainGroup(resourceVo.getMainGroup());
    return resource;
  }
View Full Code Here

 
  @Override
  public String save() {
    try {
      MassiveResourceDataBean bean = this.prepareDataBean();
      ResourceInterface resourcePrototype = this.getResourceManager().createResourceType(this.getResourceTypeCode());
      File folder = new File(this.getFolder());
      this.addFolder(folder, "/", this.isRecursive(), bean, resourcePrototype);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "save");
      return FAILURE;
View Full Code Here

    try {
      String resourceId = this.getResourceId();
      if (null ==  resourceId || resourceId.length() == 0) {
        return null;
      }
      ResourceInterface resource = this.getTrashedResourceManager().loadTrashedResource(resourceId);
      String mainGroup = resource.getMainGroup();
      UserDetails currentUser = this.getCurrentUser();
      if (!this.getAuthManager().isAuthOnGroup(currentUser, mainGroup)) {
        return null;
      }
      int size = Integer.parseInt(this.getSize());
      ResourceInstance instance = null;
      //String path = null;
      if (resource.isMultiInstance()) {
        instance = ((AbstractMultiInstanceResource) resource).getInstance(size, getLangCode());
        //Map<String,String> trashPathsForInstances = getTrashedResourceManager().resourceInstancesTrashFilePaths(resource);
        //path = trashPathsForInstances.get(this.getSize());
      } else {
        instance = ((AbstractMonoInstanceResource) resource).getInstance();
View Full Code Here

TOP

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

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.