Page 1 of 1

Change private views: unleash public subset

Posted: Mon Feb 29, 2016 6:45 pm
by Mark2007
Dear experts,

is it possible to modify a private view, so that public subsets, that are assigned to the view, are unleashed?

The following situation:
I'm getting in contact with an old TM1-model. Over the years a huge number of public subsets and views are grown.
I already got rid of lots of public views, which I do not need any more

Now, I want to clean up the subsets. Problem: I can not delete a subset, if it is assigned to a view.

I already created a list (dimension) of all views (private and public) by TI by going through the data-folder
I also have a dimension of all subsets (private and public)
and I've a cube that shows me, which subset is assigned to which view (public subsets in public or private views, private subsets in private views)

I'd now like to:
a) modify the private views, so that the public subsets which I want to delete, are not assigned to private views any more (or replaced by another subset)
b) delete the public subsets that are not used any more.

b) is simple
a) - I'm asking for help.
I know that the private view can be changed by changing the *.view-file in the Users folder in the data directory. but I think this has to be done while the server is down,

Any idea?

Regards

Mark

Re: Change private views: unleash public subset

Posted: Tue Mar 01, 2016 7:44 am
by Wim Gielis
Mark2007 wrote:I know that the private view can be changed by changing the *.view-file in the Users folder in the data directory. but I think this has to be done while the server is down
Hello Mark,

In fact, you don't have access to the views programmatically, unless you use the API, which is not easy at all.

[Untested]
You will need to loop over all public subsets that are used in private views (it seems that you already have that information). Track to which user that view is private.
Then you will need to copy the *.vue file for the public view and copy it to the user's folder in the TM1 data directory.
When done, execute the same loop again over public subsets that are used in private views, and delete the *.vue files.
When the user logs off and logs on, the private views should be referencing private subsets.

Have a look at security as well, since the public subsets could be referencing elements to which the user might not have access.
Such views where the user has no access to an element might fail to open in the Cube viewer, for example.
[/Untested]

Can you do some tests whether my suggested approach works fine ? Thanks.
If it does not work I'd be happy to give this one a second thought.

Wim

Re: Change private views: unleash public subset

Posted: Tue Mar 01, 2016 10:05 pm
by BrianL
Mark2007 wrote: I know that the private view can be changed by changing the *.view-file in the Users folder in the data directory. but I think this has to be done while the server is down

That's certainly the safest way. In general, private objects are no loaded into memory until the user actually logs in. When the user is no longer logged in, the private objects should be removed from memory. Because of this you *might* be able to modify the private .vue files, but there's a possibility of running into problems if any users are logged/logging in when you do this work. I do not recommend trying it while TM1 is running.