Create.MyFiles.Folder

Creates a single folder in either "My web files" or "My private files" area of eporfolio. I also allows to create subfolders.

Input parameters:

Name

Description

Type

M/O

Message Type

Type of the message

Set to "MyFiles.CreateFolder"

M

SyncKey

External SyncKey for the created folder.

Text

O

SiteId

Site where action will be executed

Int

O

VendorId

VendorId which will be associated with created content

Text

O

UserID

UserID of the owner.

Integer

O/M

UserSyncKey

User SyncKeyID of the owner.

Text

O/M

Visibility

If the file is to be added to either:

"Public" -> "My web files".

"Private" -> "My public files".

Text

"Private" or "Public"

M

ParentSyncKey

SyncKey of the folder into which the folder is to be created. Default is the root.

Text

O

Name

Name of the folder.

Text.

Must not be blank.

Follow same rules as the UI. Can’t contain invalid characters

M

Notes:

Either CreatorUserID or CreatorSyncKey must be specified. This means specify at least one is mandatory.

Output

Finished status

If the folder was created successfully, output message contains its path, that can be used to construct URL for accessing the folder from web browser.

  • For private folders: returns relative physical path to new folder, for example "\myfiles\newfolder".

  • For public folders: returns relative URL address to new folder, for example "/data/1/1/myfiles/newfolder".

Warning status

  • Folder name already exists.

Errors status

  • Invalid format / parameters (different to specified schema).

  • User (creator) does not exist.

  • User (creator) is external.

  • User (creator) is deleted.

  • Invalid or unknown ParentSyncKey.

  • Message contains duplicates for syncKeys: {0}. Make sure your syncKeys are globally unique.

  • Folder name is blank or contains invalid characters.

Sample database content

This section describes example output after successfully creating a new folder.

Conditions

Folder hierarchy: parent_folder > new_folder

Private files physical folder for a given user: C:\itsl\dataprivate\1\1

Web files virtual folder for a given user: /data/1/1/

Web files homepage link: https://localhost/data/1/1

Storage

This is how it's being stored in the database:

MessageIdentifierMap

Folder visibility

EntityIdentifier

Type

Description

Private

\parent_folder\new_folder\

PrivateFolder

EntityIdentifier contains physical path suitable to use with PersonalFileHandler class. In code we handle physical paths, so its easier to store it this way. Pair EntityIdentifier and Type is an unique identifier.

Web

PublicFolder

MessageLogEntry

Folder visibility

EntityIdentifier

Description

Text

Description

Private

\parent_folder\new_folder

Output path used by 3rd parties to construct an URL to the file.

Folder created: \parent_folder\new_folder

Physical path used to construct URL to a private folder.
Sample URL used to navigate to the private folder: https://localhost/FileExplorer/BrowseFiles.aspx?Path=\parent_folder\new_folder

Web

/data/1/1/parent_folder/new_folder

Folder created: /data/1/1/parent_folder/new_folder

Relative URL used to construct full URL to a public folder.

Sample URL used to navigate to the public folder: https://localhost/data/1/1/parent_folder/new_folder

MessageIndexEntry

Folder's SyncKey specified in the message

Type

Value

Description

Existing SyncKey

No changes

No changes to existing row

Not specified - null value

SyncKey

e9f3bc22-d307-48a0-8b4e-0934180df3a4

A row with autogenerated key is being inserted to the table

XML

Schema
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="urn:message-schema"
elementFormDefault="qualified"
targetNamespace="urn:message-schema">
<xs:element name="Message" type="MessageType" />
<xs:complexType name="MessageType">
<xs:sequence>
<xs:element name="SyncKeys" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="SyncKey" minOccurs="0" maxOccurs="1" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SiteId" minOccurs="0" maxOccurs="1" type="xs:int" />
<xs:element name="VendorId" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="36"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CreateMyFilesFolder" minOccurs="1" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="1" maxOccurs="1">
<xs:element name="UserId" type="xs:integer" />
<xs:element name="UserSyncKey" type="xs:string" />
</xs:choice>
<xs:element name="Visibility" minOccurs="1" maxOccurs="1" type="xs:string" />
<xs:element name="ParentSyncKey" minOccurs="0" maxOccurs="1" type="xs:string" />
<xs:element name="Name" minOccurs="1" maxOccurs="1" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
Message content example
<Message xmlns="urn:message-schema">
<SyncKeys>
<SyncKey ID="ID1">7786</SyncKey>
</SyncKeys>
<CreateMyFilesFolder>
<UserId>1</UserId>
<Visibility>Private</Visibility>
<Name>newFolderName</Name>
</CreateMyFilesFolder>
</Message>