Topic
  • 8 replies
  • Latest Post - ‏2012-12-19T13:27:46Z by mcnairk
mcnairk
mcnairk
111 Posts

Pinned topic Deleting multiple views from multiple modules

‏2010-04-16T14:59:12Z |
I created a bunch of views in one module and propagated them to numerous other modules using the excellent CopyView DXL. However, I was a bit too enthusiastic and now have several unrequired views that need to be deleted from all modules.

Has anyone developed a DXL that can do this, preferably one with a nice interface that allows you to pick the modules and views. I could hack CopyView, but I hate to re-invent the wheel...

Many thanks,
Ken.
Updated on 2012-12-19T13:27:46Z at 2012-12-19T13:27:46Z by mcnairk
  • Bob_Swan
    Bob_Swan
    33 Posts

    Re: Deleting multiple views from multiple modules

    ‏2010-04-21T07:12:57Z  
    Attached is my effort for this task. It may make a starter for you.
    It was written to delete specific views from modules being shared with stakeholders.
    Sorry there is no 'nice interface', it was a one off for a dedicated task.
    You have to detail the views within the code, it then deletes them from all modules in the current project.
    It shouldn't be too hard to add some code to exclude specific modules.
  • mcnairk
    mcnairk
    111 Posts

    Re: Deleting multiple views from multiple modules

    ‏2010-04-21T17:50:43Z  
    • Bob_Swan
    • ‏2010-04-21T07:12:57Z
    Attached is my effort for this task. It may make a starter for you.
    It was written to delete specific views from modules being shared with stakeholders.
    Sorry there is no 'nice interface', it was a one off for a dedicated task.
    You have to detail the views within the code, it then deletes them from all modules in the current project.
    It shouldn't be too hard to add some code to exclude specific modules.
    Bob,

    With the following tweaks, I was able to get your DXL to do exactly what I needed.
    • Hard code killist of views to be deleted (obviously)
    • Comment out procedure "MakeMinView" (not needed by me)
    • Only process modules in current folder rather than entire project

    I noted the following issues:
    • User must be logged on as the Administrator so they have write access to all views
    • The comment describing "ReportRemainingViews" seems incorrect; this procedure actually reports the remaining views in the module

    I added the following to the wish list:
    • offer option to only process current folder (hard coded in my version)
    • create new log file for each run (e.g. append date/time stamp) rather than overwriting it
    • explicitly state in log if the view does not exist
    • explicitly state in log if the view could not be deleted

    Many thanks,
    Ken.
  • llandale
    llandale
    2979 Posts

    Re: Deleting multiple views from multiple modules

    ‏2010-04-21T19:43:02Z  
    • mcnairk
    • ‏2010-04-21T17:50:43Z
    Bob,

    With the following tweaks, I was able to get your DXL to do exactly what I needed.
    • Hard code killist of views to be deleted (obviously)
    • Comment out procedure "MakeMinView" (not needed by me)
    • Only process modules in current folder rather than entire project

    I noted the following issues:
    • User must be logged on as the Administrator so they have write access to all views
    • The comment describing "ReportRemainingViews" seems incorrect; this procedure actually reports the remaining views in the module

    I added the following to the wish list:
    • offer option to only process current folder (hard coded in my version)
    • create new log file for each run (e.g. append date/time stamp) rather than overwriting it
    • explicitly state in log if the view does not exist
    • explicitly state in log if the view could not be deleted

    Many thanks,
    Ken.
    Its not just that the Administrator can delete views, its also that the Administrator can even SEE them. 'Private' views are invisible to everybody except the user and the Administrator.
  • mcnairk
    mcnairk
    111 Posts

    Re: Deleting multiple views from multiple modules

    ‏2010-04-21T20:10:09Z  
    • llandale
    • ‏2010-04-21T19:43:02Z
    Its not just that the Administrator can delete views, its also that the Administrator can even SEE them. 'Private' views are invisible to everybody except the user and the Administrator.
    Thanks for the clarification.
  • mcnairk
    mcnairk
    111 Posts

    Re: Deleting multiple views from multiple modules

    ‏2010-04-21T20:16:15Z  
    • mcnairk
    • ‏2010-04-21T20:10:09Z
    Thanks for the clarification.
    I forgot to mention that if you provide an empty kill list, this DXL will simply log all views in all formal modules, which is useful in itself. I found a lot of junk views that I was not aware of...
  • SystemAdmin
    SystemAdmin
    3180 Posts

    Re: Deleting multiple views from multiple modules

    ‏2012-12-18T19:15:59Z  
    • mcnairk
    • ‏2010-04-21T20:16:15Z
    I forgot to mention that if you provide an empty kill list, this DXL will simply log all views in all formal modules, which is useful in itself. I found a lot of junk views that I was not aware of...
    Ken,
    Thank you for providing notes on your edits. Is it possible to post your new version? I realize I am responding to messages that are two years old, however, it is worth asking. :)
  • mcnairk
    mcnairk
    111 Posts

    Re: Deleting multiple views from multiple modules

    ‏2012-12-19T13:26:53Z  
    Ken,
    Thank you for providing notes on your edits. Is it possible to post your new version? I realize I am responding to messages that are two years old, however, it is worth asking. :)
    Here it is; I didn't develop it much since I don't use it that much and I don't have time to add bells and whistles.

    Ken.
  • mcnairk
    mcnairk
    111 Posts

    Re: Deleting multiple views from multiple modules

    ‏2012-12-19T13:27:46Z  
    • mcnairk
    • ‏2012-12-19T13:26:53Z
    Here it is; I didn't develop it much since I don't use it that much and I don't have time to add bells and whistles.

    Ken.
    Posted prematurely...