How do I convert existing Categories to Folders?

Note: In older versions of Asset Bank 'folders' were called 'access levels'

If you need to convert existing categories to folders (to be able to set permissions on these categories) you need to run an update statement on the Asset Bank database. Please take a backup of the database before running any statements so that you can revert to it if necessary. If you wish to convert all current categories to folders run the following statement:

UPDATE CM_Category SET CategoryTypeId=2, WorkflowName="default", IsRestrictive=1 WHERE CategoryTypeId=1;

You can also restrict this to only certain categories (for example recently added categories) by adding the category ID to the WHERE clause e.g.

UPDATE CM_Category SET CategoryTypeId=2, WorkflowName="default", IsRestrictive=1 WHERE CategoryTypeId=1 AND Id > 150;

Existing assets in this folder will now have 'Unapproved' status so you should run the following to set the flag to approved for all assets in the folder (in this example approved by the admin user but you could set the user ID to be another user):

Set Approval for all folders:

UPDATE CM_ItemInCategory SET IsApproved=1, LastApprovedByUserId=1;

Or set Approval for particular folder:

UPDATE CM_ItemInCategory SET IsApproved=1, LastApprovedByUserId=1 WHERE CategoryId=150;

If you intend to leave your Asset Bank with just folders and no categories, please ensure the category attribute is set as not mandatory. Otherwise all your assets will be marked as having incomplete metadata which can have unintended consequences. Also, go to the Admin > Folders area and click on Browse Settings, from there you can mark categories as hidden generally.

Note - if you have the old style category and folder selection controls you may also want to change the folder selector from a checklist to dropdowns (so that it is the same as the category picker). If your Asset Bank has the setting access-levels-dropdowns you need to change it's value to true and restart to set it.

To make all of this visible to normal users you also need to set the following:

accessLevelsOnHomepage=all

To ensure empty 'folders' are not shown please also set:

show-empty-access-levels=false

To ensure new folders are assignable by default, set:

default-new-accesslevels-to-assignable=true

Finally, you should also edit the 'folder' attribute (Admin > Attributes > Folders [edit]) and tick 'Include in keyword searches' so that the folders that assets are in are also included in the search index. You will then have to run a re-index.

After this has been done please:

  1. Restart Asset Bank (by restarting the Asset Bank webapp or the Tomcat service).
  2. Perform a reindex of existing assets (from the Admin>Attributes menu).

Note: The permissions will not work correctly until the reindex has completed.


Was this article helpful?

Yes No

Thanks for your feedback!