Table of Contents

Class AreaService

Namespace
Dynamicweb.Content
Assembly
Dynamicweb.dll

Provides methods for querying and persisting areas.

public class AreaService : ICacheStorage<int, Area>, ICacheStorage<int>, ICacheStorage
Inheritance
AreaService
Implements
Inherited Members

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.

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

ClearTrashBin(int)

Deletes the area with the specified id form trashbin

public void ClearTrashBin(int areaId)

Parameters

areaId int

The id of the area to delete

CopyArea(CopyAreaInfo)

public ApplicationResponse<Area> CopyArea(CopyAreaInfo copyAreaInfo)

Parameters

copyAreaInfo CopyAreaInfo

Returns

ApplicationResponse<Area>

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

ApplicationResponse

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

IList<Area>

A list of areas sorted by their name property

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

IList<Area>

A list sorted by the indicated property

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

IList<Area>

A list of areas associated with a given domain

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

IList<Area>

A list of areas associated with a given domain

GetDeletedAreas()

Gets the collection of deleted areas

public IEnumerable<Area> GetDeletedAreas()

Returns

IEnumerable<Area>

A collection of rows

GetLanguageAreas(int)

public IList<Area> GetLanguageAreas(int masterAreaId)

Parameters

masterAreaId int

Returns

IList<Area>

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()

public IList<Area> GetMasterAreas()

Returns

IList<Area>

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

RestoreArea(int)

Restore the area with the specified id

public void RestoreArea(int areaId)

Parameters

areaId int

The id of the area to restore

Exceptions

ApplicationException

SaveArea(Area)

Saves the specified area

public Area SaveArea(Area area)

Parameters

area Area

The area to save

Returns

Area

The newly saved area

To top