Package org.dspace.content

Examples of org.dspace.content.DSpaceObject


        if (this.validity == null) {

            try {
                DSpaceValidity validity = new DSpaceValidity();

                DSpaceObject dso = HandleUtil.obtainHandle(objectModel);

                if (dso != null) {
                    // Add the actual collection;
                    validity.add(dso);
                }
View Full Code Here


     */
    @Override
    public void addOptions(Options options) throws SAXException, WingException,
            UIException, SQLException, IOException, AuthorizeException
    {
        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);

        List browse = options.addList("browse");

        browse.setHead(T_head_browse);

        List browseGlobal = browse.addList("global");
//        browseGlobal.setHead(T_head_all_of_dspace);
//        browseGlobal.addItemXref(contextPath + "/community-list", T_communities_and_collections);
        // Add the configured browse lists for 'top level' browsing
        addBrowseOptions(browseGlobal, contextPath + "/browse");

        List browseContext = browse.addList("context");

        if (dso != null)
        {
            if (dso instanceof Collection)
            {
                browseContext.setHead(T_head_this_collection);
                // Add the configured browse lists for scoped browsing
                String handle = dso.getHandle();
                addBrowseOptions(browseContext, contextPath + "/handle/" + handle + "/browse");
                //browseContext.addItem().addXref(contextPath + "/discovery/?q=search.resourcetype%3A2+AND+location%3Al" + dso.getID(), T_head_this_collection );
            }
            if (dso instanceof Community)
            {
                browseContext.setHead(T_head_this_community);
                // Add the configured browse lists for scoped browsing
                String handle = dso.getHandle();
                addBrowseOptions(browseContext, contextPath + "/handle/" + handle + "/browse");
                //browseContext.addItem().addXref(contextPath + "/discovery/?q=search.resourcetype%3A2+AND+location%3Am" + dso.getID(), T_head_this_community );
            }
        }
    }
View Full Code Here

   
        AbstractAdapter adapter = null;
     if (handle != null)
         {
      // Specified using a regular handle.
           DSpaceObject dso = HandleManager.resolveToObject(context, handle);
          
           // Handles can be either items or containers.
           if (dso instanceof Item)
                        adapter = new ItemAdapter(context, (Item) dso, contextPath);
           else if (dso instanceof Collection || dso instanceof Community)
View Full Code Here

                }
                qArgs.setSortOrder(sortOrder);

                // If there is a scope parameter, attempt to dereference it
                // failure will only result in its being ignored
                DSpaceObject container = null;
                if ((scope != null) && !scope.equals(""))
                {
                        container = HandleManager.resolveToObject(context, scope);
                }

                qArgs.setQuery(query);

                // Perform the search
                QueryResults qResults = null;
                if (container == null)
                {
                        qResults = DSQuery.doQuery(context, qArgs);
                }
                else if (container instanceof Collection)
                {
                    qResults = DSQuery.doQuery(context, qArgs, (Collection)container);
                }
                else if (container instanceof Community)
                {
                    qResults = DSQuery.doQuery(context, qArgs, (Community)container);
                }
               
                // now instantiate the results
                DSpaceObject[] results = new DSpaceObject[qResults.getHitHandles().size()];
                for (int i = 0; i < qResults.getHitHandles().size(); i++)
                {
                    String myHandle = (String)qResults.getHitHandles().get(i);
                    DSpaceObject dso = HandleManager.resolveToObject(context, myHandle);
                    if (dso == null)
                    {
                        throw new SQLException("Query \"" + query
                                + "\" returned unresolvable handle: " + myHandle);
                    }
View Full Code Here

        // see if a handle can be exracted for the item
        String handle = extractHandle(item);
       
        if (handle != null)
        {
          DSpaceObject dso = HandleManager.resolveToObject(ourContext, handle);
          if (dso != null)
            throw new HarvestingException("Handle collision: attempted to re-assign handle '" + handle + "' to an incoming harvested item '" + hi.getOaiID() + "'.");                   
        }
       
        try {
View Full Code Here

        sb.append("||");

        // report on the browse scope container
        String container = "all of DSpace";
        DSpaceObject theContainer = null;
        if (inCollection())
        {
          container = "collection";
          theContainer = this.collection;
        }
        else if (inCommunity())
        {
          container = "community";
          theContainer = this.community;
        }

        String containerID = "no id available/necessary";
        if (theContainer != null)
        {
          containerID = Integer.toString(theContainer.getID()) + " (" + theContainer.getHandle() + ")";
        }

        sb.append("Browsing in " + container + ": " + containerID);
        sb.append("||");
View Full Code Here

        options.addList("account");
        options.addList("context");
        options.addList("administrative");
        List statistics = options.addList("statistics");

        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
        if(dso != null && dso.getHandle() != null){
            statistics.setHead(T_statistics_head);
            statistics.addItemXref(contextPath + "/handle/" + dso.getHandle() + "/statistics", T_statistics_view);

        }


    }
View Full Code Here

        }

        try
        {
            Context context = ContextUtil.obtainContext(objectModel);
            DSpaceObject dso = HandleUtil.obtainHandle(objectModel);

            if (dso == null)
              return null;

            boolean authorized = AuthorizeManager.authorizeActionBoolean(context, dso, action, false);
View Full Code Here

    /**
     * Add a page title and trail links
     */
    public void addPageMeta(PageMeta pageMeta) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException {
        //Try to find our dspace object
        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);

        pageMeta.addTrailLink(contextPath + "/",T_dspace_home);

        if(dso != null)
            HandleUtil.buildHandleTrail(dso,pageMeta,contextPath);
        pageMeta.addTrailLink(contextPath + "/handle" + (dso != null && dso.getHandle() != null ? "/" + dso.getHandle() : "/statistics"), T_statistics_trail);

        // Add the page title
        pageMeta.addMetadata("title").addContent(T_head_title);
    }
View Full Code Here

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

        //Try to find our dspace object
        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);

    try
    {
      if(dso != null)
      {
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.