Symantec Management Platform (Notification Server)

 View Only
  • 1.  How to clone a folder of filters in NS 7.1

    Posted Jul 26, 2013 08:55 AM

    Hello,

    I have a folder with tens of custom filters in it. I need to create another folder and then slightly modify the definition of the original filters. I can clone a single filter but it is very time consuming. What I would like to achieve at once is:

    - clone the folder with all items in it

    - export the folder

    -modify the defintions in xml

    -import the folder back

    Or maybe there are other ways of cloning large number of items ?

    Thanks

    Romasz



  • 2.  RE: How to clone a folder of filters in NS 7.1

    Posted Aug 07, 2013 07:53 AM

    Have you had a look at the ASDK?

    check out below methodes in the ItemManagementLib class:
    CloneItem, MoveItem, ExportItemXml & ImportItemXmlFile

    Edit:

    You may also be interested in GetItemsInFolder and RenameItem

     



  • 3.  RE: How to clone a folder of filters in NS 7.1

    Posted Aug 08, 2013 07:00 AM

    If you really want to touch the xml of all the filters, just export the whole folder. In a single file you will have all the xml representations of the filter in the folder. Change them with a replace script of sorts.

    Finally you should run a script to replace all the GUIDs with newly created ones(all item guid= and version guid=) and also add " - Clone" before </name>.

    Then import the xml again. Should give you a clone of everything.



  • 4.  RE: How to clone a folder of filters in NS 7.1

    Posted Aug 10, 2013 05:54 PM

    I have not looked at the ASDK. I guess it would take me a while before I figure out how ASDK works in details and I could use it efficiently.

    Anyway thank you for the suggestion



  • 5.  RE: How to clone a folder of filters in NS 7.1

    Posted Aug 10, 2013 06:10 PM

    The idea sounds interesting.

    I am not quite sure what you mean by "Finally you should run a script to replace all the GUIDs with newly created ones(all item guid= and version guid=) and also add " - Clone" before ."

     I can run a script to replace the guids but how do I create new guids ? And how do I know the new guids ?

    Would you be able to export any filter and modify it so when imported back it will create a new one ? it can be exactly the same filter but must create a new one when importing back.

    The sql definition I will figure out by myself.

     



  • 6.  RE: How to clone a folder of filters in NS 7.1

    Posted Aug 12, 2013 06:04 AM

    Every item in the database has the GUID as its main identifier. Clones are same items with different GUIDs essentially. So to make a clone out of your export you would need to replace all those identifiers with new ones. So you would need some script that gives you those randomized GUIDs {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} with each x being a random hex number. 

     



  • 7.  RE: How to clone a folder of filters in NS 7.1

    Posted Aug 12, 2013 04:36 PM

     

    Yes, I understand that each item in database has its own item. I hoped for some relatively easy workaround.

    I am not willing to make up my own guids. I would not risk inventing the same guid as existing item in data independentlyof how low the probability of such event is. The risk of messing up the database and effort to develop a sensible script in this case is not worthy.

    Apparently there is not easy work to accomplish that task. I am going to close the thread and raise a feature request. As far as I know we have a bulk actions such as move, delete.

    Why not add a clone action for folder or at least a clone bulk action for items in folder ?