Package org.dspace.content.authority

Examples of org.dspace.content.authority.Choices


                            cris.getName()));
                }

                Choice[] results = new Choice[choiceList.size()];
                results = choiceList.toArray(results);
                return new Choices(results, 0, results.length,
                        Choices.CF_AMBIGUOUS, false, 0);
            }
            return new Choices(false);
        }
        catch (Exception e)
        {
            log.error("Error quering the RPAuthority - " + e.getMessage(), e);
            return new Choices(true);
        }
    }
View Full Code Here


     * @return an empty Choices
     */
    public Choices getBestMatch(String field, String text, int collection,
            String locale)
    {
        return new Choices(false);
    }
View Full Code Here

                    }
                }

                Choice[] results = new Choice[choiceList.size()];
                results = choiceList.toArray(results);
                return new Choices(results, 0, results.length,
                        Choices.CF_AMBIGUOUS, false, 0);
            }
            return new Choices(false);
        }
        catch (Exception e)
        {
            log.error("Error quering the RPAuthority - " + e.getMessage(), e);
            return new Choices(true);
        }
    }
View Full Code Here

            {
                results = choiceList.toArray(results);

                if (totalResult == 1)
                {
                    return new Choices(results, 0, totalResult,
                            Choices.CF_UNCERTAIN, false, 0);
                }
                else
                {
                    return new Choices(results, 0, totalResult,
                            Choices.CF_AMBIGUOUS, false, 0);
                }
            }
            else
            {
                return new Choices(false);
            }
        }
        catch (Exception e)
        {
            log.error("Error quering the HKUAuthority - " + e.getMessage(), e);
            return new Choices(true);
        }
    }
View Full Code Here

        {
            return cacheCount.get(name);
        }
        ChoiceAuthority ca = (ChoiceAuthority) PluginManager.getNamedPlugin(
                ChoiceAuthority.class, RPAuthority.RP_AUTHORITY_NAME);
        Choices choices = ca.getBestMatch(null, name, 0, null);
        cacheCount.put(name, choices.total);
        return choices.total;
    }
View Full Code Here

                if (readonly)
                {
                    select.setDisabled();
                }

                Choices cs = ChoiceAuthorityManager.getManager().getMatches(fieldKey, "", coll.getID(), 0, 0, null);
                if (dcValues.length == 0)
                    select.addOption(true, "", "");
                for (Choice c : cs.values)
                {
                    select.addOption(c.value, c.label);
View Full Code Here

        {
            String authorities[] = new String[values.length];
            int confidences[] = new int[values.length];
            for (int i = 0; i < values.length; ++i)
            {
                Choices c = ChoiceAuthorityManager.getManager().getBestMatch(fieldKey, values[i], getOwningCollectionID(), null);
                authorities[i] = c.values.length > 0 ? c.values[0].authority : null;
                confidences[i] = c.confidence;
            }
            addMetadata(schema, element, qualifier, lang, values, authorities, confidences);
        }
View Full Code Here

        // localization
        String locale = parameters.getParameter("locale",null);
        log.debug("AJAX menu generator: field="+field+", query="+query+", start="+sstart+", limit="+slimit+", format="+format+", field="+field+", query="+query+", start="+sstart+", limit="+slimit+", format="+format+", locale = "+locale);

        Choices result =
            ChoiceAuthorityManager.getManager().getMatches(field, query, collection, start, limit, locale);

        log.debug("Result count = "+result.values.length+", default="+result.defaultSelected);

        ChoicesXMLGenerator.generate(result, format, contentHandler);
View Full Code Here

        {
            String authorities[] = new String[values.length];
            int confidences[] = new int[values.length];
            for (int i = 0; i < values.length; ++i)
            {
                Choices c = ChoiceAuthorityManager.getManager().getBestMatch(fieldKey, values[i], getOwningCollectionID(), null);
                authorities[i] = c.values.length > 0 ? c.values[0].authority : null;
                confidences[i] = c.confidence;
            }
            addMetadata(schema, element, qualifier, lang, values, authorities, confidences);
        }
View Full Code Here

        String format = request.getParameter("format");
        int collection = UIUtil.getIntParameter(request, "collection");
        int start = UIUtil.getIntParameter(request, "start");
        int limit = UIUtil.getIntParameter(request, "limit");

        Choices result = cam.getMatches(field, query, collection, start, limit, null);
//        Choice[] testValues = {
//            new Choice("rp0001", "VALUE1","TEST LABEL1"),
//            new Choice("rp0002", "VALUE2","TEST LABEL2"),
//            new Choice("rp0003", "VALUE3","TEST LABEL3"),
//            new Choice("rp0004", "VALUE COGN, LABEL1","TEST COGN, LABEL1"),
View Full Code Here

TOP

Related Classes of org.dspace.content.authority.Choices

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.