Page 1 of 1

Fill ImagevueX Site automatic via Script

Posted: 23 Jan 2017, 05:53
by pleibling
Hi,

i use my Images in Lightroom. Lightroom access to my Imagefolder on my Fileserver.

Now i want to "autofill" Imagevuex, for this i want to sync my Images from my Fileserver direct via FTP Script on my Webserver, this is my external Gallery and too my second external Backup.

I have an folder 01.Protected under content, this is Protected via Password - this has to been synced in future.

But for this i have some questions:

1) For the order there needs every folder a Foldernumber (3 Signs) - is it possible to change it to 6 Signs? Cause i have for every Shootingfolder the Date like this "101224 Christmas", i want to Change it to "101224.Christmas" - for this the Date is not shown and its directly the Ordernumber. Is this possible?

2) If i copy my images via FTP Script, are the folders directly visible and automatically in the Menu? Or have i add them manually?

Thanks a lot for your help.

Re: Fill ImagevueX Site automatic via Script

Posted: 23 Jan 2017, 23:15
by mjau-mjau
pleibling wrote:1) For the order there needs every folder a Foldernumber (3 Signs) - is it possible to change it to 6 Signs? Cause i have for every Shootingfolder the Date like this "101224 Christmas", i want to Change it to "101224.Christmas" - for this the Date is not shown and its directly the Ordernumber. Is this possible?
I believe that should work, yes.
pleibling wrote:2) If i copy my images via FTP Script, are the folders directly visible and automatically in the Menu? Or have i add them manually?
Basically yes, but there are a few things you need to know:

A - All content folders in X3 need to have an empty file page.json inside to be considered a valid page. You could solve this be either 1) Clicking through new folders from the X3 panel (after FTP sync), in which case the page.json file will be created if it doesn't exist. Or 2) Somehow include an empty page.json file in your FTP script.

* The page.json file is used to store X3 settings for each page.

B - By default, X3 has a "Refresh Menu" setting in panel https://d.pr/i/P7xf, which you need to click after adding new folders by FTP. Optionally, you can disable this feature entirely from settings https://d.pr/i/kNtO.

C - X3 uses a page-cache invalidation method, which is managed automatically when using the panel. If you are using the FTP to sync folders, you will need to manually invalidate the cache by going to [yourwebsite]/panel/touch.php from browser (* requires you to be logged in to panel).

Re: Fill ImagevueX Site automatic via Script

Posted: 24 Jan 2017, 02:46
by pleibling
Ok, thats sounds very good. So i copy via FTP, log on the Panel and open the complete Folder structure in the Panel, after then i call xx/panel/touch.php .

Sounds good.

Re: Fill ImagevueX Site automatic via Script

Posted: 24 Jan 2017, 07:24
by pleibling
Ok, Filetransfer via FTP Batch works well with CyberKiko FTPSync.

Is it possible to automate recreating Folderstructure and running touch.php?

e.G. for touch.php: wget http://user:password@xxx/panel/touch.php?

Is there an link for the "refresh Button", so that i can start it via wget solution?

Thanks for your help.

Re: Fill ImagevueX Site automatic via Script

Posted: 24 Jan 2017, 11:19
by mjau-mjau
pleibling wrote:Is it possible to automate recreating Folderstructure and running touch.php?
There is another option: Create an empty txt file /config/touch.txt. Every time you run your FTP script, update this file (either by overwriting it, or deleting+recreating it, or writing some random content into it). Every time the server-date of this file changes, it will force X3 pages to get refreshed when viewed.

The reason we use the "touch" mechanism, is to validate page cache, and make sure cached pages get served FAST. If we disable this mechanism, every page request would require looping through all your content to see if anything changed, before outputting the cached page.
pleibling wrote:Is there an link for the "refresh Button", so that i can start it via wget solution?
I would recommend you disable this option in settings->settings, so you don't have to deal with it.

When this setting is disabled, the first page-view after running your FTP-script, will be a bit slow, because X3 creates the new MENU cache fragment. Once it is cached (from any page), it will load fast for all other pages anyway (even if the page itself isn't cached yet). This would only become a problem if you have a massive amount of folders and/or a very slow server.

Re: Fill ImagevueX Site automatic via Script

Posted: 27 Jan 2017, 09:45
by pleibling
Ok, click "Refresh Page" Button is the best Solution for me, cause i need only the folrderstructure refreshed - refreshed everything is not good, cause i use the Original Photos, they have between 5 and 10 MB every Photo. So it is better, that the Photos are cached - so i think the "Touch" Option is not good for my scenario.

Is it posible to "automate" or script the click in the Batchfile (e.g. wget  http://user:password@xxx/panel/refresh.php)?

Re: Fill ImagevueX Site automatic via Script

Posted: 27 Jan 2017, 09:55
by mjau-mjau
pleibling wrote:Ok, click "Refresh Page" Button is the best Solution for me, cause i need only the folrderstructure refreshed - refreshed everything is not good, cause i use the Original Photos, they have between 5 and 10 MB every Photo. So it is better, that the Photos are cached - so i think the "Touch" Option is not good for my scenario.
That would work. For your information: Photos are not cleared from cache in any case.
pleibling wrote:Is it posible to "automate" or script the click in the Batchfile (e.g. wget  http://user:password@xxx/panel/refresh.php)?
To be honest, I don't really know if that would work ... You can't just login to panel by adding user:password into the URL, as that is just an old-school folder auth-mechanism.

The only solution I can think of, would be to include a custom PHP script with a "secret" name, that you can call by URL without being logged in, which would in turn call the refresh script.