[IMPLEMENTED] Custom editor requires user


#1

Hi Sebastian,

I have created/integrated a Cloudinary Media Widget to allow browsing media assets from this DAM system. I am able to retrieve image responses (JSON) from the DAM indicating a single image (or multiple images).

Accessing the DAM via the widget requires a handshake of user credentials/api key. etc. I have hardcoded a this for my initial tests, however, I would user email address of the current Squidex user.

Is there any method to retrieve the current logged-in Squidex user account (name, email address) in a custom editor? Is this part of the API?

What I would like to know if there is a way to have have a custom editor perform some Squidex operations
before displaying inline with the form. I.e. server-side processing accessing Squidex APIs?
i.e.

  1. retrieve user account details - email (important)
  2. generate UNIX timestamp of the current time
  3. construct a signature string of Cloudinary details (api key/secret, email, unixtimesamp etc).
  4. generate a sha256 hash string of above params
  5. make this value available to the clientside / jquery logic?

Would we need to build the Squidex binaries from source to accomplish this?

Thanks,
Wesley.


#2

Hi,

It is not part of the API yet, but can be added. As usual: PRs are welcome

  1. It is not part of the API yet, but of course it can be added.
  2. new Date().getTime()?
  3. If you are okay with storing it in the jscript then it works already, but we could also use the ui settings system to forward everything that is stored there.
  4. Can be solved with pure javascript
  5. Can also be solved with pure javascript.

#3

Hi, I pushed an update that provides a context variable for the editor: https://github.com/Squidex/squidex/blob/master/src/Squidex/wwwroot/scripts/context-editor.html


#4

Thanks - Sorry for the tardy response, but I will test this out. I am eager to see this in action.

By the way, if I want to control the dimensions (namely, the height) of the custom editor field. How do I force the field to be long/taller than the default from the Iframe’s HTML document?


#5

Hi, the height is controlled by the editor itself. You can see here in the SDK that the iframe notifies the parent about the actual height every 500ms: https://github.com/Squidex/squidex/blob/master/src/Squidex/wwwroot/scripts/editor-sdk.js#L72

So you can just use css or javascript or whatever you want.


#6

Thanks Sebastian. I will pass this detail onto a resource digging into some custom editor development work.

There is an idea to develop our custom widget in Angular 7. I suspect we can host it on another web server instance.

A far-reaching question would be to create an angular-based custom/editor but have it piggyback/server from the same server where Squidex is deployed.