Package org.fcrepo.server

Examples of org.fcrepo.server.Context


            @QueryParam(RestParam.FLASH)
            @DefaultValue("false")
            boolean flash) throws Exception {

        try {
            Context context = getContext();
            String[] pidList = m_management.getNextPID(context, numPIDS, namespace);
            MediaType mime = RestHelper.getContentType(format);

            if (pidList.length > 0) {
                String output = getSerializer(context).pidsToXml(pidList);
View Full Code Here


            String dateTime,
            @QueryParam(RestParam.FLASH)
            @DefaultValue("false")
            boolean flash) {
        try {
            Context context = getContext();
            Date asOfDateTime = DateUtility.parseDateOrNull(dateTime);
            MediaType mediaType = TEXT_XML;

            Validation validation = m_management.validate(context, pid, asOfDateTime);
View Full Code Here

            @QueryParam(RestParam.FLASH)
            @DefaultValue("false")
            boolean flash) {

        try {
            Context context = getContext();
            InputStream is = m_management.export(context, pid, format, exportContext, encoding);
            MediaType mediaType = TEXT_XML;
            if (format.equals(ATOMZIP1_1)) {
                mediaType = MediaType.valueOf(ZIP);
            }
View Full Code Here

            @QueryParam(RestParam.FLASH)
            @DefaultValue("false")
            boolean flash) {

        try {
            Context context = getContext();
            String[] objectHistory = m_access.getObjectHistory(context, pid);
            String xml = getSerializer(context).objectHistoryToXml(objectHistory, pid);
            MediaType mime = RestHelper.getContentType(format);

            if (TEXT_HTML.isCompatible(mime)) {
View Full Code Here

            @QueryParam(RestParam.FLASH)
            @DefaultValue("false")
            boolean flash) {

        try {
            Context context = getContext();
            InputStream is = m_management.getObjectXML(context, pid, DEFAULT_ENC);

            return Response.ok(is, TEXT_XML).build();
        } catch (Exception ex) {
            return handleException(ex, flash);
View Full Code Here

            @DefaultValue("false")
            boolean flash) {

        try {
            Date asOfDateTime = DateUtility.parseDateOrNull(dateTime);
            Context context = getContext();
            ObjectProfile objProfile = m_access.getObjectProfile(context, pid, asOfDateTime);
            String xml = getSerializer(context).objectProfileToXML(objProfile, asOfDateTime);

            MediaType mime = RestHelper.getContentType(format);
View Full Code Here

            String logMessage,
            @QueryParam(RestParam.FLASH)
            @DefaultValue("false")
            boolean flash) {
        try {
            Context context = getContext();
            Date d = m_management.purgeObject(context, pid, logMessage);
            return Response.ok(DateUtility.convertDateToXSDString(d), MediaType.TEXT_PLAIN_TYPE).build();
        } catch (Exception ex) {
            return handleException(ex, flash);
        }
View Full Code Here

            boolean ignoreMime,
            @QueryParam(RestParam.FLASH)
            @DefaultValue("false")
            boolean flash) {
        try {
            Context context = getContext();

            InputStream is = null;

            // Determine if content is provided
            RequestContent content =
                    RestUtil.getRequestContent(m_servletRequest, headers);
            if (content != null && content.getContentStream() != null) {
                if (ignoreMime) {
                    is = content.getContentStream();
                } else {
                    // Make sure content is XML or ZIP
                    String contentMime = content.getMimeType();
                    if (contentMime != null) {
                        MediaType t = MediaType.valueOf(contentMime);
                        if (TEXT_XML.isCompatible(t) || APP_ZIP.isCompatible(t)) {
                            is = content.getContentStream();
                        }
                    }
                }
            }

            // If no content is provided, use a FOXML template
            if (is == null) {
                if (pid == null || pid.equals("new")) {
                    pid = m_management.getNextPID(context, 1, namespace)[0];
                }

                if (ownerID == null || "".equals(ownerID.trim())) {
                    ownerID = context.getSubjectValue(Constants.SUBJECT.LOGIN_ID.uri);
                }
                is = new ByteArrayInputStream(getFOXMLTemplate(pid, label, ownerID, encoding).getBytes());
            } else {

                if (namespace != null && !namespace.equals("")) {
View Full Code Here

            DateTimeParam lastModifiedDate,
            @QueryParam(RestParam.FLASH)
            @DefaultValue("false")
            boolean flash) {
        try {
            Context context = getContext();
            Date requestModDate = null;
            if (lastModifiedDate != null) {
                requestModDate = lastModifiedDate.getValue();
            }
            Date lastModDate =
View Full Code Here

    public Response describe(@QueryParam("xml")
                          @DefaultValue("false")
                          boolean xml)
            throws ServletException, IOException {

        Context context = getContext();
        try {
            return describeRepository(context, xml);
        } catch (Exception ae) {
            return handleException(ae, false);
        }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.Context

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.