Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Creating new folder in workspace with SQL query
ItayZohar
Hi
I have a client who needs to add folders and sub folder dynamically after creating the WorkSpace.
Since the creation of the folders is dynamically' I need to add any folder with SQL query. As I checked, I need to add a line to PROJECTS table which describe the folder and connect it to the workspace or to the parent folder. I also need to increase the parameter in the table DOCNUMDB.
Do I have to do some other operation and queries to create the folder with queries?
Can you suggest a more safe way to create dynamic folders?
Thank you in advanced
Itay Zohar
Find more posts tagged with
Comments
Migrateduser
Hi, In my opinion, to add a subfolder is not as easy as you tell in your message, you don't have to update the the docnumdb table, because the only containers with docnum are the workspaces, they have a related xml file.
You have to check and update the sid_table, to get the prj_id correctly, and regarding with the projects table you have to update the left and right visit fields not only for the new line in projects, you will have to check for all the containers in the workspace.
Also take care with projects_nvps table if the folder needs to have a profile (custom1, custom2, ...)
Finally, I'm sure I'm forgetting places in which you should update the data, I think it would be better to use the API with a .NET function than using sql.
Regards
Javi
jny
Accessing the database directly is strongly not recommended. Database access is carefully tuned to insure scalability and concurrent access. If you access the database directly, you throw out all of this careful tuning and run a high risk of your system being unavailable. In all, it goes against the core of WorkSite 3-tier architecture design.
Please use the SDK to add document folders. For example code and reference info on how to do this, please refer to the COM Object for WorkSite Developer's Reference Guide.pdf (particularly, the section under COM Reference: IManDocumentFolders: Methods: AddNewDocumentFolder/AddNewDocumentFolderInheriting) which is distributed with the WorkSite iToolkit (SDK). Should you need additional assistance on how to use the SDK and you own an SDK, you are qualified to request SDK assistance by submitting your specific questions by e-mail to
Worksite-Devsupport@interwoven.com
.