forked from kitodo/kitodo-production
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into focus-new-metadata-fields-in-metadata-edit…
…or-fixes-5929
- Loading branch information
Showing
18 changed files
with
961 additions
and
208 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
Kitodo/src/main/java/org/kitodo/production/forms/dataeditor/ExternalView.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,40 @@ | ||
/* | ||
* (c) Kitodo. Key to digital objects e. V. <contact@kitodo.org> | ||
* | ||
* This file is part of the Kitodo project. | ||
* | ||
* It is licensed under GNU General Public License version 3 or later. | ||
* | ||
* For the full copyright and license information, please read the | ||
* GPL3-License.txt file that was distributed with this source code. | ||
*/ | ||
|
||
package org.kitodo.production.forms.dataeditor; | ||
|
||
import java.util.Objects; | ||
|
||
import javax.enterprise.context.RequestScoped; | ||
import javax.inject.Named; | ||
|
||
/** | ||
* Bean that is used in externalView.xhtml. | ||
*/ | ||
@Named("ExternalView") | ||
@RequestScoped | ||
public class ExternalView { | ||
|
||
/** | ||
* Return the shortened ID of the media by removing leading zeros. | ||
* | ||
* @param id the long id of the media file as string | ||
* @return the shortened id of the media file | ||
*/ | ||
public static String convertToShortId(String id) { | ||
if (Objects.nonNull(id)) { | ||
return id.replaceFirst("^0+(?!$)", ""); | ||
} else { | ||
return "-"; | ||
} | ||
} | ||
|
||
} |
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
Oops, something went wrong.