ackerman.ro Posted December 28, 2011 Posted December 28, 2011 Hello all! First time post, trying to figure something out with my distribution. Single machine style distro, and I'm not able to get SCScanDirectory to return anything. Currently, just for testing, I'm trying to set a field in a table I've created (for testing) to the results of the SCScanDirectory function. I do have SCSetBaseURL set previously in the function, just for clarification. Currently, the function is SCScanDirectory("http://xx.xx.xx.xx:80/SuperContainer/Files/Salem Glen" ; True ) The Salem Glen is the name of the "parent" directory in the file structure that I have created. Any help would be greatly appreciated.
ooparah Posted December 28, 2011 Posted December 28, 2011 Hey there Ackerman, First off... thanks for choosing SuperContainer and welcome to the forums! It looks like our SCScanDirectory() function does not return "ERROR" as is mentioned in our documentation but instead returns an empty list, which makes it appear as if nothing is returned (which is true). I have just edited our source so that it returns "ERROR" upon failure instead of simply a empty list, which should help in debugging your own solutions. So, thanks for pointing this out as it was a necessary change.... HOWEVER, the path you are passing in is in fact invalid. I am sure it can be a bit confusing since a lot of our plugin functions request a "folderPath", which refers to the path to the document/file on the SC Server... but, in this particular function, the "path" refers to the local path of the file (i.e., Get ( DesktopPath ) or "/Macintosh HD/Users/username/Desktop/myFolder" ). The first parameter you are passing is actually a complete SuperContainer URL, which is an invalid value to pass. The rest of your call looks great. So, as an example: SCScanDirectory( Get ( DesktopPath ) ; true ); I hope this helps. If you have any additional questions or need clarification on this issue, please do not hesitate to contact me at the e-mail address or phone number listed below. Regards,
ackerman.ro Posted December 30, 2011 Author Posted December 30, 2011 Now the problem I'm having is with multiple files being in the same area. Based off of the naming convention I have performed some math calculations to get the number of files in the directory. For example, the same path that I was using before (albeit corrected, still the Salem Glen parent directory) has 1 file in it (currently Salem Glen/1/test.txt) Using a wordcount function and some math, I can get this to return and save it to a variable ($$count currently = 1) While trying to code in an Upload button, I have figured this in. So right now my url is as follows, as passed through an OpenURL function. "http://xx.xx.xx.xx/SuperContainer/Files/Salem Glen/" & ($$count + 1) For some reason this is not working, it currently opens "http://xx.xx.xx.xx/SuperContainer/Files/Salem Glen/1" when it should be opening "http://xx.xx.xx.xx/SuperContainer/Files/Salem Glen/2" . I can include more information if this wasn't enough, such as the exact formula it uses to calculate $$count.
bcooney Posted December 30, 2011 Posted December 30, 2011 How are you tying the files to a record? In my setups, as they suggest in the documentation*, I use the unique recordID for the filename. So, my path is: /DOCS/ID. I wouldn't need to count files, I just count records. * see the section "SuperContainer URLs"
ackerman.ro Posted December 30, 2011 Author Posted December 30, 2011 The problem is that for each record ID I may have multiple files, the people I'm doing the database work for said that there could be upwards of 20 files tied to one recordID (effectively).
bcooney Posted December 30, 2011 Posted December 30, 2011 Why is that? Can you describe your table structure? My instinct tells me you need a child table.
ackerman.ro Posted December 30, 2011 Author Posted December 30, 2011 It's for a realty firm, so I have a list of Subdivisions that may have multiple properties. The subdivision that I've been working/testing with (trying to get thinks working at all, much less dynamic) is Salem Glen. For Salem Glen (regardless of the address), I may have up to 20 documents.
bcooney Posted December 30, 2011 Posted December 30, 2011 I'd use a child table "Docs" to the parent "Subdivision". Do you also have doc types? Or, is a document really related to a parent "property" which in turn is related to a parent SubDivision.
ackerman.ro Posted December 31, 2011 Author Posted December 31, 2011 That might be possible, but I'm not sure how to make IWP update the child table every time a document is uploaded.
bcooney Posted December 31, 2011 Posted December 31, 2011 Give them a button that creates a child record and switches to its form view, all ready for upload.
Recommended Posts
This topic is 4712 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now