Package org.dspace.app.cris.model

Examples of org.dspace.app.cris.model.RestrictedField


                                        .getAttribute(UtilsXML.NAMEATTRIBUTE_VISIBILITY);

                                if (value != null && !value.isEmpty())
                                {

                                    RestrictedField itemInCollection = new RestrictedField();

                                    Integer visibility = null;
                                    if (visibilityString != null
                                            && !visibilityString.isEmpty())
                                    {
                                        visibility = Integer
                                                .parseInt(visibilityString);
                                    }
                                    else if (update == false)
                                    {
                                        visibility = VisibilityConstants.PUBLIC;

                                    }
                                    else
                                    {
                                        visibility = checkOldVisibility(
                                                applicationService, value,
                                                objectclone, visibility);

                                    }

                                    // RestrictedField old = checkOldValue(
                                    // applicationService, value, object,
                                    // visibility);
                                    // if (old == null) {
                                    itemInCollection.setValue(value);
                                    if (visibility != null)
                                    {
                                        itemInCollection
                                                .setVisibility(visibility);
                                    }
                                    object.add(itemInCollection);
                                    setter.invoke(researcher, object);
                                    // }
                                }
                                // else {
                                // if (update == true
                                // && nodeslist.getLength() == 1) {
                                // setter.invoke(researcher,
                                // (List<RestrictedField>) null);
                                // }
                                // }

                            }

                        }
                        else
                        {
                            // Object control_value = xpath.evaluate(
                            // xpathExpression, node, XPathConstants.NODE);
                            Element control_value = XMLUtils.getSingleElement(
                                    node, shortName);
                            if (control_value != null)
                            {
                                // String value =
                                // xpath.evaluate(xpathExpression,
                                // node);
                                // String visibilityString = xpath.evaluate(
                                // xpathExpression + "/" + XPATH_RULES[2],
                                // node);

                                String value = XMLUtils.getElementValue(node,
                                        shortName);
                                String visibilityString = control_value
                                        .getAttribute(UtilsXML.NAMEATTRIBUTE_VISIBILITY);

                                if (!value.isEmpty())
                                {

                                    if (method.getReturnType().equals(
                                            String.class))
                                    {

                                        setter.invoke(researcher, value);
                                    }
                                    else
                                    {

                                        Integer visibility = null;
                                        if (visibilityString != null
                                                && !visibilityString.isEmpty())
                                        {
                                            visibility = Integer
                                                    .parseInt(visibilityString);
                                        }
                                        else if (!update)
                                        {
                                            visibility = VisibilityConstants.PUBLIC;

                                        }
                                        else
                                        {
                                            visibility = checkOldVisibility(
                                                    applicationService, value,
                                                    (RestrictedField) field,
                                                    visibility);

                                        }

                                        if (RestrictedField.class.equals(method
                                                .getReturnType()))
                                        {

                                            RestrictedField object = (RestrictedField) field;
                                            object.setValue(value);
                                            if (visibility != null)
                                            {
                                                object.setVisibility(visibility);
                                            }
                                            setter.invoke(researcher, object);
                                        }
                                    }
View Full Code Here

TOP

Related Classes of org.dspace.app.cris.model.RestrictedField

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.