private void ValidateWorkspaceCreationActivity(Dictionary <string, object> data, ActivityManager activityManager,
                                                       SPWeb contextWeb)
        {
            string settingValue = CoreFunctions.getConfigSetting(contextWeb, CREATED_CONFIG_KEY);
            bool   processed;

            bool.TryParse(settingValue, out processed);
            if (processed)
            {
                throw new SocialEngineException(ALREADY_CREATED_EXCEPTION_MESSAGE, LogKind.Info);
            }

            new DataValidator(data).Validate(new Dictionary <string, DataType>
            {
                { "Id", DataType.Guid },
                { "Title", DataType.String },
                { "URL", DataType.String },
                { "UserId", DataType.Int },
                { "ActivityTime", DataType.DateTime }
            });

            if (activityManager.ActivityExists(ObjectKind.Workspace, ActivityKind.Created, (Guid)data["Id"]))
            {
                throw new SocialEngineException(ALREADY_CREATED_EXCEPTION_MESSAGE, LogKind.Info);
            }
        }
        private void ValidateWorkspaceDeletionActivity(Dictionary <string, object> data, ActivityManager activityManager)
        {
            new DataValidator(data).Validate(new Dictionary <string, DataType>
            {
                { "Id", DataType.Guid },
                { "Title", DataType.String },
                { "URL", DataType.String },
                { "UserId", DataType.Int },
                { "ActivityTime", DataType.DateTime }
            });

            if (activityManager.ActivityExists(ObjectKind.Workspace, ActivityKind.Deleted, (Guid)data["Id"]))
            {
                throw new SocialEngineException(
                          "Cannot register more than one deleted activity on the same workspace.", LogKind.Info);
            }
        }