TimePunch Sync Service
This service contains methods in order to search for time entries or projects that have to be synchronized with mobile devices. Also it offers method in order to import / synchronize time entries and projects.
GetUseableSyncUserProfiles
This method searches for all TimePunch profiles that can be used in order to sync data. As an additional information the last synchronization date will be returned.
List<SyncUserProfileDto> GetUseableSyncUserProfiles(
out TpFault fault,
TpAuthentication authentication);
Needed Permission | sync@access – current user core@switchIdentity – different users | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
Return value | List of TimePunch profiles that can be used for synchronisation purposes. |
GetUseableConnectedDevicesForSync
This method searches for connected mobile devices that are available for data synchronisation.
For each connected device, the corresponding user profile is also supplied.
List<ConnectedDeviceDto> GetUseableConnectedDevicesForSync(
out TpFault fault,
TpAuthentication authentication);
Needed Permission | sync@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
Return value | List of connected devices that are currently bound and used for synchronsiation purposes. |
PullAndSyncConnectedDevice
This method downloads data from the TimePunch Cloud for the connected devices and synchronises the data with the local TimePunch installation.
void PullAndSyncConnectedDevice(
out TpFault fault,
TpAuthentication authentication,
ConnectedDeviceDto connectedDevice);
Needed Permission | sync@access timeEntries@download projects@download | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
connectedDevice | One connected device for which the data shall be downloaded from cloud |
BindClientToDevice
This method can be used to connect a user profile to a mobile device. Connecting the user profile to the mobile device is necessary so that data can be automatically retrieved from the cloud.
void BindClientToDevice(
out TpFault fault,
TpAuthentication authentication,
ConnectedDeviceDto connectedDevice);
Needed Permission | sync@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
connectedDevice | One connected device for which the data shall be downloaded from cloud |
ReleaseClientFromDevice
This method disconnects a user profile from a connected mobile device. Once the user profile has been disconnected from the device, it is no longer possible to retrieve data automatically.
void ReleaseClientFromDevice(
out TpFault fault,
TpAuthentication authentication,
ConnectedDeviceDto connectedDevice);
Needed Permission | sync@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
connectedDevice | One connected device for which the data shall be downloaded from cloud |
GetDeviceInfo
This method retrieves the stored data of the mobile device.
ConnectedDeviceDto GetDeviceInfo(
out TpFault fault,
TpAuthentication authentication,
Guid deviceConnectionId);
Needed Permission | sync@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
deviceConnectionId | Id of the device for that the device info shall be loaded | |
Return value | Connected device info |
**
**
GetClientInfo
This method retrieves the stored data of the mobile device, in the context of a user profile.
ConnectedDeviceDto GetClientInfo(
out TpFault fault,
TpAuthentication authentication,
Guid deviceConnectionId,
Guid clientConnectionId);
Needed Permission | sync@access | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
deviceConnectionId | Id of the device for that the device info shall be loaded | |
clientConnectionId | Id of the client connection that is bound with the device (not necessarily the id of the user profile) | |
Return value | Connected device info |
SearchTimeEntriesForSynchronisation
This method searches all time entries and the depending projects as well as the tasks and customers that can be send to a mobile device since the given synchronisation time.
The method does not check the creation or modification date, but the date of the time entry if it’s newer than the sync time.
void SearchTimeEntriesForSynchronisation(
out TpFault fault,
TpAuthentication authentication,
DateTime? lastSyncTime,
out IEnumerable<TimeEntryDto> timeEntries,
out IEnumerable<ProjectDto> projects,
out IEnumerable< TaskDto> commonTasks,
out IEnumerable<CustomerDto> customers);
Needed Permission | timeEntries@upload | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
lastSyncTime | Synchronisation-Time | |
timeEntries | Out | Collection of time entries starting with the given sync time |
projects | Out | Projects that are referenced by the found time entries |
commonTasks | Out | Common tasks that are referenced by the found time entries |
customers | Out | Customers that are referenced by the found time entries |
SearchProjectsForSynchronisation
This method searches for all projects that a user can send to his mobile devices.
IEnumerable<ProjectDto> SearchProjectsForSynchronisation(
out TpFault fault,
TpAuthentication authentication);
Needed Permission | projects@upload | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
Return Value | Projects that can be used for synchronization purposes. |
UpdateLastSyncDate
This method updates the synchronisation date for the current user.
void UpdateLastSyncDate(
out TpFault fault,
DateTime? syncDate,
TpAuthentication authentication);
Needed Permission | timeEntries@upload | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
syncDate | Sync Date to set, or null if the current date shall be used. | |
authentication | User authentication |
ApplyStaticData
This method imports the given projects and customers and merges it with the already existing.
void ApplyStaticData(
out TpFault fault,
TpAuthentication authentication,
IEnumerable<ProjectDto> projects,
IEnumerable<TaskDto> commonTasks,
IEnumerable<CustomerDto> customers);
Needed Permission | projects@download | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
projects | Collection of projects that shall be imported. | |
commonTasks | Collection of common tasks that shall be imported. | |
customers | Collection of customers that shall be imported. |
ApplyTimeEntries
This method imports the given time-entries, projects as well as tasks and merges it with the already existing.
void ApplyTimeEntries(
out TpFault fault,
TpAuthentication authentication,
IEnumerable<TimeEntrySaveDto> timeEntries,
IEnumerable<ProjectDto> projects,
IEnumerable<TaskDto> commonTasks,
IEnumerable<CustomerDto> customers);
Needed Permission | projects@download | |
---|---|---|
Name | Modifier | Description |
fault | Out | Contains the error if an exception occurs. |
authentication | User authentication | |
timeEntries | Collection of time entries to impoert | |
projects | Collection of projects that are referenced by the time entries. | |
commonTasks | Collection of common tasks that are referenced by the time entries. | |
customers | Collection of customers that that are referenced by the time entries. |