High priority Autosave 3djs

This topic has been viewed 7238 times and has 10 replies
Thread status: Active
Questions about extending features and developing plug-ins [img]http://www.sweethome3d.com/images/flags/en_small.gif[/img]
kingoftailor
Posts: 21
Joined: Wed Jan 13, 2016 2:28 pm

Autosave 3djs

Post by kingoftailor »

Hello Emmanuel, Renaud,

I tried to set it to automatically save changes to the file when editing an empty sh3d file, but it returns an error 500.


I have added the following to the currently working planner:

var application = new SweetHome3DJSApplication(
{
readHomeURL: urlBase + "readHome.jsp?home=%s",
writeHomeEditsURL: urlBase + "writeHomeEdits.jsp",
closeHomeURL: urlBase + "closeEditedHome.jsp?id=%s",

furnitureCatalogURLs: [urlBase + "lib/resources/DefaultFurnitureCatalog.json"],
furnitureResourcesURLBase: urlBase,
texturesCatalogURLs: [urlBase + "/lib/resources/DefaultTexturesCatalog.json"],
texturesResourcesURLBase: urlBase,
userLanguage: "hu",
autoWriteDelay: 2000,
autoWriteTrackedStateChange: true,

});

What else should be set up for autosave to work?

Thanks, Gábor
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Autosave 3djs

Post by Puybaret »

Errors 500 should generate some logs on server side. Did you check them?
Emmanuel Puybaret, Sweet Home 3D creator
kingoftailor
Posts: 21
Joined: Wed Jan 13, 2016 2:28 pm

Re: Autosave 3djs

Post by kingoftailor »

I resolved the problem.

Lack of write permission to folder caused the error.

I have only one problem. I can not able to delete the sh3d files from the apache homes folder.

I have got exception:
System.UnauthorizedAccessException: Access to the path 'xxxx.sh3d' is denied.

I don't think the apache server will allow deleting. All rights are granted to the iis user. Copying (creating) and modifying also works well.

Is there a method available in javascript to delete this file?
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Autosave 3djs

Post by Puybaret »

There's no JavaScript method to delete a file in client file system, and even more dangerous, on a remote server file system.
Emmanuel Puybaret, Sweet Home 3D creator
User avatar
Daniels118
Posts: 503
Joined: Wed Nov 17, 2021 9:04 pm
Country: Italy

Re: Autosave 3djs

Post by Daniels118 »

Maybe you still have wrong permissions, please post the output of 'ls -la'
on that directory and 'id httpd' (or whatever your apache user is).
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Autosave 3djs

Post by Puybaret »

It would be nice to post the solution once you resolved your issue.
This forum isn’t here just to ask for help, but also to share solutions.
Emmanuel Puybaret, Sweet Home 3D creator
adizanni
Posts: 20
Joined: Tue Feb 06, 2024 9:54 pm
Country: France

Re: Autosave 3djs

Post by adizanni »

Hello all,
I'm also stuck on the delete topic.
I've encapsulated the jsp solution into a local web solution (very much like the online version of SH3D. I managed to have all use case covered (edit, new, etc) except the delete. No significant log messages are raised in the Catalina logs.
Please help.
User avatar
Puybaret
Posts: 9440
Joined: Mon Nov 07, 2005 12:00 pm
Country: Paris, France
Contact:

Re: Autosave 3djs

Post by Puybaret »

Do you mean that the method [font=courier new]delete[/font] of [font=courier new]java.io.File[/font] did not work? If yes, check the permissions on the SH3D files you manage on the server and maybe on the folder where you store them.

By the way, it would be nice to explain what you try to achieve.
Emmanuel Puybaret, Sweet Home 3D creator
adizanni
Posts: 20
Joined: Tue Feb 06, 2024 9:54 pm
Country: France

Re: Autosave 3djs

Post by adizanni »

Hello thanks Emmanuel for the rapid answer,

Yes using the delete of java.io.File. I'm currently working in Eclipse on Windows and deploy Tomcat as a Target runtime, not clear which permission I have to look into. The properties of the Homes folder inside WebApp give only the possibility to set or unset "ReadOnly" and it is unset (I can create and edit existing files).

What I'm trying to do:

I'm the developer of this card : https://github.com/adizanni/floor3d-card in Home Assistant (home automation software), I'm trying to build a Home Assistant add-on to encapsulate SweetHome3D inside the Home Assistant frontend and also migrate my existing SweetHome3D plugin: https://github.com/adizanni/ExportToHASS to JSP.

By the way, I'm a big fan of your work....

Thanks in advance for the support.

Andrea
adizanni
Posts: 20
Joined: Tue Feb 06, 2024 9:54 pm
Country: France

Re: Autosave 3djs

Post by adizanni »

Hello, sorry if I made you lose time, but I discovered a bug in the JSP, now it is working as expected. Hope you did not lose time to look into it.
Post Reply New Topic

Who is online

Users browsing this forum: No registered users and 1 guest