17 using erminas.SmartAPI.Exceptions;
18 using erminas.SmartAPI.Utils;
19 using erminas.SmartAPI.Utils.CachedCollections;
21 namespace erminas.SmartAPI.CMS.Project.Folder
23 internal class AssetManagerFolder : BaseFolder, IAssetManagerFolder
25 private readonly IAssetManagerFolder _parentFolder;
27 public AssetManagerFolder(IProject project, XmlElement xmlElement) : base(project, xmlElement)
30 SubFolders =
new SubFolders(
this,
Caching.Enabled);
31 Files =
new AssetManagerFiles(
this,
Caching.Enabled);
34 public AssetManagerFolder(IAssetManagerFolder parentFolder, XmlElement xmlElement)
35 : base(parentFolder.Project, xmlElement)
37 _parentFolder = parentFolder;
38 SubFolders =
new EmptySubFolders(
this);
39 Files =
new AssetManagerFiles(
this,
Caching.Enabled);
42 public void CreateSubfolder(
string name,
string description,
string filesystemDirectoryName)
44 if (ParentFolder != null)
47 string.Format(
"Can not create subfolder in another subfolder ({0}).",
this));
50 const string CREATE_SUBFOLDER =
51 @"<FOLDER guid=""{0}""><SUBFOLDER action=""addnew"" name=""{1}"" dirname=""{2}"" description=""{3}"" /></FOLDER>";
53 Project.ExecuteRQL(CREATE_SUBFOLDER.SecureRQLFormat(
this, name, filesystemDirectoryName, description));
56 public new IAssetManagerFiles Files
58 get {
return (IAssetManagerFiles) base.Files; }
59 private set { base.Files = value; }
62 public override bool IsAssetManager
67 public bool IsDatabaseFolder
72 public bool IsFileSystemFolder
77 public bool IsSubFolder
79 get {
return _parentFolder != null; }
82 public IAssetManagerFolder ParentFolder
84 get {
return _parentFolder; }
92 public ISubFolders SubFolders {
get;
private set; }
108 void CreateSubfolder(
string name,
string description,
string filesystemDirectoryName);
110 bool IsDatabaseFolder {
get; }
111 bool IsFileSystemFolder {
get; }
112 bool IsSubFolder {
get; }