-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://git.smc.it/openk9/openk9 into 569-doc-…
…type-sub-field
- Loading branch information
Showing
69 changed files
with
3,044 additions
and
847 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
core/app/datasource/src/main/java/io/openk9/datasource/model/util/DocTypeFieldUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.openk9.datasource.model.util; | ||
|
||
import io.openk9.datasource.model.DocType; | ||
import io.openk9.datasource.model.DocTypeField; | ||
|
||
public class DocTypeFieldUtils { | ||
|
||
public static String fieldPath(DocTypeField docTypeField) { | ||
DocType docType = docTypeField.getDocType(); | ||
return fieldPath(docType != null ? docType.getName() : null, docTypeField); | ||
} | ||
|
||
public static String fieldPath(String docTypeName, DocTypeField docTypeField) { | ||
|
||
String rootPath = | ||
docTypeName != null && !docTypeName.equals("default") ? docTypeName + "." : ""; | ||
|
||
DocTypeField parent = docTypeField.getParentDocTypeField(); | ||
|
||
String fieldName = docTypeField.getFieldName(); | ||
|
||
return parent != null ? fieldPath(parent) + "." + fieldName : rootPath + fieldName; | ||
} | ||
} |
Oops, something went wrong.