Package org.dspace.content

Examples of org.dspace.content.DSpaceObject


          int memberCount = group.getMembers().length + group.getMemberGroups().length;
          row.addCell().addContent(memberCount == 0 ? "-" : String.valueOf(memberCount));
         
          Cell cell = row.addCell();
          String groupName = group.getName();
            DSpaceObject collectionOrCommunity = null;
            String collectionOrCommunityName = null;
            int id;
            id = FlowGroupUtils.getCollectionId(groupName);
            if (id > -1)
            {
                Collection collection = Collection.find(context, id);
                if (collection != null)
                {
                    collectionOrCommunityName = collection.getMetadata("name");
                    collectionOrCommunity = collection;
                }
            }
            else
            {
                id = FlowGroupUtils.getCommunityId(groupName);
                if (id > -1)
                {
                    Community community = Community.find(context, id);
                    if (community != null)
                    {
                        collectionOrCommunityName = community.getMetadata("name");
                        collectionOrCommunity = community;
                    }
                }
            }
            if (collectionOrCommunity != null)
            {
                if (collectionOrCommunityName == null)
                    collectionOrCommunityName = "";
                else if (collectionOrCommunityName.length() > MAX_COLLECTION_OR_COMMUNITY_NAME)
                    collectionOrCommunityName = collectionOrCommunityName.substring(0,MAX_COLLECTION_OR_COMMUNITY_NAME-3) + "...";
             
                cell.addContent(collectionOrCommunityName + " ");
             
            Highlight highlight = cell.addHighlight("fade");

                highlight.addContent("[");
                highlight.addXref(contextPath+"/handle/"+collectionOrCommunity.getHandle(), T_collection_link);
            highlight.addContent("]");
          }
         
        }
       
View Full Code Here


            // scan items under embargo
            if (line.hasOption('i'))
            {
                for (String handle : line.getOptionValues('i'))
                {
                    DSpaceObject dso = HandleManager.resolveToObject(context, handle);
                    if (dso == null)
                    {
                        System.err.println("Error, cannot resolve handle="+handle+" to a DSpace Item.");
                        status = 1;
                    }
                    else if (dso.getType() != Constants.ITEM)
                    {
                        System.err.println("Error, the handle="+handle+" is not a DSpace Item.");
                        status = 1;
                    }
                    else
View Full Code Here

            {
                DSpaceValidity validity = new FeedValidity();
               
                Context context = ContextUtil.obtainContext(objectModel);

                DSpaceObject dso = null;
               
                if (handle != null && !handle.contains("site"))
                    dso = HandleManager.resolveToObject(context, handle);
               
                validity.add(dso);
View Full Code Here

    public void generate() throws IOException, SAXException, ProcessingException
    {
        try
        {
            Context context = ContextUtil.obtainContext(objectModel);
            DSpaceObject dso = null;
           
            if (handle != null && !handle.contains("site"))
            {
                dso = HandleManager.resolveToObject(context, handle);
                if (dso == null)
                {
                    // If we were unable to find a handle then return page not found.
                    throw new ResourceNotFoundException("Unable to find DSpace object matching the given handle: "+handle);
                }
               
                if (!(dso.getType() == Constants.COLLECTION || dso.getType() == Constants.COMMUNITY))
                {
                    // The handle is valid but the object is not a container.
                    throw new ResourceNotFoundException("Unable to syndicate DSpace object: "+handle);
                }
            }
View Full Code Here

    public Map act(Redirector redirector, SourceResolver sourceResolver, Map objectModel, String string, Parameters parameters) throws Exception {
        try{
            Request request = ObjectModelHelper.getRequest(objectModel);
            Context context = ContextUtil.obtainContext(objectModel);
            DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
            if(dso == null){
                //We might have a bitstream
                dso = findBitstream(context, parameters);
            }
            logDspaceObject(request, dso, context);
View Full Code Here


        // Reslove the bitstream
        Bitstream bitstream = null;
        Item item;
        DSpaceObject dso;

        if (bitstreamID > -1)
        {
            // Direct refrence to the individual bitstream ID.
            bitstream = Bitstream.find(context, bitstreamID);
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() + "full:" + showFullItem(objectModel));
        }
        catch (SQLException sqle)
        {
            // Ignore all errors and just return that the component is not cachable.
            return "0";
View Full Code Here

     * The validity object will include the item being viewed,
     * along with all bundles & bitstreams.
     */
    public SourceValidity getValidity()
    {
        DSpaceObject dso = null;

        if (this.validity == null)
      {
          try {
              dso = HandleUtil.obtainHandle(objectModel);
View Full Code Here

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

        // Set the page title
View Full Code Here

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

        DSpaceObject dso = HandleUtil.obtainHandle(objectModel);
        if (!(dso instanceof Item))
            return;
        Item item = (Item) dso;
       
        // Build the item viewer division.
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.