Skip to content

Commit

Permalink
fixes structure filter in containers list #2093
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilvam committed May 22, 2013
1 parent 7e87f37 commit 79321a1
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -4,6 +4,7 @@
import java.util.List;
import java.util.Map;

import com.dotmarketing.beans.ContainerStructure;
import com.dotmarketing.beans.Host;
import com.dotmarketing.beans.Identifier;
import com.dotmarketing.beans.Inode;
Expand Down Expand Up @@ -34,7 +35,7 @@ public void save(Container container) throws DotDataException {
HibernateUtil.save(container);
containerCache.add(container.getInode(), container);
}

public void save(Container container, String existingId) throws DotDataException {
HibernateUtil.saveWithPrimaryKey(container, existingId);
containerCache.add(container.getInode(), container);
Expand Down Expand Up @@ -120,7 +121,9 @@ public List<Container> findContainers(User user, boolean includeArchived,
"inode in class " + Inode.class.getName()+", identifier in class " + Identifier.class.getName() +", vinfo in class "+ContainerVersionInfo.class.getName());
if(UtilMethods.isSet(parent)){
if(InodeUtils.isSet(InodeFactory.getInode(parent, Structure.class).getInode()))
query.append(" where asset.inode = inode.inode and asset.identifier = identifier.id and asset.structureInode = '"+parent+"' ");
query.append(" where asset.inode = inode.inode and asset.identifier = identifier.id"
+ " and exists ( from cs in class " + ContainerStructure.class.getName() + " where cs.containerId = asset.identifier and cs.structureId = '"+parent+"' ) ");
// query.append(" where asset.inode = inode.inode and asset.identifier = identifier.id and asset.structureInode = '"+parent+"' ");
else
query.append(" ,tree in class " + Tree.class.getName() + " where asset.inode = inode.inode " +
"and asset.identifier = identifier.id and tree.parent = '"+parent+"' and tree.child=asset.inode");
Expand Down

0 comments on commit 79321a1

Please sign in to comment.