//자바를 이용해 가져오기
    public static String getDimRefUrl()
    {
        ENEQueryResults qResult = executeQuery("N=0");
        Navigation argNav = qResult.getNavigation();
        DimGroupList refDimensionGroups = argNav.getRefinementDimGroups();
        for (int i=0; i<refDimensionGroups.size(); i++)
        {
            DimGroup dg = (DimGroup)refDimensionGroups.get(i);
            for (int j=0; j<dg.size(); j++)
            {
                Dimension dim = (Dimension)dg.get(j);
                System.out.println("dimension: "+dim.getName());
                DimVal root = dim.getRoot();
                long rootId = root.getId();
                System.out.println("dimensionUrl: "+"Ne="+Long.toString(rootId));
                DimValList refs = dim.getRefinements();
                for (int k=0; k < refs.size(); k++)
                {
                    DimVal ref = refs.getDimValue(k);
                    System.out.println("refinement: "+ref.getName());
                    String refUrl = ENEQueryToolkit.selectRefinement(argNav, ref).toString();
                    System.out.println("refUrl: "+"N="+refUrl);
                }
            }
        }
        return "";
    }

    public static ENEQueryResults executeQuery(String argURL)
    {
        String HOST = "165.243.166.212";
        String PORT = "17000";
        HttpENEConnection CONN = null;
        ENEQueryResults results = null;
        UrlENEQuery queryObject = null;
       
        CONN = new HttpENEConnection(HOST, PORT);
        try
        {
            queryObject = new UrlENEQuery(argURL, "UTF-8");
            queryObject.setDimSearchCompound(true); //Sets whether dimension search will include compound results.
            queryObject.setNavAllRefinements(true);
            queryObject.setNavNumERecs(100);
            results = CONN.query(queryObject);
        }
        catch(Exception ex)
        {
            System.out.println(ex);
        }
        return results;
    }

'Dev > endeca' 카테고리의 다른 글

HttpServletRequest 메소드 정리  (0) 2009.02.13
jspref에서 merchandising rule 보이게 하기  (310) 2009.02.10
query result xml로 보기  (0) 2008.12.18
obtain lock  (0) 2008.12.17
property,dimension 관련파일  (0) 2008.12.14

+ Recent posts