Package org.dspace.xoai.filter.results

Examples of org.dspace.xoai.filter.results.DatabaseFilterResult


        this.right = right;
    }

    @Override
    public DatabaseFilterResult buildDatabaseQuery(Context context) {
        DatabaseFilterResult leftResult = left.buildDatabaseQuery(context);
        DatabaseFilterResult rightResult = right.buildDatabaseQuery(context);
        List<Object> param = new ArrayList<Object>();
        param.addAll(leftResult.getParameters());
        param.addAll(rightResult.getParameters());
        return new DatabaseFilterResult("("+leftResult.getQuery()+") AND ("+ rightResult.getQuery() +")", param);
    }
View Full Code Here


                if (i < fields.size() - 1)
                    where.append(" OR ");
            }
            where.append(")");

            return new DatabaseFilterResult(where.toString(), args);
        } catch (InvalidMetadataFieldException e) {
            log.error(e.getMessage(), e);
        } catch (SQLException e) {
            log.error(e.getMessage(), e);
        }
        return new DatabaseFilterResult();
    }
View Full Code Here

    }


    @Override
    public DatabaseFilterResult buildDatabaseQuery(Context context) {
        DatabaseFilterResult result = inFilter.buildDatabaseQuery(context);
        return new DatabaseFilterResult("NOT ("+result.getQuery()+")", result.getParameters());
    }
View Full Code Here

        this.right = right;
    }

    @Override
    public DatabaseFilterResult buildDatabaseQuery(Context context) {
        DatabaseFilterResult leftResult = left.buildDatabaseQuery(context);
        DatabaseFilterResult rightResult = right.buildDatabaseQuery(context);
        List<Object> param = new ArrayList<Object>();
        param.addAll(leftResult.getParameters());
        param.addAll(rightResult.getParameters());
        return new DatabaseFilterResult("("+leftResult.getQuery()+") OR ("+ rightResult.getQuery() +")", param);
    }
View Full Code Here

    ContextService contextService;

    @Override
    public String buildDatabaseQuery(Condition condition, List<Object> parameters, Scope scope) throws ContextServiceException {
        DSpaceFilter filter = getFilter(condition);
        DatabaseFilterResult result = filter.buildDatabaseQuery(contextService.getContext());
        if (result.hasResult())
        {
            parameters.addAll(result.getParameters());
            if (scope == MetadataFormat)
                return "(item.deleted:true OR ("
                        + result.getQuery() + "))";
            else
                return "(" + result.getQuery() + ")";
        }
        return "true";
    }
View Full Code Here

                log.error(ex.getMessage(), ex);
            } catch (SQLException ex) {
                log.error(ex.getMessage(), ex);
            }
        }
        return new DatabaseFilterResult();
    }
View Full Code Here

        if (parts.size() > 0) {
            String query = "EXISTS (SELECT tmp.* FROM metadatavalue tmp WHERE tmp.resource_id=i.item_id AND tmp.resource_type_id=" + Constants.ITEM+ " AND tmp.metadata_field_id=?"
                    + " AND ("
                    + StringUtils.join(parts.iterator(), " OR ")
                    + "))";
            return new DatabaseFilterResult(query, params);
        }
        return new DatabaseFilterResult();
    }
View Full Code Here

    }

    @Override
    public DatabaseFilterResult buildDatabaseQuery(Context context)
    {
        return new DatabaseFilterResult("i.last_modified <= ?", new java.sql.Date(date.getTime()));
    }
View Full Code Here

    @Override
    public DatabaseFilterResult buildDatabaseQuery(Context context)
    {
        List<Object> params = new ArrayList<Object>();
        return new DatabaseFilterResult("EXISTS (SELECT p.action_id FROM "
                + "resourcepolicy p, " + "bundle2bitstream b, " + "bundle bu, "
                + "item2bundle ib " + "WHERE " + "p.resource_type_id=0 AND "
                + "p.resource_id=b.bitstream_id AND "
                + "p.epersongroup_id=0 AND " + "b.bundle_id=ib.bundle_id AND "
                + "bu.bundle_id=b.bundle_id AND " + "bu.name='ORIGINAL' AND "
View Full Code Here

    }

    @Override
    public DatabaseFilterResult buildDatabaseQuery(Context context)
    {
        return new DatabaseFilterResult("i.last_modified >= ?",
                new java.sql.Date(date.getTime()));
    }
View Full Code Here

TOP

Related Classes of org.dspace.xoai.filter.results.DatabaseFilterResult

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.