Package org.dspace.content

Examples of org.dspace.content.DSpaceObject


     */
    private DSpaceObject dspaceObjectWalk(DSpaceObject dso, String handle)
            throws SQLException
    {

        DSpaceObject current = dso;

        while (current != null)
        {

            // Check if the current object has the handle we are looking for.
            if (current.getHandle().equals(handle))
                return current;

            if (dso.getType() == Constants.ITEM)
            {
                current = ((Item) current).getOwningCollection();
View Full Code Here


    public void addPageMeta(PageMeta pageMeta) throws WingException, SQLException
    {
        pageMeta.addMetadata("title").addContent(T_title);
        pageMeta.addTrailLink(contextPath + "/", T_dspace_home);
   
    DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
        if ((dso instanceof Collection) || (dso instanceof Community))
        {
          HandleUtil.buildHandleTrail(dso,pageMeta,contextPath);
    }
   
View Full Code Here

      if ("".equals(handle))
      {
        throw new DSpaceSWORDException("The deposit URL is incomplete");
      }
     
      DSpaceObject dso = HandleManager.resolveToObject(context, handle);
     
      if (!(dso instanceof Collection))
      {
        throw new DSpaceSWORDException("The deposit URL does not resolve to a valid collection");
      }
View Full Code Here

            String key = params.getKey();

            if (key != null)
            {
                DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
                if (dso != null)
                    key += "-" + dso.getHandle();

                return HashUtil.hash(key);
            }
        }
        catch (Exception e)
View Full Code Here

        if (validity == null)
        {
            try
            {
                DSpaceValidity validity = new DSpaceValidity();
                DSpaceObject dso = HandleUtil.obtainHandle(objectModel);

                if (dso != null)
                    validity.add(dso);

                BrowseInfo info = getBrowseInfo();
View Full Code Here

        // Get the name of the index
        String type = info.getBrowseIndex().getName();

        pageMeta.addMetadata("title").addContent(getTitleMessage(info));

        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);

        pageMeta.addTrailLink(contextPath + "/", T_dspace_home);
        if (dso != null)
            HandleUtil.buildHandleTrail(dso, pageMeta, contextPath);
View Full Code Here

     * Resolve the ID into a collection and check to see if its harvesting options are set. If so, return
     * the collection, if not, bail out.
     */
    private Collection resolveCollection(String collectionID) {
     
      DSpaceObject dso;
      Collection targetCollection = null;
     
      try {
        // is the ID a handle?
          if (collectionID.indexOf('/') != -1)
          {
              // string has a / so it must be a handle - try and resolve it
              dso = HandleManager.resolveToObject(context, collectionID);
 
              // resolved, now make sure it's a collection
              if (dso == null || dso.getType() != Constants.COLLECTION)
                  targetCollection = null;
              else
                targetCollection = (Collection)dso;
          }
          // not a handle, try and treat it as an integer collection
View Full Code Here

        params.etAl = RequestUtils.getIntParameter(request, BrowseParams.ETAL);

        params.scope = new BrowserScope(context);

        // Are we in a community or collection?
        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
        if (dso instanceof Community)
            params.scope.setCommunity((Community) dso);
        if (dso instanceof Collection)
            params.scope.setCollection((Collection) dso);
View Full Code Here

    public void addBody(Body body) throws SAXException, WingException,
            UIException, SQLException, IOException, AuthorizeException
    {    
    Collection[] collections; // List of possible collections.
    String actionURL = contextPath + "/submit/" + knot.getId() + ".continue";
    DSpaceObject dso = HandleManager.resolveToObject(context, handle);

    if (dso != null && dso instanceof Community)
    {
      collections = Collection.findAuthorized(context, ((Community) dso), Constants.ADD);  
    }
View Full Code Here

            {
              applyFiltersAllItems(c);
            }
            else  // restrict application scope to identifier
            {
              DSpaceObject dso = HandleManager.resolveToObject(c, identifier);
              if (dso == null)
              {
                throw new IllegalArgumentException("Cannot resolve "
                                + identifier + " to a DSpace object");
              }
             
              switch (dso.getType())
              {
                case Constants.COMMUNITY:
                        applyFiltersCommunity(c, (Community)dso);
                        break;         
                case Constants.COLLECTION:
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.