Package org.dspace.content

Examples of org.dspace.content.DCPersonName


        try
        {
            init();
            if (query != null && query.length() > 2)
            {
                DCPersonName tmpPersonName = new DCPersonName(
                        query.toLowerCase());

                String luceneQuery = "";
                if (StringUtils.isNotBlank(tmpPersonName.getLastName()))
                {
                    luceneQuery += ClientUtils.escapeQueryChars(tmpPersonName
                            .getLastName().trim())
                            + (StringUtils.isNotBlank(tmpPersonName
                                    .getFirstNames()) ? "" : "*");
                }

                if (StringUtils.isNotBlank(tmpPersonName.getFirstNames()))
                {
                    luceneQuery += (luceneQuery.length() > 0 ? " " : "")
                            + ClientUtils.escapeQueryChars(tmpPersonName
                                    .getFirstNames().trim()) + "*";
                }
                luceneQuery = luceneQuery.replaceAll("\\\\ ", " ");
                DiscoverQuery discoverQuery = new DiscoverQuery();
                discoverQuery.setDSpaceObjectFilter(CrisConstants.RP_TYPE_ID);
View Full Code Here


                                            + "' of researcher. Perhaps is it the same person?");
                        }
                        else
                        {
                            dspaceUser = EPerson.create(dspaceContext);
                            DCPersonName personalName = new DCPersonName(
                                    researcher.getFullName());
                            dspaceUser.setNetid(researcher.getSourceID());
                            dspaceUser.setFirstName(personalName
                                    .getFirstNames());
                            dspaceUser.setLastName(personalName.getLastName());
                            dspaceUser.setEmail(researcher.getEmail()
                                    .getValue());
                            dspaceUser.setLanguage("en");
                            dspaceUser.setCanLogIn(true);
                            dspaceUser.update();
View Full Code Here

                // Setup the field's values
                if (dcInput.isRepeatable() || dcValues.length > 1)
                {
                        for (DCValue dcValue : dcValues)
                        {
                                DCPersonName dpn = new DCPersonName(dcValue.value);
               
                                lastName.addInstance().setValue(dpn.getLastName());
                                firstName.addInstance().setValue(dpn.getFirstNames());
                                Instance fi = fullName.addInstance();
                                fi.setValue(dcValue.value);
                                if (isAuthorityControlled)
                                {
                                    if (dcValue.authority == null || dcValue.authority.equals(""))
                                        fi.setAuthorityValue("", "blank");
                                    else
                                        fi.setAuthorityValue(dcValue.authority, Choices.getConfidenceText(dcValue.confidence));
                        }
                }
                }
                else if (dcValues.length == 1)
                {
                        DCPersonName dpn = new DCPersonName(dcValues[0].value);
               
                        lastName.setValue(dpn.getLastName());
                        firstName.setValue(dpn.getFirstNames());
                        if (isAuthorityControlled)
                        {
                            if (dcValues[0].authority == null || dcValues[0].authority.equals(""))
                                lastName.setAuthorityValue("", "blank");
                            else
View Full Code Here

        // punt if there is no query text
        if (text == null || text.trim().length() == 0)
            return new Choices(true);

        // 1. build CQL query
        DCPersonName pn = new DCPersonName(text);
        StringBuilder query = new StringBuilder();
        query.append("local.FirstName = \"").append(pn.getFirstNames()).
          append("\" and local.FamilyName = \"").append(pn.getLastName()).
          append("\"");

        // XXX arbitrary default limit - should be configurable?
        if (limit == 0)
            limit = 50;
View Full Code Here

                        log.warn("Skipping value of "+metadataField+" because the required Authority key is missing or empty.");
                        addErrorField(request, metadataField);
                    }
                    else
                        item.addMetadata(schema, element, qualifier, null,
                                new DCPersonName(l, f).toString(), authKey,
                                (sconf != null && sconf.length() > 0) ?
                                    Choices.getConfidenceValue(sconf) : Choices.CF_ACCEPTED);
                }
                else
                    item.addMetadata(schema, element, qualifier, null,
                        new DCPersonName(l, f).toString());
            }
        }
    }
View Full Code Here

        Composite textItem = ti.addComposite("textFieldsComp", "choices-lookup");
        Text t1 = textItem.addText("text1", "choices-lookup");
        if (isName)
        {
            Text t2 = textItem.addText("text2", "choices-lookup");
            DCPersonName dp = new DCPersonName(value);
            t1.setValue(dp.getLastName());
            t2.setValue(dp.getFirstNames());
            if (isFieldMessage(field, "help.last"))
            {
                Message m = getFieldMessage(field, "help.last");
                t1.setLabel(m);
                t1.setHelp(m);
View Full Code Here

            DCValue[] authors = item.getDC("contributor", "author", Item.ANY);

            if (authors.length > 0)
            {
                DCPersonName dpn = new DCPersonName(authors[0].value);
                sfxQuery = sfxQuery
                        + "&aulast="
                        + URLEncoder.encode(dpn.getLastName(),
                                Constants.DEFAULT_ENCODING);
                sfxQuery = sfxQuery
                        + "&aufirst="
                        + URLEncoder.encode(dpn.getFirstNames(),
                                Constants.DEFAULT_ENCODING);
            }

            DCValue[] isbn = item.getDC("identifier", "isbn", Item.ANY);
View Full Code Here

                        addErrorField(request, metadataField);
                    }
                    else
                    {
                        item.addMetadata(schema, element, qualifier, null,
                                new DCPersonName(l, f).toString(), authKey,
                                (sconf != null && sconf.length() > 0) ?
                                        Choices.getConfidenceValue(sconf) : Choices.CF_ACCEPTED);
                    }
                }
                else
                {
                    item.addMetadata(schema, element, qualifier, null,
                            new DCPersonName(l, f).toString());
                }
            }
        }
    }
View Full Code Here

        {
            return new Choices(true);
        }

        // 1. build CQL query
        DCPersonName pn = new DCPersonName(text);
        StringBuilder query = new StringBuilder();
        query.append("local.FirstName = \"").append(pn.getFirstNames()).
          append("\" and local.FamilyName = \"").append(pn.getLastName()).
          append("\"");

        // XXX arbitrary default limit - should be configurable?
        if (limit == 0)
        {
View Full Code Here

        Composite textItem = ti.addComposite("textFieldsComp", "choices-lookup");
        Text t1 = textItem.addText("text1", "choices-lookup");
        if (isName)
        {
            Text t2 = textItem.addText("text2", "choices-lookup");
            DCPersonName dp = new DCPersonName(value);
            t1.setValue(dp.getLastName());
            t2.setValue(dp.getFirstNames());
            if (isFieldMessage(field, "help.last"))
            {
                Message m = getFieldMessage(field, "help.last");
                t1.setLabel(m);
                t1.setHelp(m);
View Full Code Here

TOP

Related Classes of org.dspace.content.DCPersonName

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.