Package org.dspace.versioning

Examples of org.dspace.versioning.VersioningService


        super.recycle();
    }

    private boolean isLatest(Item item)
    {
        VersioningService versioningService = new DSpace().getSingletonService(VersioningService.class);
        org.dspace.versioning.VersionHistory history = versioningService.findVersionHistory(context, item.getID());
        return (history==null || history.getLatestVersion().getItem().getID() == item.getID());
    }
View Full Code Here


    }


    private boolean hasVersionHistory(Item item)
    {
        VersioningService versioningService = new DSpace().getSingletonService(VersioningService.class);
        org.dspace.versioning.VersionHistory history = versioningService.findVersionHistory(context, item.getID());
        return (history!=null);
    }
View Full Code Here

        return Item.find(context, itemID);
    }


    private org.dspace.versioning.VersionHistory retrieveVersionHistory(Item item){
       VersioningService versioningService = new DSpace().getSingletonService(VersioningService.class);
        return versioningService.findVersionHistory(context, item.getID());
    }
View Full Code Here

    }

    private VersionHistory retrieveVersionHistory(Item item) throws WingException
    {
        VersioningService versioningService = new DSpace().getSingletonService(VersioningService.class);
        return versioningService.findVersionHistory(context, item.getID());
    }
View Full Code Here

            mainDivision.setHead(item.getHandle());
        }


        //Check if we have a history for the item
        VersioningService versioningService = new DSpace().getSingletonService(VersioningService.class);
        VersionHistory history = versioningService.findVersionHistory(context, item.getID());

        if(history != null){
            Version latestVersion = retrieveLatestVersion(history, item);
            if(latestVersion != null && latestVersion.getItemID() != item.getID())
            {
View Full Code Here

            result.setContinue(false);

            Item item = Item.find(context, itemID);

            if (AuthorizeManager.isAdmin(context, item) || item.canEdit()) {
                VersioningService versioningService = new DSpace().getSingletonService(VersioningService.class);
                Version version = versioningService.createNewVersion(context, itemID, summary);
                WorkspaceItem wsi = WorkspaceItem.findByItem(context, version.getItem());

                context.commit();

                result.setParameter("wsid", wsi.getID());
View Full Code Here

            result.setContinue(false);

            Item item = Item.find(context, itemID);

            if (AuthorizeManager.isAdmin(context, item)) {
                VersioningService versioningService = new DSpace().getSingletonService(VersioningService.class);
                versioningService.updateVersion(context, itemID, summary);

                context.commit();

                result.setOutcome(true);
                result.setContinue(true);
View Full Code Here

    public static FlowResult processRestoreVersion(Context context, int versionID, String summary) throws SQLException, AuthorizeException, IOException {
        FlowResult result = new FlowResult();
        try {
            result.setContinue(false);

            VersioningService versioningService = new DSpace().getSingletonService(VersioningService.class);
            versioningService.restoreVersion(context, versionID, summary);

            context.commit();

            result.setOutcome(true);
            result.setContinue(true);
View Full Code Here

    public static FlowResult processDeleteVersions(Context context, int itemId, String[] versionIDs) throws SQLException, AuthorizeException, IOException, UIException {
        FlowResult result = new FlowResult();
        try {
            result.setContinue(false);

            VersioningService versioningService = new DSpace().getSingletonService(VersioningService.class);

            VersionHistory versionHistory = versioningService.findVersionHistory(context, itemId);

            for (String id : versionIDs) {
                versioningService.removeVersion(context, Integer.parseInt(id));
            }
            context.commit();

            //Retrieve the latest version of our history (IF any is even present)
            Version latestVersion = versionHistory.getLatestVersion();
View Full Code Here

    header.addCellContent(T_column1);
    header.addCellContent(T_column2);
    header.addCellContent(T_column3);
        header.addCellContent(T_column4);

        VersioningService versioningService = new DSpace().getSingletonService(VersioningService.class);
        Version version = versioningService.getVersion(context, Integer.parseInt(id));

        Row row = table.addRow();
        row.addCell().addContent(version.getVersionNumber());
        row.addCell().addContent(version.getEperson().getEmail());
        row.addCell().addContent(new DCDate(version.getVersionDate()).toString());
View Full Code Here

TOP

Related Classes of org.dspace.versioning.VersioningService

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.