Search the FirstSpirit Knowledge Base
Hi,
I want to know the the reference name of all templates and directoryes of a given project. i use the function to get the reference name getReferenceName().
My problem in few templates and directory reference name its showing Null . What i understand if we create any template or directory in first spirit each having one reference name.
if i use the function getUid() to get the reference name its shows the error UnsupportedOperationException in some cases given below.
// Error: // Uncaught Exception: Method Invocation e.getUid : at Line: 1 : in file: <unknown file> : e .getUid ( )
Target exception: java.lang.UnsupportedOperationException: de.espirit.firstspirit.store.access.templatestore.ScriptFolderImpl.getUidAttribute(): unique identifier not supported!
bsh % java.lang.UnsupportedOperationException: de.espirit.firstspirit.store.access.templatestore.ScriptFolderImpl.getUidAttribute(): unique identifier not supported!
at de.espirit.firstspirit.store.access.DefaultStoreElement.getUidAttribute(DefaultStoreElement.java:1487)
at de.espirit.firstspirit.store.access.DefaultStoreElement.getUid(DefaultStoreElement.java:1407)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at bsh.Reflect.invokeMethod(Unknown Source)
at bsh.Reflect.invokeObjectMethod(Unknown Source)
at bsh.Name.invokeMethod(Unknown Source)
at bsh.BSHMethodInvocation.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.Interpreter.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
so please assist me why its showing reference name "null" in few cases. and how i can get the reference
name in these cases.
Thanks & Regards
Saurabh
Hello Saurabh,
it is not possible to reference a script folder and that is - as far as I know - why they don't support unique identifer. Also the descibtions of the methods say the following:
getUid:
Returns the unique identifier of this IDProvider if it has a unique identifier otherwise throws an UnsupportedOperationException!
getReferenceName:
Returns:the refernce text, e.g. used for $CMS_REF(..)$ expressions, or null if this element supports no referencing
That is exactly the behaviour you describe in your posting.
Best regards
Michaela
Hello Saurabh,
it is not possible to reference a script folder and that is - as far as I know - why they don't support unique identifer. Also the descibtions of the methods say the following:
getUid:
Returns the unique identifier of this IDProvider if it has a unique identifier otherwise throws an UnsupportedOperationException!
getReferenceName:
Returns:the refernce text, e.g. used for $CMS_REF(..)$ expressions, or null if this element supports no referencing
That is exactly the behaviour you describe in your posting.
Best regards
Michaela