Examples of SearchContext


Examples of org.jibeframework.alfresco.util.SearchContext

    });

  }

  private List<CMObject> search(CMFolder folder, String expr, int searchMode) {
    SearchContext sc = new SearchContext();
    sc.setLocation(getPathFromSpaceRef(folder.getNodeRef(), true));
    sc.setText(expr);
    sc.setMode(searchMode);
    SearchParameters sp = new SearchParameters();
    sp.setLanguage(SearchService.LANGUAGE_LUCENE);
    query = sc.buildQuery(3);
    sp.setQuery(query);
    sp.addStore(AlfrescoUtil.getInstance().getStoreRef());
    List<CMObject> model = new ArrayList<CMObject>();
    ResultSet rs = null;
    try {
View Full Code Here

Examples of org.jibeframework.alfresco.util.SearchContext

    // TODO Auto-generated method stub

  }

  public void search(CMFolder folder, String expr, int searchMode) {
    SearchContext sc = new SearchContext();
    sc.setLocation(getPathFromSpaceRef(folder.getNodeRef(), true));
    sc.setText(expr);
    sc.setMode(searchMode);
    SearchParameters sp = new SearchParameters();
    sp.setLanguage(SearchService.LANGUAGE_LUCENE);
    query = sc.buildQuery(3);
    sp.setQuery(query);
    sp.addStore(AlfrescoUtil.getInstance().getStoreRef());
    List<CMObject> model = new ArrayList<CMObject>();
    ResultSet rs = null;
    try {
View Full Code Here

Examples of org.openqa.selenium.SearchContext

        List<Field> fields = FindByUtilities.getListOfFieldsAnnotatedWithFindBys(target);
        for (Field field : fields) {
            try {
                final Field finalField = field;
                if (isValidClass(field.getType())) {
                    final SearchContext localSearchContext;
                    GrapheneContext grapheneContext = searchContext == null ? null : ((GrapheneProxyInstance) searchContext).getContext();
                    if (grapheneContext == null) {
                        grapheneContext = GrapheneContext.getContextFor(ReflectionHelper.getQualifier(field.getAnnotations()));
                        localSearchContext = grapheneContext.getWebDriver(SearchContext.class);
                    } else {
                        localSearchContext = searchContext;
                    }
                    final By rootBy = FindByUtilities.getCorrectBy(field, configuration.get().getDefaultElementLocatingStrategy());
                    Object wrapper;
                    try {
                        wrapper = createWrapper(grapheneContext, field.getType(), WebElementUtils.findElementLazily(rootBy, localSearchContext));
                    } catch (Exception e) {
                        throw new GrapheneTestEnricherException("Can't instantiate element wrapper " + target.getClass() + "." + field.getName() + " of type " + field.getType(), e);
                    }
                    try {
                        setValue(field, target, wrapper);
                    } catch (Exception e) {
                        throw new GrapheneTestEnricherException("Can't set a value to the " + target.getClass() + "." + field.getName() + ".", e);
                    }
                } else if (field.getType().isAssignableFrom(List.class)
                        && isValidClass(getListType(field))) {
                    final SearchContext localSearchContext;
                    GrapheneContext grapheneContext = searchContext == null ? null : ((GrapheneProxyInstance) searchContext).getContext();
                    if (grapheneContext == null) {
                        grapheneContext = GrapheneContext.getContextFor(ReflectionHelper.getQualifier(field.getAnnotations()));
                        localSearchContext = grapheneContext.getWebDriver(SearchContext.class);
                    } else {
View Full Code Here

Examples of org.openqa.selenium.SearchContext

        return element;
    }

    protected static WebElement dropProxyAndFindElement(By by, SearchContext searchContext) {
        if (searchContext instanceof GrapheneProxyInstance) {
            SearchContext unwrapped = (SearchContext) ((GrapheneProxyInstance) searchContext).unwrap();
            return unwrapped.findElement(by);
        } else {
            return searchContext.findElement(by);
        }
    }
View Full Code Here

Examples of org.openqa.selenium.SearchContext

        return element;
    }

    protected static WebElement dropProxyAndFindElement(By by, SearchContext searchContext) {
        if (searchContext instanceof GrapheneProxyInstance) {
            SearchContext unwrapped = (SearchContext) ((GrapheneProxyInstance) searchContext).unwrap();
            return unwrapped.findElement(by);
        } else {
            return searchContext.findElement(by);
        }
    }
View Full Code Here

Examples of org.openqa.selenium.SearchContext

    public void enrich(final SearchContext searchContext, Object target) {
        try {
            List<Field> fields = FindByUtilities.getListOfFieldsAnnotatedWithFindBys(target);
            for (Field field : fields) {
                GrapheneContext grapheneContext = searchContext == null ? null : ((GrapheneProxyInstance) searchContext).getContext();
                final SearchContext localSearchContext;
                if (grapheneContext == null) {
                    grapheneContext = GrapheneContext.getContextFor(ReflectionHelper.getQualifier(field.getAnnotations()));
                    localSearchContext = grapheneContext.getWebDriver(SearchContext.class);
                } else {
                    localSearchContext = searchContext;
View Full Code Here

Examples of org.openqa.selenium.SearchContext

    public void enrich(final SearchContext searchContext, Object target) {
        List<Field> fields = FindByUtilities.getListOfFieldsAnnotatedWithFindBys(target);
        for (Field field : fields) {
            GrapheneContext grapheneContext = searchContext == null ? null : ((GrapheneProxyInstance) searchContext)
                .getContext();
            final SearchContext localSearchContext;
            if (grapheneContext == null) {
                grapheneContext = GrapheneContext.getContextFor(ReflectionHelper.getQualifier(field.getAnnotations()));
                localSearchContext = grapheneContext.getWebDriver(SearchContext.class);
            } else {
                localSearchContext = searchContext;
View Full Code Here

Examples of org.openqa.selenium.SearchContext

        String errorMsgBegin = "";
        List<Field> fields = new LinkedList<Field>();
        fields.addAll(ReflectionHelper.getFieldsWithAnnotation(target.getClass(), Page.class));
        for (Field field : fields) {
                GrapheneContext grapheneContext = searchContext == null ? null : ((GrapheneProxyInstance) searchContext).getContext();
                final SearchContext localSearchContext;
                if (grapheneContext == null) {
                    grapheneContext = GrapheneContext.getContextFor(ReflectionHelper.getQualifier(field.getAnnotations()));
                    localSearchContext = grapheneContext.getWebDriver(SearchContext.class);
                } else {
                    localSearchContext = searchContext;
View Full Code Here

Examples of org.openqa.selenium.SearchContext

    public void enrich(final SearchContext searchContext, Object target) {
        List<Field> fields = FindByUtilities.getListOfFieldsAnnotatedWithFindBys(target);
        for (Field field : fields) {
            try {
                if (isValidClass(field.getType())) {
                    final SearchContext localSearchContext;
                    GrapheneContext grapheneContext = searchContext == null ? null : ((GrapheneProxyInstance) searchContext)
                        .getContext();
                    if (grapheneContext == null) {
                        grapheneContext = GrapheneContext.getContextFor(ReflectionHelper.getQualifier(field.getAnnotations()));
                        localSearchContext = grapheneContext.getWebDriver(SearchContext.class);
                    } else {
                        localSearchContext = searchContext;
                    }
                    final By rootBy = FindByUtilities.getCorrectBy(field, configuration.get()
                        .getDefaultElementLocatingStrategy());
                    Object wrapper;
                    try {
                        Class<?> type = field.getType();
                        wrapper = createWrapper(grapheneContext, type,
                            WebElementUtils.findElementLazily(rootBy, localSearchContext));
                    } catch (Exception e) {
                        throw new GrapheneTestEnricherException("Can't instantiate element wrapper " + target.getClass() + "."
                            + field.getName() + " of type " + field.getType(), e);
                    }
                    try {
                        setValue(field, target, wrapper);
                    } catch (Exception e) {
                        throw new GrapheneTestEnricherException("Can't set a value to the " + target.getClass() + "."
                            + field.getName() + ".", e);
                    }
                } else if (field.getType().isAssignableFrom(List.class) && isValidClass(getListType(field))) {
                    final SearchContext localSearchContext;
                    GrapheneContext grapheneContext = searchContext == null ? null : ((GrapheneProxyInstance) searchContext)
                        .getContext();
                    if (grapheneContext == null) {
                        grapheneContext = GrapheneContext.getContextFor(ReflectionHelper.getQualifier(field.getAnnotations()));
                        localSearchContext = grapheneContext.getWebDriver(SearchContext.class);
View Full Code Here

Examples of org.openqa.selenium.SearchContext

    this.selector = selector;
  }

  @Override
  public List<WebElement> getActualElements() {
    SearchContext searchContext = parent == null ? getWebDriver() : parent;
    return searchContext.findElements(selector);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.