Package org.dspace.content

Examples of org.dspace.content.DSpaceObject


     */
    public void addBody(Body body) throws SAXException, WingException,
            UIException, SQLException, IOException, AuthorizeException
    {

        DSpaceObject dspaceObject = HandleUtil.obtainHandle(objectModel);
        if (!(dspaceObject instanceof Item))
            return;
        Item item = (Item) dspaceObject;

        try {
View Full Code Here


            Parameters parameters)
    {
        try
        {
//            Request request = ObjectModelHelper.getRequest(objectModel);
            DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
            if (dso.getType() == Constants.ITEM) {
                Item item = (Item) dso;
                Bundle[] bundles = item.getBundles("ORIGINAL");
                for (Bundle bundle : bundles) {
//                    log.debug("bundle.name: " + bundle.getName());
//                    log.debug("bundle.priID: " + bundle.getPrimaryBitstreamID());
View Full Code Here

                    SolrDocument doc = (SolrDocument) iter.next();

                    String handle = (String) doc.getFieldValue("handle");

                    DSpaceObject o = HandleManager.resolveToObject(context, handle);

                    if (o == null) {
                        log.info("Deleting: " + handle);
                        /*
                         * Use IndexWriter to delete, its easier to manage
                         * write.lock
                         */
                        unIndexContent(context, handle);
                    } else {
                        context.removeCached(o, o.getID());
                        log.debug("Keeping: " + handle);
                    }
                }
            }
        } catch (Exception e) {
View Full Code Here

     * Generate the unique caching key.
     * This key must be unique inside the space of this component.
     */
    public Serializable getKey() {
        try {
            DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
           
            if (dso == null)
                return "0"; // no item, something is wrong
           
            return HashUtil.hash(dso.getHandle());
        }
        catch (SQLException sqle)
        {
            // Ignore all errors and just return that the component is not cachable.
            return "0";
View Full Code Here

    {
        if (this.validity == null)
      {
            Community community = null;
          try {
              DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
             
              if (dso == null)
                  return null;
             
              if (!(dso instanceof Community))
View Full Code Here

    }

    public static String locationToName(Context context, String field, String value) throws SQLException {
        if ("location.comm".equals(field) || "location.coll".equals(field)) {
            int type = field.equals("location.comm") ? Constants.COMMUNITY : Constants.COLLECTION;
            DSpaceObject commColl = DSpaceObject.find(context, type, Integer.parseInt(value));
            if (commColl != null) {
                return commColl.getName();
            }

        }
        return value;
    }
View Full Code Here

     */
    public void addPageMeta(PageMeta pageMeta) throws SAXException,
            WingException, UIException, SQLException, IOException,
            AuthorizeException
    {
        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
        if (!(dso instanceof Community))
            return;

        // Set up the major variables
        Community community = (Community) dso;
View Full Code Here

     */
    public void addBody(Body body) throws SAXException, WingException,
            UIException, SQLException, IOException, AuthorizeException
    {

        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
        if (!(dso instanceof Community))
            return;

        // Set up the major variables
        Community community = (Community) dso;
View Full Code Here

            while (iter.hasNext()) {
                SolrDocument doc = (SolrDocument) iter.next();

                String handle = (String) doc.getFieldValue("handle");

                DSpaceObject o = DSpaceObject.find(context, (Integer) doc.getFirstValue("search.resourcetype"), (Integer) doc.getFirstValue("search.resourceid"));

                if (o != null) {
                    result.add(o);
                }
            }
View Full Code Here

     * Generate the unique caching key.
     * This key must be unique inside the space of this component.
     */
    public Serializable getKey() {
        try {
            DSpaceObject dso = HandleUtil.obtainHandle(objectModel);

            if (dso == null)
                return "0"; // no item, something is wrong

            return HashUtil.hash(dso.getHandle());
        }
        catch (SQLException sqle)
        {
            // Ignore all errors and just return that the component is not cachable.
            return "0";
View Full Code Here

TOP

Related Classes of org.dspace.content.DSpaceObject

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.