Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Problem executing the AddFolders Stored PROCProblem executing the AddFolders Stored PROC
Previous
 
Next
New Post
7/2/2009 7:08 PM
 

DNN5.0.1

I would like to be able to execute the AddFolders stored proc to add my own folders through my webform. I am executing the stored PROC and the record is being created in the folders table, but when I go to the file manager and view the results I end up with folders nested in each other in a very strange way.

If I want to execute that stored proc to create a folder is there other records in other tables that need to be created for the system to work correctly?

Thanks,

John

 
New Post
7/2/2009 7:38 PM
Accepted Answer 

 Hi John,

By calling the stored procedure itself you are utilizing a level that is "too low" and will result in the sorts of headaches you are experiencing.  As an alternative, I strongly recommend taking advantage of the higher-level business classes to interact with the framework.

In this case, to create a new folder, utilize the FileSystemUtils.AddFolder static method.  For example:

        FileSystemUtils.AddFolder(PortalController.GetCurrentPortalSettings(), "myParentFolder", "myNewFolderName")

To create secured or database-secured folders, there is an overload accepting an additional integer.  Use the StorageLocationTypes enumeration to select one of these alternative locations.

Hope this helps!

Brandon 


Brandon Haynes
BrandonHaynes.org
 
New Post
7/3/2009 12:21 AM
 

thanks, that does help.

that is what I was afraid of...I am using XMOD right now, not building my own modules just yet. Is there a way to look through the addfolder code? If I can't make it work I can always have my users create folders manually ahead of time, I was hoping to avoid that.

Eventually, I plan on writing my own modules, but I am not there yet.

Thanks,

John

 
New Post
7/3/2009 8:30 AM
 

 Hi John,

The relevant code is located in Common/Utilities/FileSystemUtilities.vb and Services/FileSystem/FolderController.  The FileSystemUtilities class essentially delegates control to the controller (except for some default permission configuration), so look there to see the bulk of the action.

It does not appear that the controller class is doing anything particularly noteworthy, so it's not impossible that you will be able to reach a satisfactory solution through the stored procedures.  However, these may change at any time in the future making any direct-access solution potentially very brittle.  You may also have some caching issues that make a satisfactory solution possible.

If I were in your shoes, I would open up the Folders table in my database after creating a single folder via the SP and look to see if anything stands out as being especially "wrong" about the data placed therein.  Are the slashes in the correct place?  Is the createdByUserId valid?  Does the path end with a terminating slash?

Because you are interacting with the framework in a highly unusual manner, you'll likely be on your own for the bulk of the debugging work, but hopefully that might get you started.  Best of luck!

Brandon


Brandon Haynes
BrandonHaynes.org
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Problem executing the AddFolders Stored PROCProblem executing the AddFolders Stored PROC


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out