Class AreaService
- Namespace
- Dynamicweb.Content
- Assembly
- Dynamicweb.dll
Provides methods for querying and persisting areas.
public class AreaService : IAreaService, IRecyclable<Area>, ICacheStorage<int, Area>, ICacheStorage<int>, ICacheStorage
- Inheritance
-
AreaService
- Implements
- Inherited Members
Properties
Repository
Gets the repository for working with the Area aggregate
[Obsolete("Do not use")]
public static IAreaRepository Repository { get; set; }
Property Value
Methods
CanDeleteArea(Area)
Returns a value indicating if the specified area can be deleted.
public bool CanDeleteArea(Area area)
Parameters
area
Area- The area for which to determine if it can be deleted.
Returns
- bool
- True if the area can be deleted, otherwise false.
Remarks
If the Area is a master area (The primary version of a website in contrast to language versions of the same website),
and it has language versions. The area cannot be deleted until the language versions has been deleted.
If it is not a master area, the area can be deleted.
CanMoveToBin(Area)
Returns a value indicating if the current user can move the area to the Bin
public bool CanMoveToBin(Area area)
Parameters
area
Area- The area to move to the Bin
Returns
- bool
- True if the current user can move the area to the Bin, otherwise false
CanRestore(int)
Returns a value indicating if the current user can restore the area with the specified id
public bool CanRestore(int id)
Parameters
id
int- The id of the area to restore
Returns
- bool
- True if the current user can restore the area with the specified id, otherwise false
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public void ClearCache()
ClearCache(IEnumerable<int>)
Resets the specified keys to the default value for objects stored in the object cache
public void ClearCache(IEnumerable<int> keys)
Parameters
keys
IEnumerable<int>- Keys to reset
ClearCache(int)
Resets the specified key to the default value for objects stored in the object cache
public void ClearCache(int key)
Parameters
key
int- Key to reset
CopyArea(CopyAreaInfo)
public ApplicationResponse<Area> CopyArea(CopyAreaInfo copyAreaInfo)
Parameters
copyAreaInfo
CopyAreaInfo
Returns
DeleteArea(int)
Deletes the area with the specified id
public ApplicationResponse DeleteArea(int areaId)
Parameters
areaId
int- The id of the area to delete
Returns
GetArea(int)
Gets the area with the specified id
public Area GetArea(int id)
Parameters
id
int- The id of the area to get
Returns
- Area
- The area with the specified id if it exists, otherwise Nothing
GetAreas()
Gets all areas default sorted by their Name property
public IList<Area> GetAreas()
Returns
GetAreas(AreaSort)
Gets all areas sorted by the indicated property
public IList<Area> GetAreas(AreaSort sortBy)
Parameters
sortBy
AreaSort- Indicates what property of the Area the resulting list of areas should be sorted by
Returns
GetAreasByDomain(string)
Get all areas that have an associated domain as specified
public IList<Area> GetAreasByDomain(string domain)
Parameters
domain
string- The domain for which all associated areas should be returned
Returns
GetAreasByDomain(string, bool)
Get all areas that have an associated domain as specified
public IList<Area> GetAreasByDomain(string domain, bool onlyLocked)
Parameters
domain
string- The domain for which all associated areas should be returned
onlyLocked
bool- If true only areas with pages locked to the specified domain will be returned
Returns
GetLanguageAreas(int)
Gets all language areas
public IList<Area> GetLanguageAreas(int masterAreaId)
Parameters
masterAreaId
int- The id of the master area
Returns
GetMasterArea(Area)
Gets the master area for the specified area
public Area GetMasterArea(Area area)
Parameters
area
Area- The area for which to get it's master area
Returns
- Area
- The master area of the specified area
GetMasterArea(int)
Gets the master area for the area with the specified id
public Area GetMasterArea(int areaId)
Parameters
areaId
int- The id of the area for which to get its master area
Returns
- Area
- The master area for the area with the specified id
GetMasterAreas()
Gets all master areas
public IList<Area> GetMasterAreas()
Returns
GetNewSortValue(int)
Get the next available sort value for an area associated with the specified master area
public int GetNewSortValue(int masterAreaId)
Parameters
masterAreaId
int- The id of the master area
Returns
- int
- An integer representing the next available sort value
MoveToBin(Area)
Moves the specified area to the RecycleBin if the current user has the needed permisssions, otherwise nothing is done
public Guid MoveToBin(Area obj)
Parameters
obj
Area- The area to move to the Bin
Returns
MoveToExistingBin(Area, Guid)
Moves the specified area to an existing RecycleBin with the specified unit id
public void MoveToExistingBin(Area area, Guid unitId)
Parameters
area
Area- The area to move to an existing bin
unitId
Guid- The id of the existing recycle bin to which this area should be moved
Restore(object)
Restores the area with the specified id if the current user has permissions for this operation, otherwise nothing is done
public void Restore(object id)
Parameters
id
object- The id of the area to restore
Exceptions
- InvalidOperationException
- Thrown when there is attempt to restore page having non-existing relations e.g. itemtype.
SaveArea(Area)
Saves the specified area
public Area SaveArea(Area area)
Parameters
area
Area- The area to save
Returns
- Area
- The newly saved area