Folder Selection Dialog

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
customaware
Posts: 2413
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Folder Selection Dialog

Post by customaware »

I want each user to be able to set a default folder path.

Is there any funtionality in AwareIM that will pop up a folder selection dialog
and then allow me to take that selected folder path and save it to a BO attribute?

Cheers,
Mark
aware_support
Posts: 7526
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Implement this pop-up window yourself and let the user type it in. The browser only allows to select files, not folders.
Aware IM Support Team
customaware
Posts: 2413
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Post by customaware »

Oh really.

File select will work for my purpose.

How can that be accomplished.

I can see IMPORT myobject FROM 'C:/mydocuments/psa.csv'

So, if i can use that but have the user select the file to import rather than have is hard coded, that would be great.

Cheers,
Mark
aware_support
Posts: 7526
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

You need to define an attribute of the Document type and Aware IM will automatically display file selection dialog to upload the file.
Aware IM Support Team
customaware
Posts: 2413
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Post by customaware »

Yes. I can do that and I can get it to import the file (.csv) into the document
attribute.

But, is it then possible to point to that attribute as an argument for the IMPORT
FROM

Normally

IMPORT myBO FROM 'C:\mydocs\myfile.csv

But now I import the file into fileBO

IMPORT myBO FROM fileBO

Unless I am doing something wrong I cannot get that to work.
jamesbh

Post by jamesbh »

I think once it is uploaded into the fileBO you need to export it to the server file system ../temp-folder/temp-file.csv and then do the import into myBO from there. IMPORT myBO FROM ../temp-folder/temp-file.csv

I don't think it is possible to import a CSV into a BO directly from the local host of the user or the document attribute.
customaware
Posts: 2413
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Post by customaware »

Hi James.

Yes that works. Thanx.

One issue though....

I have two BOs. Analyses and HaulData

HaulData is owned by Analyses

My HaulData has the following attributes...

SegmentCode text
Easting number
Northing number
RL number
Analysis Analyses

I call the importation process from an Analyses and pass Analyses as the Process Input.

In the importation process I have as you described....

ENTER NEW FileUpload USING Main
EXPORT DOCUMENT FileUpload.FileToUpload TO FILE 'mydata.csv'
IMPORT HaulData FROM 'mydata.csv'

This works and imports the data filling the attributes
SegmentCode,Easting,Northing and RL

However, I cannot seem to fill the Analysis attribute with the Process Input Analyses.

I tried adding the following ACTIONs, none of which work. HaulData.Analysis=Analyses
ThisHaulData.Analysis=Analyses
This HaulData.Analysis=ThisAnalyses
HaulData.Analysis=ThisAnalyses

The records still get created but no association with the current Analyses.

Any ideas what could be the problem here?

Cheers,
Mark
jamesbh

Post by jamesbh »

To be honest with you I have not done any importing of csv yet. But if I was you I would have the import rule after import look up all of the imported records that do not have a Analysis value and loop through them assigning them one.

FOR EACH is what you should use. . . .I think.
jamesbh

Post by jamesbh »

FOR EACH is wrong....Someone else please!
aware_support
Posts: 7526
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Have you checked the rule execution log? Is your Analysis object in the Context at all?
Aware IM Support Team
customaware
Posts: 2413
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Post by customaware »

Managed to get it to work with only one caveat.

ENTER NEW FileUpload USING Main
EXPORT DOCUMENT FileUpload.FileToUpload TO FILE 'mydata.csv'
IMPORT HaulData FROM 'mydata.csv'
FIND ALL HaulData ORDER BY HaulData.ID
CREATE HaulProfiles FOR EACH HaulData WITH HaulProfiles.Analysis=Analyses,HaulProfiles.Descriptor=HaulData.Descriptor,HaulProfiles.Easting=HaulData.Easting,HaulProfiles.Northing=HaulData.Northing,HaulProfiles.ProfileNumber=HaulData.ProfileNumber,HaulProfiles.RL=HaulData.RL

This works but I suspect it will fail if two users try and import data at the same time. :-(

Cheers,
Mark
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

This works but I suspect it will fail if two users try and import data at the same time.
To make the file name unique, you could build a file name that includes LoggedInSystemUser.ID
Tom - V8.8 build 3137 - MySql / PostGres
customaware
Posts: 2413
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Post by customaware »

I thought I could have a RegularUser attribute to the file but cannot assign the LoggInSystemUser to that attribute on the fly.

How do I make a file name that includes the LoggedInSystemUser.ID?

Cheers,
Mark
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

I believe I have a post in Tips and Tricks that shows some manipulation of file names.
Tom - V8.8 build 3137 - MySql / PostGres
customaware
Posts: 2413
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Post by customaware »

Sorry Tom,

Have scoured the forum including T&T and cannot find the post you are referring to.

Cheers
Mark
Post Reply