I'm creatin nodes through the API, but they shouldn't be published, but they are. Can someone tell me how I can create a new node and save it without publishing
No, that doesn't do it. The node is still published, but the cache just isn't updated, which basically just means you can't see the content, but in the backend etc. the node will still seem like it's published. The content will also get into the cache, if you do a "republish entire site".
Document.MakeNew always publishes the node
I'm creatin nodes through the API, but they shouldn't be published, but they are. Can someone tell me how I can create a new node and save it without publishing
The code I have at the moment:
var dct = DocumentType.GetByAlias("MyDocType");
var author = User.GetUser(7); //Visitor
var doc = Document.MakeNew(tbHeader.Text, dct, author, parentId);
doc.getProperty("header").Value = tbHeader.Text;
doc.getProperty("manchet").Value = tbManchet.Text;
doc.getProperty("bodytext").Value = tbBodytext.Text.Replace(Environment.NewLine, "<br />");
doc.Published = false;
doc.SendToPublication(author);
NB: The user used to create the node isn't even allowed to publish content
Hi Rasmus,
Try this
Rich
NB: The API doesn't use the security options from the UI, I'm assuming your 'Visitor' user wouldn't have access to the API ;)
No, that doesn't do it. The node is still published, but the cache just isn't updated, which basically just means you can't see the content, but in the backend etc. the node will still seem like it's published. The content will also get into the cache, if you do a "republish entire site".
What about if you just comment out
Rich
Nope, it's already published on Document.MakeNew
The doc.publish etc. just calls the publish events and sends out notifications etc.
I've made this little workaround that works for now:
NB: This is a workaround, so if you have a solution to my problem, I would love to hear it.
is working on a reply...