saurabh
I'm new here

Why few templates and directory reference name showing "null" ....

Jump to solution

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

0 Kudos
1 Solution

Accepted Solutions
MichaelaReydt
Community Manager

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

View solution in original post

0 Kudos
1 Reply
MichaelaReydt
Community Manager

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

0 Kudos