How to retrieve a project layout information?

Hi Datagrok community,

I have a project that no longer opens properly, and I’m looking for a way to recover it.

Currently, my understanding is that layout information can only be retrieved after opening a project using project.open(), and then calling view.saveLayout() and layout.toJson() on the views.

However, since my project fails to open, I’m unable to use this approach.

Is there any way to retrieve layout information from a project without opening it? Also, I would like to know how to extract “scripts” for the project.

Any advice or workaround would be greatly appreciated.
Best regards,

Kosuke

1 Like

Hi Kosuke!

I don’t think it’s easy getting the layouts from the project - they are not actually stored as layout, but rather as a ViewInfo - we can get it from the project when saving it as a ZIP, and then try creating a proper alyout from it.

I think that in this case, it’s much better to try making the project open. In 1.27 (which is coming pretty soon), we added the capability to edit project creation scripts, which will allow us to locate the actual issue of what went wrong.

Is it okay for you to wait till 1.27 and try editing the projects when the version comes, or do you want to try to make the project work now (will be harder, but you can still get the project programmatically and try to edit its metaParams (which includes the table creation scripts)?

Kind regards,
Dmytro

1 Like

Hi Dmytro,

Thank you for looking into this and for the clear explanation — it all makes sense to me now.

Fortunately, this is not an urgent matter, so I’m happy to wait for version 1.27. In fact, the ability to edit project creation scripts is very much appreciated. There have been times in the past where I had to rebuild a project from scratch when it suddenly became unable to open, so being able to fix script errors directly will definitely improve the usability of the tool.

With that said, there is no immediate need to get the broken project working right now, so I will look forward to the release of version 1.27!

Kind regards,
Kosuke

2 Likes