As always there is many ways to solve getting data.
In this case where you are looking to use a Content Node as the Config for your Property Editor, I would suggest using a Repository.
Repositories are the new Resources, a class you can spin up to make requests to the Management API.
In this case you need to use the UmbDocumentDetailRepository
which comes with the method requestByUnique
, so you need the unique(aka. ID) of the Document you like to retrieve.
So your code would look like this:
export default class MyPropertyEditor extends UmbElementMixin(LitElement) implements UmbPropertyEditorUiElement{
@property({type: String})
public value = "";
#documentRepository = new UmbDocumentDetailRepository(this);
connectedCallback() {
super.connectedCallback();
this.#fetchDocumentData();
}
async #fetchDocumentData() {
const unique = "cec1f44e-30fd-4367-818c-03642e7d68db";
const {data} = await this.#documentRepository.requestByUnique(unique);
console.log("data: ", data);
}
}
That was the simplest way, but I would recommend doing it this way, to support if the Document changes while the Property Editor is display on screen. Because above would only get the data when the Property Editors is appended to the DOM. The following example would also update if the document is edited while it is displayed.
export default class MyPropertyEditor extends UmbElementMixin(LitElement) implements UmbPropertyEditorUiElement{
@property({type: String})
public value = "";
#documentRepository = new UmbDocumentDetailRepository(this);
connectedCallback() {
super.connectedCallback();
this.#fetchDocumentData();
}
async #fetchDocumentData() {
const unique = "cec1f44e-30fd-4367-818c-03642e7d68db";
const { asObservable } = await this.#repository.requestByUnique(unique);
this.observe(
asObservable(),
(data) => {
console.log("data: ", data);
},
'myUniqueControllerAliasForThisObservation',
);
}
}
Maybe not relevant in this case, but this is how entries in a Picker stays up to date, when a user corrects the data via infinite editors. And in the future, via Signal-R.
I hope that helps move forward, good luck 