Package org.dspace.content

Examples of org.dspace.content.DSpaceObject


        {
            if (myvalue.getLimitedDataTable() != null)
            {
                for (StatisticDatasBeanRow row : myvalue.getLimitedDataTable())
                {                  
                    DSpaceObject item = DSpaceObject.find(context, getRelationObjectType(), Integer.parseInt(row.getLabel()));
//                    if (item != null)
                    {
                        labels.addValue(type, row.getLabel(), item);
                    }
                }
View Full Code Here


        return null;
    }
   
    private DSpaceObject _getObject(HttpServletRequest request, String id)
    {
        DSpaceObject dso;
        try
        {
            dso = HandleManager.resolveToObject(
                    UIUtil.obtainContext(request), id);
        }
View Full Code Here

            relPref = applicationService.getRelationPreferenceForUUIDs(uuid, o,
                    configurationName);
        }
        String previousState = null;
        int previousPriority = 0;
        DSpaceObject dso = null;
        if (isItemID)
        {
            try
            {
                dso = Item.find(context, Integer.parseInt(o));
            }
            catch (Exception e)
            {
                throw new RuntimeException(e.getMessage(), e);
            }
        }
        else
        {
            dso = applicationService.getEntityByUUID(o);
        }
        if (relPref == null)
        {
            relPref = new RelationPreference();
            relPref.setRelationType(configurationName);
            relPref.setSourceUUID(uuid);
            relPref.setStatus(action);
            relPref.setPriority(priority);
            if (isItemID)
            {
                relPref.setItemID(Integer.parseInt(o));
            }
            else
            {
                relPref.setTargetUUID(o);
            }
        }
        else
        {
            previousState = relPref.getStatus();
            previousPriority = relPref.getPriority();
            relPref.setStatus(action);
            relPref.setPriority(priority);
        }
        if (action != null)
        {
            applicationService.saveOrUpdate(RelationPreference.class, relPref);
        }
        else
        {
            applicationService
                    .delete(RelationPreference.class, relPref.getId());
        }
        if (!conf.executeExtraAction(context, cris, dso.getID(), previousState,
                previousPriority, action, priority))
        {
            try
            {
                crisSearchService.indexContent(context, dso, true);
View Full Code Here

        List<StatSubscriptionViewBean> result = new ArrayList<StatSubscriptionViewBean>();

        int type = -1;
        String identifier = null;

        DSpaceObject dso = null;
        List<Integer> freqs = new ArrayList<Integer>();
        String objectName = null;
        for (StatSubscription statSub : statSubs)
        {

            DSpaceObject currDSO;
            if (statSub.getTypeDef() < 9)
            {
                currDSO = HandleManager.resolveToObject(context,
                        statSub.getUid());
            }
            else
            {
                currDSO = as.getEntityByUUID(statSub.getUid());
            }

            if (ObjectUtils.equals(currDSO, dso))
            {
                freqs.add(statSub.getFreq());
            }
            else
            {
                if (identifier != null)
                {
                    StatSubscriptionViewBean statViewBean = new StatSubscriptionViewBean();
                    List<Integer> tmpFreqs = new ArrayList<Integer>();
                    tmpFreqs.addAll(freqs);
                    statViewBean.setFreqs(tmpFreqs);
                    statViewBean.setObject(dso);
                    statViewBean.setObjectName(objectName);
                    statViewBean.setId(identifier);
                    statViewBean.setType(type);                   
                    result.add(statViewBean);
                }
                freqs.clear();
                freqs.add(statSub.getFreq());

                type = currDSO.getType();
                identifier = statSub.getUid();
                objectName = currDSO.getName();
                dso = currDSO;

            }
        }
        if (identifier != null)
View Full Code Here

                }
            }
            else
            {
               
                DSpaceObject dso = HandleManager.resolveToObject(context,
                        uuid);
                if (dso == null)
                {
                    throw new IllegalArgumentException("Invalid handle: "
                            + uuid + " DSpace object not found");
                }

                statBean.setObject(dso);
                statBean.setObjectName(dso.getName());
                statBean.setObjectURL(ConfigurationManager
                        .getProperty("dspace.url") + "/handle/" + uuid);
                statBean.setType(dso.getType());
                switch (dso.getType())
                {
                case Constants.ITEM:
                   
                    StatComponentsService serviceItem = researcher.getItemStatsComponents();
                    retrieveResults(dateType, dateStart, dateEnd, gap,
                            selectedObject, topObject, dso, serviceItem);
               
                    statBean.setStatURL(ConfigurationManager
                            .getProperty("dspace.url")
                            + "/cris/stats/item.html?handle=" + uuid);
                    break;

                case Constants.COLLECTION:

                    StatComponentsService serviceColl = researcher.getCollectionStatsComponents();
                    retrieveResults(dateType, dateStart, dateEnd, gap,
                            selectedObject, topObject, dso, serviceColl);
                 
                    statBean.setStatURL(ConfigurationManager
                            .getProperty("dspace.url")
                            + "/cris/stats/collection.html?handle=" + uuid);
                    break;

                case Constants.COMMUNITY:
                   
                    StatComponentsService serviceComm = researcher.getCommunityStatsComponents();
                    retrieveResults(dateType, dateStart, dateEnd, gap,
                            selectedObject, topObject, dso, serviceComm);
                   
                    statBean.setStatURL(ConfigurationManager
                            .getProperty("dspace.url")
                            + "/cris/stats/community.html?handle=" + uuid);
                    break;

                default:
                    throw new IllegalArgumentException("Invalid handle: "
                            + uuid + " DSpace object of type: "
                            + dso.getType() + " is not allowed");
                }
            }
            addStatDataBean(statBean, selectedObject, topObject);
        }
View Full Code Here

                    + sdl.getNumFound());
            SolrInputDocument sdi = ClientUtils.toSolrInputDocument(sd);
            Integer id = (Integer) sd.getFieldValue("id");
            Integer type = (Integer) sd.getFieldValue("type");

            DSpaceObject dso = DSpaceObject.find(context, type, id);
           
            // Do any additional indexing, depends on the plugins
            List<SolrStatsIndexPlugin> solrServiceIndexPlugins = new DSpace()
                    .getServiceManager().getServicesByType(
                            SolrStatsIndexPlugin.class);
View Full Code Here

        {
            userid = e.getID();

            // perform isAdmin check to see
            // if user is an Admin on this object
            DSpaceObject testObject = useInheritance?o.getAdminObject(action):null;
           
            if (isAdmin(c, testObject))
            {
                return true;
            }
View Full Code Here

        // If user doesn't have specific Admin permissions on this object,
        // check the *parent* objects of this object.  This allows Admin
        // permissions to be inherited automatically (e.g. Admin on Community
        // is also an Admin of all Collections/Items in that Community)
        DSpaceObject parent = o.getParentObject();
        if (parent != null)
        {
            return isAdmin(c, parent);
        }
 
View Full Code Here

        if (line.hasOption('i'))
        {
            String handle = getHandleArg(line.getOptionValue('i'));

            // Exporting a single item
            DSpaceObject o = HandleManager.resolveToObject(context, handle);

            if ((o != null) && o instanceof Item)
            {
                writeAIP(context, (Item) o, dest);
                System.exit(0);
            }
            else
            {
                System.err.println(line.getOptionValue('i')
                        + " is not a valid item Handle");
                System.exit(1);
            }
        }

        ItemIterator items = null;
        try
        {
            if (line.hasOption('c'))
            {
                String handle = getHandleArg(line.getOptionValue('c'));

                // Exporting a collection's worth of items
                DSpaceObject o = HandleManager.resolveToObject(context, handle);

                if ((o != null) && o instanceof Collection)
                {
                    items = ((Collection) o).getItems();
                }
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

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.