|
|
 Rank: Newbie
Joined: 6/25/2008 Posts: 10 Location: ottawa
|
Here is my cont tree (kinda)
-Root ---Applications <-- this is a container for filled auto forms -------App 1 -------App 2 -------App 3 ---Approved Type 1<-- So is this -------App 4 -------App 5 -------App 6
---Approved Type 2<-- So is this -------App 7 -------App 8 -------App 9
What my goal is, is to create a data type in .NET that can reside on the second tab in a Node/Document. This data type will actually preform a function, it will have the power to approve an 'application' and place it under a specific location in the doc tree.
The approved applications will be viewed by any visitor online, Whatever public information will be able to be searched with xslt. This is done.
I have used the auto Form to make the App # populate into the applications node after filled.
All i need now is some knowledge of how to move a document/node from one location to another with a .NET control. I have made my own data types so all i need is basically a function name or someting here. I want the end user to be able to correct the information and press "approve1", "approve 2" or "reject" kinda deal.
Thanks for all your help. If there is another forum post or anything I should be looking at, let me know. I looked but i could not find anything on using .NET to move a document around the tree.
Also if there is a better way to do this, I'm all ears!
|
|
 Rank: Addict
Joined: 9/27/2007 Posts: 977 Location: Belgium
|
Hi, I guess you have a couple of options here: - Moving nodes from one node to another can be done manually. Just right-click the node and choose 'Move' from the submenu. Select the destination node and you're ready. Plain simple, no coding required as it comes out-of-the-box. - Create a user control to list all applications waiting for approval/rejection and add buttons for each of the actions. Move nodes programmatically. Is the action as in first option, so browsing the code will show how to do this. Add this usercontrol to the dashboard. Not sure if a datatype is a viable option. I guess it could be done, but it might be tricker to develop. Let us know what you decided to go for! Good luck. Regards, /Dirk
level 1 certified - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
|
|
 Rank: Newbie
Joined: 6/25/2008 Posts: 10 Location: ottawa
|
Yep i'm looking to move nodes programmatically, but i can't find any example that does that. Some create media items. I'm crawilg the namespace now to see if i can find a solution, but nothing yet.
As for the data type, in my (lacking) experience its just a user control thats embedded into the back end of umbraco. is a user control and a data type treated different in terms of avaliable functions?
Anyway, its all complete except for the ability to move a document. IE i have the applications populating correctly using the auto form. and i have a data type with the different buttons in place embedded into umbraco. so close!
|
|
 Rank: Addict
Joined: 9/27/2007 Posts: 977 Location: Belgium
|
Allright, you're really, really close now. Haven't code floating around right now, but make sure to have a look at the source for CMSNode.cs in the umbraco.cms project. Look at the source for the Move method, it should get you really, really, really close! If you don't have the source, goto Codeplex to download the latest changeset. Oh, btw, I have been looking at the source for v4 Good luck. Regards, /DIrk
level 1 certified - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
|
|
 Rank: Newbie
Joined: 6/25/2008 Posts: 10 Location: ottawa
|
My life just got 1000x easier. You know i never thought to GET the source for umbraco until that comment for some reason!
Thanks!
|
|
 Rank: Newbie
Joined: 6/25/2008 Posts: 10 Location: ottawa
|
Super simple! Ok here is the solution inside a custom data type: ... .. //nodeRep and nodeDealer are private vars protected void btnDelete_Click(object sender, EventArgs e) { ProcessDocument(3); }
protected void btnDealer_Click(object sender, EventArgs e) { ProcessDocument(2); }
protected void btnRep_Click(object sender, EventArgs e) { ProcessDocument(1); } /* ProcessDocument(int commandType) a centralized place we take care of the nodes / documents. */ public void ProcessDocument(int commandType) {
umbraco.cms.businesslogic.CMSNode n = new umbraco.cms.businesslogic.CMSNode(System.Convert.ToInt32(Request["id"]));
if (commandType == 1) // Move to rep { n.Move(nodeRep); n.Save(); } if (commandType == 2) // Move to Dealer { n.Move(nodeDealer); n.Save(); //move to dealer } .. ..
|
|
|
Guest |