Skip to content

Commit

Permalink
Implement change requests regarding JavaDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
solth committed Nov 12, 2024
1 parent 4db8996 commit c947be2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ public String getSelectedField() {
/**
* Set selectedField.
*
* @param field as java.lang.String
* @param field as String
*/
public void setSelectedField(String field) {
this.selectedField = field;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ public CreateProcessForm() {
this.priorityList = priorityList;
}

/**
* Calculate number of EAD elements of selected level (e.g. "item", "file" etc.) from "xmlString", containing
* content of currently imported XML file.
*
* @throws XMLStreamException when retrieving EAD from XML data fails
*/
public void calculateNumberOfEadElements() throws XMLStreamException {
numberOfEadElements = XMLUtils.getNumberOfElements(xmlString, selectedEadLevel);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public class LazyHitModel extends LazyDataModel<Object> {
private SearchResult searchResult = null;

/**
* Empty default constructor. Sets default catalog and search field, if configured.
* Constructor setting this LazyHitModels 'CatalogImportDialog'.
*
* @param dialog as CatalogImportDialog
*/
public LazyHitModel(CatalogImportDialog dialog) {
this.catalogImportDialog = dialog;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,14 @@ public String getParentID(Document document, String higherLevelIdentifier, Strin

/**
* Creates a temporary Process from the given document with templateID und projectID.
* @param importConfiguration ImportConfiguration used to create TempProcess
* @param document the given document
* @param templateID the template to use
* @param projectID the project to use
* @return a temporary process
* @throws ProcessGenerationException when creating process for given template and project fails
* @throws IOException when loading workpiece of TempProcess or retrieving type of document fails
* @throws TransformerException when loading workpiece of TempProcess fails
*/
public TempProcess createTempProcessFromDocument(ImportConfiguration importConfiguration, Document document,
int templateID, int projectID)
Expand Down Expand Up @@ -612,6 +616,10 @@ private void importParents(String recordId, ImportConfiguration importConfigurat

/**
* Check if there already is a parent process in Database.
*
* @param parentID ID of parent process to retrieve
* @param ruleset ruleset of parent process to retrieve
* @param projectID ID of project to which parent process must belong
*/
public void checkForParent(String parentID, Ruleset ruleset, int projectID) {
this.parentTempProcess = retrieveParentTempProcess(parentID, ruleset, projectID);
Expand Down Expand Up @@ -835,6 +843,15 @@ private List<Element> getEADElements(Document document, String level) {
StringConstants.LEVEL, level);
}

/**
* Check and return whether maximum number of tags with given tag name 'tagName' in XML with content given as
* 'xmlString' exceeds limit configured as maxNumberOfProcessesForImportMask in kitodo_config.properties.
*
* @param xmlString String representation of XML content to check
* @param tagName name of XML tag counted in XML content
* @return whether the number of tags exceeds the allowed limit
* @throws XMLStreamException when retrieving number of tags in XML content fails
*/
public boolean isMaxNumberOfRecordsExceeded(String xmlString, String tagName) throws XMLStreamException {
int numberOfRecords = XMLUtils.getNumberOfElements(xmlString, tagName);
return numberOfRecords > ConfigCore.getIntParameterOrDefaultValue(ParameterCore.MAX_NUMBER_OF_PROCESSES_FOR_IMPORT_MASK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public void run() {
}

private void cleanUpProcesses(List<Integer> processIds, int newParentId) {
logger.error("Deleting processes created until this point to resolve erroneous intermediate state.");
logger.info("Deleting processes created until this point to resolve erroneous intermediate state.");
// cleanup any processes that might have been created until this point
for (int id : processIds) {
try {
Expand Down

0 comments on commit c947be2

Please sign in to comment.