CPD Results

The following document contains the results of PMD's CPD 6.49.0.

Duplications

File Project Line
org\mycore\mods\access\facts\condition\MCRMODSCollectionCondition.java MyCoRe MODS 45
org\mycore\mods\access\facts\condition\MCRMODSGenreCondition.java MyCoRe MODS 45
private String idFact = "objid";

    @Override
    public void parse(Element xml) {
        super.parse(xml);
        this.idFact = Optional.ofNullable(xml.getAttributeValue("idfact")).orElse("objid");
    }

    @Override
    public Optional<MCRStringFact> computeFact(MCRFactsHolder facts) {

        Optional<MCRObjectIDFact> idc = facts.require(idFact);
        if (idc.isPresent()) {
            Optional<MCRObject> optMCRObject = idc.get().getObject();
            if (optMCRObject.isPresent()) {
                MCRMODSWrapper wrapper = new MCRMODSWrapper(optMCRObject.get());
                List<Element> e = wrapper.getElements(XPATH_COLLECTION);
                if ((e != null) && !(e.isEmpty())) {
                    String value = e.get(0).getAttributeValue("valueURI").split("#")[1];
                    if (value.equals(getTerm())) {
                        MCRStringFact fact = new MCRStringFact(getFactName(), getTerm());
                        fact.setValue(value);
                        facts.add(fact);
                        return Optional.of(fact);
                    }
                }
            }
        }
        return Optional.empty();
    }
}
File Project Line
org\mycore\common\events\MCREventHandlerBase.java MyCoRe Base Components 101
org\mycore\common\events\MCREventHandlerBase.java MyCoRe Base Components 238
updateDerivateFileIndex(evt, der);
                        break;
                    default:
                        logger
                            .warn("Can't find method for a derivate data handler for event type {}",
                                evt.getEventType());
                        break;
                }
                return;
            }
            logger.warn("Can't find method for " + evt.getObjectType() + " for event type {}", evt.getEventType());
            return;
        }

        if (evt.getObjectType() == MCREvent.ObjectType.PATH) {
            Path path = (Path) evt.get(MCREvent.PATH_KEY);
            if (path != null) {
                if (!path.isAbsolute()) {
                    logger.warn("Cannot handle path events on non absolute paths: {}", path);
                }
                logger.debug("{} handling {} {}", getClass().getName(), path, evt.getEventType());
                BasicFileAttributes attrs = (BasicFileAttributes) evt.get(MCREvent.FILEATTR_KEY);
                if (attrs == null && evt.getEventType() != MCREvent.EventType.DELETE) {
                    logger.warn("BasicFileAttributes for {} was not given. Resolving now.", path);
                    try {
                        attrs = Files.getFileAttributeView(path, BasicFileAttributeView.class).readAttributes();
                    } catch (IOException e) {
                        logger.error("Could not get BasicFileAttributes from path: {}", path, e);
                    }
                }
                switch (evt.getEventType()) {
                    case CREATE:
File Project Line
org\mycore\sword\servlets\MCRSwordContainerServlet.java MyCoRe SWORD Interface 43
org\mycore\sword\servlets\MCRSwordMediaResourceServlet.java MyCoRe SWORD Interface 40
api = new ContainerAPI(containerManager, statementManager, swordConfiguration);
    }

    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        prepareRequest(req, resp);
        api.get(req, resp);
        afterRequest(req, resp);
    }

    public void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        prepareRequest(req, resp);
        api.head(req, resp);
        afterRequest(req, resp);
    }

    public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        prepareRequest(req, resp);
        api.post(req, resp);
        afterRequest(req, resp);
    }

    public void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        prepareRequest(req, resp);
        api.put(req, resp);
        afterRequest(req, resp);
    }

    public void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        prepareRequest(req, resp);
        api.delete(req, resp);
        afterRequest(req, resp);
    }
}
File Project Line
org\mycore\restapi\v1\utils\MCRRestAPIObjectsHelper.java MyCoRe REST API 462
org\mycore\restapi\v1\utils\MCRRestAPIObjectsHelper.java MyCoRe REST API 598
eMcrobjects.addContent(eMcrObject);
            }
            try {
                StringWriter sw = new StringWriter();
                XMLOutputter xout = new XMLOutputter(Format.getPrettyFormat());
                xout.output(docOut, sw);
                return Response.ok(sw.toString())
                    .type("application/xml; charset=UTF-8")
                    .build();
            } catch (IOException e) {
                throw new MCRRestAPIException(Response.Status.INTERNAL_SERVER_ERROR,
                    new MCRRestAPIError(MCRRestAPIError.CODE_INTERNAL_ERROR, GENERAL_ERROR_MSG, e.getMessage()));
            }
        }

        //output as JSON
        if (MCRRestAPIObjects.FORMAT_JSON.equals(format)) {
            StringWriter sw = new StringWriter();
            try {
                JsonWriter writer = new JsonWriter(sw);
                writer.setIndent("    ");
                writer.beginObject();
                writer.name("numFound").value(objIdDates.size());
                writer.name("mycoreobjects");
                writer.beginArray();
                for (MCRObjectIDDate oid : objIdDates) {
                    writer.beginObject();
                    writer.name("ID").value(oid.getId());
File Project Line
org\mycore\lod\controller\MCRLodClassification.java MyCoRe Linked Open Data 142
org\mycore\restapi\v2\MCRRestClassifications.java MyCoRe REST API 131
@MCRCacheControl(maxAge = @MCRCacheControl.Age(time = 1, unit = TimeUnit.DAYS),
        sMaxAge = @MCRCacheControl.Age(time = 1, unit = TimeUnit.DAYS))
    @Path("/{" + PARAM_CLASSID + "}/{" + PARAM_CATEGID + "}")
    @Operation(summary = "Returns Classification with the given " + PARAM_CLASSID + " and " + PARAM_CATEGID + ".",
        responses = @ApiResponse(content = {
            @Content(schema = @Schema(implementation = MCRClass.class)),
            @Content(schema = @Schema(implementation = MCRClassCategory.class))
        },
            description = "If media type parameter " + MCRDetailLevel.MEDIA_TYPE_PARAMETER
                + " is 'summary' an MCRClassCategory is returned. "
                + "In other cases MCRClass with different detail level."),
        tags = MCRRestUtils.TAG_MYCORE_CLASSIFICATION)

    public Response getClassification(@PathParam(PARAM_CLASSID) String classId,
        @PathParam(PARAM_CATEGID) String categId) {
File Project Line
org\mycore\restapi\v1\utils\MCRRestAPIObjectsHelper.java MyCoRe REST API 489
org\mycore\restapi\v1\utils\MCRRestAPIObjectsHelper.java MyCoRe REST API 628
writer.name("ID").value(oid.getId());
                    writer.name("lastModified").value(SDF_UTC.format(oid.getLastModified()));
                    writer.name("href").value(info.getAbsolutePathBuilder().path(oid.getId()).build().toString());
                    writer.endObject();
                }
                writer.endArray();
                writer.endObject();

                writer.close();
                return Response.ok(sw.toString())
                    .type("application/json; charset=UTF-8")
                    .build();
            } catch (IOException e) {
                throw new MCRRestAPIException(Response.Status.INTERNAL_SERVER_ERROR,
                    new MCRRestAPIError(MCRRestAPIError.CODE_INTERNAL_ERROR, GENERAL_ERROR_MSG, e.getMessage()));
            }
        }
        throw new MCRRestAPIException(Response.Status.INTERNAL_SERVER_ERROR,
            new MCRRestAPIError(MCRRestAPIError.CODE_INTERNAL_ERROR, "A problem in programm flow", null));
File Project Line
org\mycore\pi\urn\MCRURNGranularOAIService.java MyCoRe Persistent Identifier 164
org\mycore\pi\urn\rest\MCRURNGranularRESTService.java MyCoRe Persistent Identifier 243
}

    private List<String> getIgnoreFileList() {
        List<String> ignoreFileNamesList = new ArrayList<>();
        String ignoreFileNames = getProperties().get("IgnoreFileNames");
        if (ignoreFileNames != null) {
            ignoreFileNamesList.addAll(Arrays.asList(ignoreFileNames.split(",")));
        } else {
            ignoreFileNamesList.add("mets\\.xml"); // default value
        }
        return ignoreFileNamesList;
    }

    @Override
    protected void registerIdentifier(MCRBase obj, String additional, MCRDNBURN urn)
        throws MCRPersistentIdentifierException {
        // not used in this impl
    }

    @Override
    protected void delete(MCRDNBURN identifier, MCRBase obj, String additional)
        throws MCRPersistentIdentifierException {
        throw new MCRPersistentIdentifierException("Delete is not supported for " + getType());
    }

    @Override
    protected void update(MCRDNBURN identifier, MCRBase obj, String additional)
        throws MCRPersistentIdentifierException {
        //TODO: improve API, don't override method to do nothing
        LOGGER.info("No update in this implementation");
    }
File Project Line
org\mycore\datamodel\metadata\MCRMetaLink.java MyCoRe Base Components 261
org\mycore\datamodel\metadata\MCRMetaLinkID.java MyCoRe Base Components 245
MCRMetaLink other = (MCRMetaLink) obj;
        if (!Objects.equals(from, other.from)) {
            return false;
        } else if (!Objects.equals(href, other.href)) {
            return false;
        } else if (!Objects.equals(label, other.label)) {
            return false;
        } else if (!Objects.equals(linktype, other.linktype)) {
            return false;
        } else if (!Objects.equals(role, other.role)) {
            return false;
        } else if (!Objects.equals(title, other.title)) {
            return false;
        } else {
            return Objects.equals(to, other.to);
        }
    }

    /**
     * This method read the XML input stream part from a DOM part for the metadata of the document.
     * 
     * @param element
     *            a relevant DOM element for the metadata
     * @exception MCRException
     *                if the xlink:type is not locator or arc or if href or from and to are null or empty
     */
    @Override
    public void setFromDOM(Element element) throws MCRException {
File Project Line
org\mycore\pi\purl\MCRPURLManager.java MyCoRe Persistent Identifier 260
org\mycore\pi\purl\MCRPURLManager.java MyCoRe Persistent Identifier 298
if (response != 200 && conn.getErrorStream() != null && LOGGER.isErrorEnabled()) {
                try (BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getErrorStream(),
                    StandardCharsets.UTF_8))) {
                    String line = null;
                    LOGGER.error(conn.getRequestMethod() + " " + conn.getURL() + " -> " + conn.getResponseCode());
                    while ((line = rd.readLine()) != null) {
                        LOGGER.error(line);
                    }
                }
            }
        } catch (Exception e) {
            LOGGER.error(e);
        } finally {
            if (conn != null) {
                conn.disconnect();
            }
        }
        return response;
    }

    /**
     * deletes an existing PURL
     *
     * @param purl
     * @return the HTTP Status Code of the request
     */
    public int deletePURL(String purl) {
File Project Line
org\mycore\restapi\v1\MCRRestAuthorizationFilter.java MyCoRe REST API 99
org\mycore\restapi\v2\MCRRestAuthorizationFilter.java MyCoRe REST API 85
throws MCRRestAPIException {
        LogManager.getLogger().debug("Permission: {}, Object: {}, Derivate: {}, Path: {}", permission, objectId, derId,
            path);
        Optional<String> checkable = Optional.ofNullable(derId)
            .filter(d -> path != null) //only check for derId if path is given
            .map(Optional::of)
            .orElseGet(() -> Optional.ofNullable(objectId));
        checkable.ifPresent(id -> LogManager.getLogger().info("Checking " + permission + " access on " + id));
        MCRRequestScopeACL aclProvider = MCRRequestScopeACL.getInstance(requestContext);
        boolean allowed = checkable
            .map(id -> aclProvider.checkPermission(id, permission.toString()))
            .orElse(true);
        if (allowed) {
            return;
        }
File Project Line
org\mycore\pi\MCRGenericPIGenerator.java MyCoRe Persistent Identifier 343
org\mycore\pi\urn\MCRCountingDNBURNGenerator.java MyCoRe Persistent Identifier 51
.getList(getType(), -1, -1);

        // extract the number of the PI
        Optional<Integer> highestNumber = list.stream()
            .map(MCRPIRegistrationInfo::getIdentifier)
            .filter(matching)
            .map(pi -> {
                // extract the number of the PI
                Matcher matcher = regExpPattern.matcher(pi);
                if (matcher.find() && matcher.groupCount() == 1) {
                    String group = matcher.group(1);
                    return Integer.parseInt(group, 10);
                } else {
                    return null;
                }
            }).filter(Objects::nonNull)
            .min(Comparator.reverseOrder())
            .map(n -> n + 1);
        return new AtomicInteger(highestNumber.orElse(0));
    }
File Project Line
org\mycore\iview2\frontend\MCRPDFTools.java MyCoRe IView2 138
org\mycore\media\services\MCRPdfThumbnailGenerator.java MyCoRe MediaInfo 71
private static PDPage resolveOpenActionPage(PDDocument pdf) throws IOException {
        PDDestinationOrAction openAction = pdf.getDocumentCatalog().getOpenAction();

        if (openAction instanceof PDActionGoTo) {
            final PDDestination destination = ((PDActionGoTo) openAction).getDestination();
            if (destination instanceof PDPageDestination) {
                openAction = destination;
            }
        }

        if (openAction instanceof PDPageDestination) {
            final PDPageDestination namedDestination = (PDPageDestination) openAction;
            final PDPage pdPage = namedDestination.getPage();
            if (pdPage != null) {
                return pdPage;
            } else {
                int pageNumber = namedDestination.getPageNumber();
                if (pageNumber != -1) {
                    return pdf.getPage(pageNumber);
                }
            }
        }

        return pdf.getPage(0);
    }
File Project Line
org\mycore\iview2\frontend\MCRPDFTools.java MyCoRe IView2 106
org\mycore\iview2\frontend\MCRThumbnailServlet.java MyCoRe IView2 212
final Graphics2D bg = bicubicScaledPage.createGraphics();
        try {
            bg.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
            int x = centered ? (thumbnailSize - newWidth) / 2 : 0;
            int y = centered ? (thumbnailSize - newHeight) / 2 : 0;
            if (x != 0 && y != 0) {
                LOGGER.warn("Writing at position {},{}", x, y);
            }
            bg.drawImage(level1Image, x, y, x + newWidth, y + newHeight, 0, 0, (int) Math.ceil(width),
                (int) Math.ceil(height), null);
        } finally {
            bg.dispose();
        }
        return bicubicScaledPage;
File Project Line
org\mycore\restapi\v1\MCRRestAPIClassifications.java MyCoRe REST API 133
org\mycore\restapi\v1\MCRRestAPIClassifications.java MyCoRe REST API 465
for (Element eLabel : e.getChildren("label")) {
                if (lang == null || lang.equals(eLabel.getAttributeValue("lang", Namespace.XML_NAMESPACE))) {
                    writer.beginObject();
                    writer.name("lang").value(eLabel.getAttributeValue("lang", Namespace.XML_NAMESPACE));
                    writer.name("text").value(eLabel.getAttributeValue("text"));
                    if (eLabel.getAttributeValue("description") != null) {
                        writer.name("description").value(eLabel.getAttributeValue("description"));
                    }
                    writer.endObject();
                }
            }
            writer.endArray();

            if (e.getChildren("category").size() > 0) {
File Project Line
org\mycore\lod\MCRLodFeature.java MyCoRe Linked Open Data 44
org\mycore\restapi\MCRRestFeature.java MyCoRe REST API 44
public class MCRLodFeature extends MCRJerseyDefaultFeature {
    @Override
    public void configure(ResourceInfo resourceInfo, FeatureContext context) {
        Class<?> resourceClass = resourceInfo.getResourceClass();
        Method resourceMethod = resourceInfo.getResourceMethod();
        if (requiresTransaction(resourceClass, resourceMethod)) {
            context.register(MCREnableTransactionFilter.class);
        }
        super.configure(resourceInfo, context);
    }

    /**
     * Checks if the class/method is annotated by {@link MCRRequireTransaction}.
     *
     * @param resourceClass the class to check
     * @param resourceMethod the method to check
     * @return true if one ore both is annotated and requires transaction
     */
    protected boolean requiresTransaction(Class<?> resourceClass, Method resourceMethod) {
        return resourceClass.getAnnotation(MCRRequireTransaction.class) != null
            || resourceMethod.getAnnotation(MCRRequireTransaction.class) != null;
    }

    @Override
    protected List<String> getPackages() {
        return MCRConfiguration2.getString("MCR.LOD.Resource.Packages").map(MCRConfiguration2::splitValue)
File Project Line
org\mycore\mcr\acl\accesskey\restapi\v2\MCRRestDerivateAccessKeys.java MyCoRe ACL 69
org\mycore\mcr\acl\accesskey\restapi\v2\MCRRestObjectAccessKeys.java MyCoRe ACL 68
summary = "Lists all access keys for a derivate",
        responses = {
            @ApiResponse(responseCode = "200", content = { @Content(mediaType = MediaType.APPLICATION_JSON,
                array = @ArraySchema(schema = @Schema(implementation = MCRAccessKey.class))) }),
            @ApiResponse(responseCode = "" + MCRObjectIDParamConverterProvider.CODE_INVALID, // 400
                description = MCRObjectIDParamConverterProvider.MSG_INVALID,
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
            @ApiResponse(responseCode = "401",
                description = "You do not have create permission and need to authenticate first",
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
            @ApiResponse(responseCode = "404", description = "Derivate or access key does not exist",
File Project Line
org\mycore\iview2\services\MCRIView2Tools.java MyCoRe IView2 278
org\mycore\iview2\services\MCRIView2Tools.java MyCoRe IView2 299
public static BufferedImage readTile(Path iviewFileRoot, ImageReader imageReader, int zoomLevel, int x, int y)
        throws IOException {
        String tileName = new MessageFormat("{0}/{1}/{2}.jpg", Locale.ROOT).format(new Object[] { zoomLevel, y, x });
        Path tile = iviewFileRoot.resolve(tileName);
        if (Files.exists(tile)) {
            try (SeekableByteChannel fileChannel = Files.newByteChannel(tile)) {
                ImageInputStream iis = ImageIO.createImageInputStream(fileChannel);
                if (iis == null) {
                    throw new IOException("Could not acquire ImageInputStream from SeekableByteChannel: " + tile);
                }
                imageReader.setInput(iis, true);
File Project Line
org\mycore\mcr\acl\accesskey\restapi\v2\MCRRestDerivateAccessKeys.java MyCoRe ACL 72
org\mycore\mcr\acl\accesskey\restapi\v2\MCRRestDerivateAccessKeys.java MyCoRe ACL 96
array = @ArraySchema(schema = @Schema(implementation = MCRAccessKey.class))) }),
            @ApiResponse(responseCode = "" + MCRObjectIDParamConverterProvider.CODE_INVALID, // 400
                description = MCRObjectIDParamConverterProvider.MSG_INVALID,
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
            @ApiResponse(responseCode = "401",
                description = "You do not have create permission and need to authenticate first",
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
            @ApiResponse(responseCode = "404", description = "Derivate or access key does not exist",
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
        })
    @Produces(MediaType.APPLICATION_JSON)
    @MCRRestRequiredPermission(MCRRestAPIACLPermission.WRITE)
    public Response listAccessKeysForDerivate(@PathParam(PARAM_DERID) final MCRObjectID derivateId,
File Project Line
org\mycore\mcr\acl\accesskey\restapi\v2\MCRRestObjectAccessKeys.java MyCoRe ACL 71
org\mycore\mcr\acl\accesskey\restapi\v2\MCRRestObjectAccessKeys.java MyCoRe ACL 95
array = @ArraySchema(schema = @Schema(implementation = MCRAccessKey.class))) }),
            @ApiResponse(responseCode = "" + MCRObjectIDParamConverterProvider.CODE_INVALID, // 400
                description = MCRObjectIDParamConverterProvider.MSG_INVALID,
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
            @ApiResponse(responseCode = "401",
                description = "You do not have create permission and need to authenticate first",
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
            @ApiResponse(responseCode = "404", description = "Object or access key does not exist",
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
        })
    @Produces(MediaType.APPLICATION_JSON)
    @MCRRestRequiredPermission(MCRRestAPIACLPermission.WRITE)
    public Response listAccessKeysForObject(@PathParam(PARAM_MCRID) final MCRObjectID objectId,
File Project Line
org\mycore\mcr\acl\accesskey\restapi\v2\MCRRestDerivateAccessKeys.java MyCoRe ACL 93
org\mycore\mcr\acl\accesskey\restapi\v2\MCRRestObjectAccessKeys.java MyCoRe ACL 92
summary = "Gets access key for a derivate",
        responses = {
            @ApiResponse(responseCode = "200", content = @Content(mediaType = MediaType.APPLICATION_JSON,
                schema = @Schema(implementation = MCRAccessKey.class))),
            @ApiResponse(responseCode = "" + MCRObjectIDParamConverterProvider.CODE_INVALID, // 400
                description = MCRObjectIDParamConverterProvider.MSG_INVALID,
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
            @ApiResponse(responseCode = "401",
                description = "You do not have create permission and need to authenticate first",
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
            @ApiResponse(responseCode = "404", description = "Derivate or access key does not exist",
File Project Line
org\mycore\mcr\acl\accesskey\restapi\v2\MCRRestDerivateAccessKeys.java MyCoRe ACL 72
org\mycore\mcr\acl\accesskey\restapi\v2\MCRRestDerivateAccessKeys.java MyCoRe ACL 96
org\mycore\mcr\acl\accesskey\restapi\v2\MCRRestDerivateAccessKeys.java MyCoRe ACL 172
array = @ArraySchema(schema = @Schema(implementation = MCRAccessKey.class))) }),
            @ApiResponse(responseCode = "" + MCRObjectIDParamConverterProvider.CODE_INVALID, // 400
                description = MCRObjectIDParamConverterProvider.MSG_INVALID,
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
            @ApiResponse(responseCode = "401",
                description = "You do not have create permission and need to authenticate first",
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
            @ApiResponse(responseCode = "404", description = "Derivate or access key does not exist",
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
        })
    @Produces(MediaType.APPLICATION_JSON)
    @MCRRestRequiredPermission(MCRRestAPIACLPermission.WRITE)
File Project Line
org\mycore\mcr\acl\accesskey\restapi\v2\MCRRestObjectAccessKeys.java MyCoRe ACL 71
org\mycore\mcr\acl\accesskey\restapi\v2\MCRRestObjectAccessKeys.java MyCoRe ACL 95
org\mycore\mcr\acl\accesskey\restapi\v2\MCRRestObjectAccessKeys.java MyCoRe ACL 171
array = @ArraySchema(schema = @Schema(implementation = MCRAccessKey.class))) }),
            @ApiResponse(responseCode = "" + MCRObjectIDParamConverterProvider.CODE_INVALID, // 400
                description = MCRObjectIDParamConverterProvider.MSG_INVALID,
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
            @ApiResponse(responseCode = "401",
                description = "You do not have create permission and need to authenticate first",
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
            @ApiResponse(responseCode = "404", description = "Object or access key does not exist",
                content = { @Content(mediaType = MediaType.APPLICATION_JSON) }),
        })
    @Produces(MediaType.APPLICATION_JSON)
    @MCRRestRequiredPermission(MCRRestAPIACLPermission.WRITE)
File Project Line
org\mycore\mods\access\facts\condition\MCRMODSCollectionCondition.java MyCoRe MODS 45
org\mycore\mods\access\facts\condition\MCRMODSEmbargoCondition.java MyCoRe MODS 40
org\mycore\mods\access\facts\condition\MCRMODSGenreCondition.java MyCoRe MODS 45
private String idFact = "objid";

    @Override
    public void parse(Element xml) {
        super.parse(xml);
        this.idFact = Optional.ofNullable(xml.getAttributeValue("idfact")).orElse("objid");
    }

    @Override
    public Optional<MCRStringFact> computeFact(MCRFactsHolder facts) {

        Optional<MCRObjectIDFact> idc = facts.require(idFact);
        if (idc.isPresent()) {
            Optional<MCRObject> optMCRObject = idc.get().getObject();
            if (optMCRObject.isPresent()) {
File Project Line
org\mycore\pi\handle\MCREpicService.java MyCoRe Persistent Identifier 104
org\mycore\pi\purl\MCRPURLService.java MyCoRe Persistent Identifier 130
MCRHandle identifier) {
        Date registrationStarted = null;
        if (getRegistrationPredicate().test(obj)) {
            registrationStarted = new Date();
            startRegisterJob(obj, identifier);
        }

        MCRPI databaseEntry = new MCRPI(identifier.asString(), getType(), obj.getId().toString(), additional,
            this.getServiceID(), provideRegisterDate(obj, additional), registrationStarted);
        MCREntityManagerProvider.getCurrentEntityManager().persist(databaseEntry);
        return databaseEntry;
    }

    @Override
    protected void registerIdentifier(MCRBase obj, String additional, MCRHandle pi)