public interface IEParser
extends com.exlibris.core.sdk.parser.CoreIEParser
Modifier and Type | Method and Description |
---|---|
void |
addBitStream(java.lang.String byteStreamId,
java.lang.String bitStreamId,
DnxDocument dnx)
Internal Method
|
gov.loc.mets.AmdSecType |
addBitStreamsSection(java.lang.String byteStreamId)
Internal Method
|
gov.loc.mets.FileType |
addNewFile(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp,
java.lang.String mimeType,
java.lang.String fileLocation,
java.lang.String label,
java.lang.String id,
DnxDocument dnx)
1.Function adds a new File section to the FileGrp
|
gov.loc.mets.FileType |
addNewFile(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp,
java.lang.String mimeType,
java.lang.String fileLocation,
java.lang.String label,
java.lang.String id,
java.lang.String groupId,
DnxDocument dnx)
1.Function adds a new File section to the FileGrp
|
gov.loc.mets.FileType |
addNewFile(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp,
java.lang.String mimeType,
java.lang.String fileLocation,
java.lang.String label,
java.lang.String id,
java.lang.String groupId,
DnxDocument dnx,
boolean isDCValid)
Internal Method
|
gov.loc.mets.FileType |
addNewFile(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp,
java.lang.String mimeType,
java.lang.String fileLocation,
java.lang.String label,
java.lang.String id,
java.lang.String groupId,
DnxDocument dnx,
boolean isDCValid,
boolean useRef,
java.lang.String idForRef)
Internal Method
|
gov.loc.mets.MetsType.FileSec.FileGrp |
addNewFileGrp(com.exlibris.core.sdk.consts.Enum.UsageType ut,
com.exlibris.core.sdk.consts.Enum.PreservationType pt,
java.lang.String pid,
DnxDocument dnx)
Deprecated.
|
gov.loc.mets.MetsType.FileSec.FileGrp |
addNewFileGrp(com.exlibris.core.sdk.consts.Enum.UsageType ut,
java.lang.String pt,
java.lang.String pid,
DnxDocument dnx)
1.Function adds a new FileGrp section to the IE XML and links it to the given DNX
|
gov.loc.mets.MetsType.FileSec.FileGrp |
addNewFileGrp(com.exlibris.core.sdk.consts.Enum.UsageType ut,
java.lang.String pt,
java.lang.String pid,
DnxDocument dnx,
boolean useRef,
java.lang.String idForRef)
1.Function adds a new FileGrp section to the IE XML and links it to the given DNX, with the possibility to only add a dummy mdref element.
|
gov.loc.mets.FileType |
addNewLimitedFile(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp,
java.lang.String mimeType,
long size,
java.lang.String id)
1.Function adds a new limited File section to the FileGrp (without the flocat section)
|
gov.loc.mets.FileType |
addNewLimitedFile(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp,
java.lang.String mimeType,
long size,
java.lang.String id,
java.lang.String fileLocation)
1.Function adds a new limited File section to the FileGrp (without the flocat section)
|
gov.loc.mets.StructMapType |
buildLogicalStructMap(java.lang.String fileGrpId,
java.util.Map<java.lang.String,com.exlibris.core.infra.common.shared.dataObjects.KeyValuePair<java.lang.String,java.lang.String>> files,
java.lang.String label) |
gov.loc.mets.StructMapType |
buildPhysicalStructMap(java.lang.String fileGrpId,
java.util.Map<java.lang.String,java.lang.String> files,
java.lang.String label)
Internal Method
|
gov.loc.mets.StructMapType |
buildStructMap(java.lang.String repId,
java.util.List<com.exlibris.digitool.repository.dataObjects.ExtendedFileWrapper> files,
java.lang.String label1,
java.lang.String label2,
java.lang.Boolean inAddition,
java.lang.Boolean forLogicalTemplate)
Internal Method
|
void |
createFileGrpDnx(DnxDocument dnx,
java.lang.String id)
Internal Method
|
void |
enrichExternalSM()
Internal Method
|
gov.loc.mets.DivType |
enrichFilesInStructMap(gov.loc.mets.DivType smDiv,
java.util.HashMap<java.lang.String,java.lang.String> fileLabelsMap)
Internal Method
|
void |
fixIdNaming()
1.The function updates the IDs of all file group and file sections according to the naming convention
2.The function updates AMD IDs with the updated IDs
3.The function creates a new structural map with the new IDs
|
void |
generateChecksum(java.lang.String filesRootFolder,
java.lang.String checksumType)
Function generates a checksum for all files in the IE and inserts it in the DNX
|
void |
generateStructMap(gov.loc.mets.MetsType.FileSec.FileGrp FileGrp,
java.lang.String label)
Function generates a structural map for every given representation, overwriting existing structural maps.
|
void |
generateStructMap(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp,
java.lang.String label1,
java.lang.String label2)
Function generates a structural map for every given representation, overwriting existing structural maps.
|
void |
generateStructMapFileGrp(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp,
java.lang.String label1,
java.lang.String label2,
boolean inAddition)
Function generates a structural map for given representation id.
|
gov.loc.mets.MdSecType[] |
getBitStreamSections(java.lang.String byteStreamId)
Internal Method
|
gov.loc.mets.AmdSecType |
getBitStreamsSection(java.lang.String byteStreamId)
Internal Method
|
java.lang.String |
getDefaultLabel(DnxDocument dnx)
Exporting Methods *
|
DnxDocument |
getDnxParser()
Function constructs a new DNX document
|
DnxDocument |
getFileDnx(java.lang.String id)
Function returns the DNX of the specified file
|
DnxDocument |
getFileGrpDnx(java.lang.String id)
Function returns the DNX of the specified FileGrp
|
java.lang.String |
getFileId(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp)
Internal Method
|
java.util.ArrayList<java.lang.String> |
getFilesArray(gov.loc.mets.StructMapType smType)
Internal Method
|
java.util.List<gov.loc.mets.DivType.Fptr> |
getFilesFromStructMap(gov.loc.mets.DivType smDiv)
Internal Method
|
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getFilesFromStructMapInfo(gov.loc.mets.DivType smDiv)
Internal Method
|
java.util.ArrayList<java.lang.String> |
getFilesPidArrayFromSM(int index,
java.lang.String grpId)
Internal Method
|
DnxDocument |
getIeDnx()
Function returns the DNX of the IE
|
java.lang.String |
getLabelFromStructMap(gov.loc.mets.DivType smDiv,
java.lang.String pid)
Internal Method
|
java.lang.String |
getLabelOfFileFromSM(int index,
java.lang.String grpId,
java.lang.String pid)
Internal Method
|
java.util.List<java.lang.String> |
getRepPidList()
Internal Method
|
void |
removeFileGrp(java.lang.String grpId)
Internal Method
|
gov.loc.mets.DivType |
removeFilesFromSM(gov.loc.mets.DivType smDiv,
java.util.List<java.lang.String> filesToRemovePID)
Internal Method
|
void |
setDublinCore(DublinCore dc,
java.lang.String id)
The function inserts a new DMD section of DC md type, in file level adds DMDID to the file.
|
void |
setFileDnx(DnxDocument dnx,
java.lang.String id)
Function inserts a new DNX section in the specified file and overwrites the current one.
|
void |
setFileDnx(DnxDocument dnx,
java.lang.String id,
boolean useRef,
java.lang.String idForRef)
Function inserts a new DNX section in the specified file and overwrites the current one, with the possibility to only add a dummy mdref element.
|
void |
setFileGrpDnx(DnxDocument dnx,
java.lang.String id)
Function inserts a new DNX section in the specified fileGrp and overwrites the current one.
|
void |
setFileGrpDnx(DnxDocument dnx,
java.lang.String id,
boolean useRef,
java.lang.String idForRef)
Function inserts a new DNX section in the specified fileGrp and overwrites the current one, with the possibility to only add a dummy mdref element.
|
void |
setIeDnx(DnxDocument dnx)
Function inserts a new DNX section in the IE and overwrites the current one.
|
void |
setIeSourceMd(gov.loc.mets.MdSecType.MdWrap.MDTYPE.Enum mdType,
org.apache.xmlbeans.XmlObject object)
Adds a new source MD for the amd section specified,should be added only after creating an amdSec section
|
void |
setIeSourceMd(gov.loc.mets.MdSecType.MdWrap.MDTYPE.Enum mdType,
org.apache.xmlbeans.XmlObject object,
java.lang.String otherMdType)
Adds a new source MD for the amd section specified,should be added only after creating an amdSec section
|
void |
setSourceMd(gov.loc.mets.MdSecType.MdWrap.MDTYPE.Enum mdType,
org.apache.xmlbeans.XmlObject xmlObject,
java.lang.String otherMdType,
java.lang.String id)
Adds a new source MD for the amd section specified,should be added only after creating an amdSec section
|
void |
setSourceMd(java.lang.String id,
gov.loc.mets.MdSecType.MdWrap.MDTYPE.Enum mdType,
org.apache.xmlbeans.XmlObject xmlObject)
Adds a new source MD for the amd section specified,should be added only after creating an amdSec section
|
void |
setSourceMd(java.lang.String id,
gov.loc.mets.MdSecType.MdWrap.MDTYPE.Enum mdType,
org.apache.xmlbeans.XmlObject xmlObject,
java.lang.String mid)
Adds a new source MD for the amd section specified,should be added only after creating an amdSec section
|
void |
updateSize(java.lang.String filesRootFolder)
Function inserts the size of all files in the DNX
|
addAdditionalStructMap, addNewFile, addNewFile, addNewFileGrp, addNewFileGrp, addNewStructMap, createNewAmdSec, export, generateGID, getAmdSecArray, getDMDDC, getDmdSecArray, getDnx, getDnx, getDublinCoreParser, getFile, getFileArray, getFileDmdId, getFileGrp, getFileGrpArray, getFileSec, getIeCMSDublinCore, getIeDublinCore, getIeSourceMDs, getIeSourceMDsArray, getSourceMDs, getStructMap, getStructMapArray, getStructMapById, getStructMapsByFileGrpId, removeFGStructMaps, removeFilesFromFG, removeStructMap, setDMDDC, setDnx, setDublinCore, setFileDnx, setFileGrpDnx, setIeCMSDublinCore, setIeCMSDublinCore, setIeDnx, setIEDublinCore, setIeSourceMd, setIeSourceMds, setSourceMd, setStructMap, setStructMap, toXML, toXML, toXML, validate, validate
DnxDocument getDnxParser()
@Deprecated gov.loc.mets.MetsType.FileSec.FileGrp addNewFileGrp(com.exlibris.core.sdk.consts.Enum.UsageType ut, com.exlibris.core.sdk.consts.Enum.PreservationType pt, java.lang.String pid, DnxDocument dnx) throws com.exlibris.core.sdk.parser.IEParserException
ut
- enum of valid usage typept
- enum of valid Preservation typepid
- representation PIDdnx
- the DNX of the representationcom.exlibris.core.sdk.parser.IEParserException
gov.loc.mets.MetsType.FileSec.FileGrp addNewFileGrp(com.exlibris.core.sdk.consts.Enum.UsageType ut, java.lang.String pt, java.lang.String pid, DnxDocument dnx) throws com.exlibris.core.sdk.parser.IEParserException
ut
- string of valid usage typept
- String of valid Preservation typepid
- representation PIDdnx
- the DNX of the representationcom.exlibris.core.sdk.parser.IEParserException
gov.loc.mets.MetsType.FileSec.FileGrp addNewFileGrp(com.exlibris.core.sdk.consts.Enum.UsageType ut, java.lang.String pt, java.lang.String pid, DnxDocument dnx, boolean useRef, java.lang.String idForRef) throws com.exlibris.core.sdk.parser.IEParserException
ut
- string of valid usage typept
- String of valid Preservation typepid
- representation PIDdnx
- the DNX of the representationuseRef
- 'true' if you want to add only a mdRef element, 'false' to add the full mdWrap elementidForRef
- the id of the new mdRef element, this is ignored if useRef is set to 'false'com.exlibris.core.sdk.parser.IEParserException
gov.loc.mets.FileType addNewLimitedFile(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp, java.lang.String mimeType, long size, java.lang.String id) throws com.exlibris.core.sdk.parser.IEParserException
fileGrp
- that the file section should be added tomimeType
- of the filesize
- of fileid
- of the filecom.exlibris.core.sdk.parser.IEParserException
gov.loc.mets.FileType addNewLimitedFile(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp, java.lang.String mimeType, long size, java.lang.String id, java.lang.String fileLocation) throws com.exlibris.core.sdk.parser.IEParserException
fileGrp
- that the file section should be added tomimeType
- of the filesize
- of fileid
- of the filefileLocation
- - the FLocat parametercom.exlibris.core.sdk.parser.IEParserException
gov.loc.mets.FileType addNewFile(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp, java.lang.String mimeType, java.lang.String fileLocation, java.lang.String label, java.lang.String id, DnxDocument dnx) throws com.exlibris.core.sdk.parser.IEParserException
fileGrp
- that the file section should be added tomimeType
- of the filefileLocation
- label
- of the filepid
- file PIDdnx
- the DNX of the filecom.exlibris.core.sdk.parser.IEParserException
gov.loc.mets.FileType addNewFile(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp, java.lang.String mimeType, java.lang.String fileLocation, java.lang.String label, java.lang.String id, java.lang.String groupId, DnxDocument dnx) throws com.exlibris.core.sdk.parser.IEParserException
fileGrp
- that the file section should be added tomimeType
- of the filefileLocation
- label
- of the filepid
- file PIDgroupId
- dnx
- the DNX of the filecom.exlibris.core.sdk.parser.IEParserException
DnxDocument getIeDnx() throws com.exlibris.core.sdk.parser.IEParserException
com.exlibris.core.sdk.parser.IEParserException
DnxDocument getFileGrpDnx(java.lang.String id) throws com.exlibris.core.sdk.parser.IEParserException
id
- com.exlibris.core.sdk.parser.IEParserException
DnxDocument getFileDnx(java.lang.String id) throws com.exlibris.core.sdk.parser.IEParserException
id
- com.exlibris.core.sdk.parser.IEParserException
void setIeDnx(DnxDocument dnx) throws com.exlibris.core.sdk.parser.IEParserException
dnx
- com.exlibris.core.sdk.parser.IEParserException
void setFileGrpDnx(DnxDocument dnx, java.lang.String id) throws com.exlibris.core.sdk.parser.IEParserException
dnx
- id
- of the FileGrpcom.exlibris.core.sdk.parser.IEParserException
void setFileGrpDnx(DnxDocument dnx, java.lang.String id, boolean useRef, java.lang.String idForRef) throws com.exlibris.core.sdk.parser.IEParserException
dnx
- id
- of the FileGrpuseRef
- 'true' if you want to add only a mdRef element, 'false' to add the full mdWrap elementidForRef
- the id of the new mdRef element, this is ignored if useRef is set to 'false'com.exlibris.core.sdk.parser.IEParserException
void setFileDnx(DnxDocument dnx, java.lang.String id) throws com.exlibris.core.sdk.parser.IEParserException
dnx
- id
- of the Filecom.exlibris.core.sdk.parser.IEParserException
void setFileDnx(DnxDocument dnx, java.lang.String id, boolean useRef, java.lang.String idForRef) throws com.exlibris.core.sdk.parser.IEParserException
dnx
- id
- of the FileuseRef
- 'true' if you want to add only a mdRef element, 'false' to add the full mdWrap elementidForRef
- the id of the new mdRef element, this is ignored if useRef is set to 'false'com.exlibris.core.sdk.parser.IEParserException
void setDublinCore(DublinCore dc, java.lang.String id) throws com.exlibris.core.sdk.parser.IEParserException
dc
- Dublin Coreid
- com.exlibris.core.sdk.parser.IEParserException
void generateChecksum(java.lang.String filesRootFolder, java.lang.String checksumType) throws com.exlibris.core.sdk.parser.IEParserException
filesRootFolder
- the root folder in which the files are placedchecksumType
- (MD5,CRC32,SHA1 etc.)com.exlibris.core.sdk.parser.IEParserException
void updateSize(java.lang.String filesRootFolder) throws com.exlibris.core.sdk.parser.IEParserException
filesRootFolder
- the root folder in which the files are placedcom.exlibris.core.sdk.parser.IEParserException
void generateStructMap(gov.loc.mets.MetsType.FileSec.FileGrp FileGrp, java.lang.String label) throws com.exlibris.core.sdk.parser.IEParserException
FileGrp
- the file group for which the structural map should be generated.
'Null' will generate for all structural maps.label
- If the generation is for all representations, this is the label for all representations
and if it is for a specific file group, this is the file group's labelcom.exlibris.core.sdk.parser.IEParserException
void generateStructMap(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp, java.lang.String label1, java.lang.String label2) throws com.exlibris.core.sdk.parser.IEParserException
FileGrp
- the file group for which the structural map should be generated
'Null' will generate for all structural maps.label1
- If the generation is for all representations, this is the label for all representations
and if it is for a specific file group, this is the file group's labellabel2
- If the generation is for all representations, this is the label in the inside div for all representations
and if it is for a specific file group, this is the file group's label in the inside divcom.exlibris.core.sdk.parser.IEParserException
void generateStructMapFileGrp(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp, java.lang.String label1, java.lang.String label2, boolean inAddition) throws com.exlibris.core.sdk.parser.IEParserException
FileGrp
- the file group for which the structural map should be generated
'Null' will generate for all structural maps.label1
- If the generation is for all representations, this is the label for all representations
and if it is for a specific file group, this is the file group's labellabel2
- If the generation is for all representations, this is the label in the inside div for all representations
and if it is for a specific file group, this is the file group's label in the inside divinAddition
- if True a additional structural map is added, if False overwrites current structural mapcom.exlibris.core.sdk.parser.IEParserException
void fixIdNaming() throws com.exlibris.core.sdk.parser.IEParserException
com.exlibris.core.sdk.parser.IEParserException
java.lang.String getDefaultLabel(DnxDocument dnx)
gov.loc.mets.AmdSecType addBitStreamsSection(java.lang.String byteStreamId)
void addBitStream(java.lang.String byteStreamId, java.lang.String bitStreamId, DnxDocument dnx) throws com.exlibris.core.sdk.parser.IEParserException
com.exlibris.core.sdk.parser.IEParserException
gov.loc.mets.AmdSecType getBitStreamsSection(java.lang.String byteStreamId) throws com.exlibris.core.sdk.parser.IEParserException
com.exlibris.core.sdk.parser.IEParserException
gov.loc.mets.MdSecType[] getBitStreamSections(java.lang.String byteStreamId) throws com.exlibris.core.sdk.parser.IEParserException
com.exlibris.core.sdk.parser.IEParserException
void enrichExternalSM()
java.util.ArrayList<java.lang.String> getFilesArray(gov.loc.mets.StructMapType smType)
java.util.List<gov.loc.mets.DivType.Fptr> getFilesFromStructMap(gov.loc.mets.DivType smDiv)
java.util.List<java.util.Map<java.lang.String,java.lang.String>> getFilesFromStructMapInfo(gov.loc.mets.DivType smDiv)
gov.loc.mets.StructMapType buildStructMap(java.lang.String repId, java.util.List<com.exlibris.digitool.repository.dataObjects.ExtendedFileWrapper> files, java.lang.String label1, java.lang.String label2, java.lang.Boolean inAddition, java.lang.Boolean forLogicalTemplate) throws com.exlibris.core.sdk.parser.IEParserException
com.exlibris.core.sdk.parser.IEParserException
gov.loc.mets.DivType enrichFilesInStructMap(gov.loc.mets.DivType smDiv, java.util.HashMap<java.lang.String,java.lang.String> fileLabelsMap)
gov.loc.mets.DivType removeFilesFromSM(gov.loc.mets.DivType smDiv, java.util.List<java.lang.String> filesToRemovePID)
java.util.List<java.lang.String> getRepPidList()
java.util.ArrayList<java.lang.String> getFilesPidArrayFromSM(int index, java.lang.String grpId)
java.lang.String getLabelFromStructMap(gov.loc.mets.DivType smDiv, java.lang.String pid)
java.lang.String getLabelOfFileFromSM(int index, java.lang.String grpId, java.lang.String pid)
void removeFileGrp(java.lang.String grpId) throws com.exlibris.core.sdk.parser.IEParserException
com.exlibris.core.sdk.parser.IEParserException
gov.loc.mets.FileType addNewFile(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp, java.lang.String mimeType, java.lang.String fileLocation, java.lang.String label, java.lang.String id, java.lang.String groupId, DnxDocument dnx, boolean isDCValid) throws com.exlibris.core.sdk.parser.IEParserException
com.exlibris.core.sdk.parser.IEParserException
gov.loc.mets.FileType addNewFile(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp, java.lang.String mimeType, java.lang.String fileLocation, java.lang.String label, java.lang.String id, java.lang.String groupId, DnxDocument dnx, boolean isDCValid, boolean useRef, java.lang.String idForRef) throws com.exlibris.core.sdk.parser.IEParserException
com.exlibris.core.sdk.parser.IEParserException
java.lang.String getFileId(gov.loc.mets.MetsType.FileSec.FileGrp fileGrp)
gov.loc.mets.StructMapType buildPhysicalStructMap(java.lang.String fileGrpId, java.util.Map<java.lang.String,java.lang.String> files, java.lang.String label) throws com.exlibris.core.sdk.parser.IEParserException
fileGrpId
- - the file group id for which the logical structural map should be generatedfiles
- - Map of label
- - the generated Structmap labeljava.lang.Exception
com.exlibris.core.sdk.parser.IEParserException
gov.loc.mets.StructMapType buildLogicalStructMap(java.lang.String fileGrpId, java.util.Map<java.lang.String,com.exlibris.core.infra.common.shared.dataObjects.KeyValuePair<java.lang.String,java.lang.String>> files, java.lang.String label) throws java.lang.Exception
fileGrpId
- - the file group id for which the logical structural map should be generatedfiles
- - Map of label
- - the generated Structmap labeljava.lang.Exception
void createFileGrpDnx(DnxDocument dnx, java.lang.String id) throws com.exlibris.core.sdk.parser.IEParserException
com.exlibris.core.sdk.parser.IEParserException
void setSourceMd(java.lang.String id, gov.loc.mets.MdSecType.MdWrap.MDTYPE.Enum mdType, org.apache.xmlbeans.XmlObject xmlObject)
id
- - the id of the amd sectionmdType
- - the type of mdxmlObject
- - the xml content to add, this is ignored if useRef is set to 'true'void setSourceMd(java.lang.String id, gov.loc.mets.MdSecType.MdWrap.MDTYPE.Enum mdType, org.apache.xmlbeans.XmlObject xmlObject, java.lang.String mid)
id
- - the id of the amd sectionmdType
- - the type of mdxmlObject
- - the xml content to add, this is ignored if useRef is set to 'true'mid
- - the mid of the metadatavoid setSourceMd(gov.loc.mets.MdSecType.MdWrap.MDTYPE.Enum mdType, org.apache.xmlbeans.XmlObject xmlObject, java.lang.String otherMdType, java.lang.String id)
mdType
- - the type of mdxmlObject
- - the xml content to add, this is ignored if useRef is set to 'true'otherMdType
- - the otherMdType of mdid
- - amdId the id of the amd sectionvoid setIeSourceMd(gov.loc.mets.MdSecType.MdWrap.MDTYPE.Enum mdType, org.apache.xmlbeans.XmlObject object, java.lang.String otherMdType)
mdType
- - the type of mdobject
- - the xml content to add, this is ignored if useRef is set to 'true'otherMdType
- - the otherMdType of mdvoid setIeSourceMd(gov.loc.mets.MdSecType.MdWrap.MDTYPE.Enum mdType, org.apache.xmlbeans.XmlObject object)
mdType
- - the type of mdobject
- - the xml content to add, this is ignored if useRef is set to 'true'