Doesn't handle publishing and unpublishing exactly like Umbraco
Hi,
I've been using this tool at work, and its a real time saver! We really like it. However, we noticed that it does not publish and unpublish correctly. From what I see in the source code, it only updates the database. However, the cache file, content interface and lucene indexes are not being updated. This caused some big problems for a few projects we work on at my company. I was able to rewrite some of the code to get it to work for us, using these functions:
Also, I've noticed that this tool allows published nodes to become children of unpublished parents, but their publication status is not changed. Not sure why umbraco allows this, but I don't see why this would be a good thing.
Overall, we love this tool at my workplace, and I hope these additions can be included!!
I had to download and alter the source code for this package to get it to work. My main problem was that it wasn't updating the indexes and umbraco.config properly. In this code I added a function
private static void AddToIndex(int id)
{
Document document = new Document(id);
if (document.Published) //Add this to the indeces if it is published
{
foreach (Examine.Providers.BaseIndexProvider indexer in ExamineManager.Instance.IndexProviderCollection)
{
XElement xmlNode = XDocument.Parse(((library.GetXmlNodeById(id.ToString())).Current).OuterXml).Root;
indexer.ReIndexNode(xmlNode, document.ContentType.Alias);
}
}
}
Deleting from an index can be done by:
indexer.DeleteFromIndex(document.Id.ToString());
I made a similar one to delete a node from the index, and would call them appropraitely in his code. I would then call
when needed to update the cache on UI. This may not be the most efficient code/strategy, but at the time that I wrote the code, I had a major time constraint and had to get the code working. After I made my changes, the tool still seems to running pretty fast, even when dealing with a lot of nodes, with many descendants.
Doesn't handle publishing and unpublishing exactly like Umbraco
Hi,
I've been using this tool at work, and its a real time saver! We really like it. However, we noticed that it does not publish and unpublish correctly. From what I see in the source code, it only updates the database. However, the cache file, content interface and lucene indexes are not being updated. This caused some big problems for a few projects we work on at my company. I was able to rewrite some of the code to get it to work for us, using these functions:
Also, I've noticed that this tool allows published nodes to become children of unpublished parents, but their publication status is not changed. Not sure why umbraco allows this, but I don't see why this would be a good thing.
Overall, we love this tool at my workplace, and I hope these additions can be included!!
Thanks.
Richard,
Do you have any comments on this. For us, this would be a serious concern, as we would want all the valid files outside the db to be update.
Is it a valid criticism and is the code above useful or has it been incorporated. As noted, we're also interested in the internal package.
Hi Sean, can you elaborate more on how you were able to fix this? I'm experiencing the same issues...
Hi Amir,
I had to download and alter the source code for this package to get it to work. My main problem was that it wasn't updating the indexes and umbraco.config properly. In this code I added a function
Deleting from an index can be done by:
I made a similar one to delete a node from the index, and would call them appropraitely in his code. I would then call
when needed to update the cache on UI. This may not be the most efficient code/strategy, but at the time that I wrote the code, I had a major time constraint and had to get the code working. After I made my changes, the tool still seems to running pretty fast, even when dealing with a lot of nodes, with many descendants.
I hope you can get it to work for you! Good luck!
is working on a reply...