Exemple #1
0
        public void LoadRemoteContentList()
        {
            long   siteId = App_Code.SessionInfo.CurrentSite.siteId;
            string url    = GetFullUrl(_serviceUrl.Text, SERVICEURL_CONTENT);

            AWAPI_ContentService.ContentServiceClient client = new AWAPI.AWAPI_ContentService.ContentServiceClient("basicHttp_ContentService", url);
            _remoteServerContentListSource = client.GetList(siteId, "", "lineage, sortorder");
        }
Exemple #2
0
        void CopyContentCustomFieldsFromRemoteToCurrentServer(long contentId, string cultureCode)
        {
            string url = GetFullUrl(_serviceUrl.Text, SERVICEURL_CONTENT);

            AWAPI_ContentService.ContentServiceClient      client              = new AWAPI.AWAPI_ContentService.ContentServiceClient("basicHttp_ContentService", url);
            AWAPI_Data.CustomEntities.ContentCustomField[] customFields        = client.GetFieldList(contentId);
            AWAPI_Data.CustomEntities.ContentCustomFieldValueExtended[] values = client.GetFieldValueList(contentId, cultureCode);

            //Add Fields
            if (customFields == null || customFields.Length == 0)
            {
                return;
            }

            ContentCustomFieldLibrary lib = new ContentCustomFieldLibrary();

            foreach (AWAPI_Data.CustomEntities.ContentCustomField cf in customFields)
            {
                AWAPI_Data.Data.awContentCustomField fld = lib.GetField(cf.customFieldId);
                if (cf.fieldContentId != contentId)
                {
                    break;
                }

                if (fld == null)
                {
                    fld = new AWAPI_Data.Data.awContentCustomField();
                }

                fld.contentId          = contentId;
                fld.customFieldId      = cf.customFieldId;
                fld.title              = cf.title;
                fld.description        = cf.description;
                fld.applyToSubContents = cf.applyToSubContents;
                fld.fieldType          = cf.fieldType;
                fld.maximumLength      = cf.maximumLength;
                fld.maximumValue       = cf.maximumValue;
                fld.minimumValue       = cf.minimumValue;
                fld.defaultValue       = cf.defaultValue;
                fld.regularExpression  = cf.regularExpression;
                fld.sortOrder          = cf.sortOrder;
                fld.isEnabled          = cf.isEnabled;
                fld.lastBuildDate      = DateTime.Now;

                //lib.SaveField(true, fld);
            }

            //Add Values
            if (values != null && values.Length > 0)
            {
                foreach (AWAPI_Data.CustomEntities.ContentCustomFieldValueExtended value in values)
                {
                    lib.UpdateFieldValue(value.contentId, value.customFieldId,
                                         App_Code.SessionInfo.CurrentUser.userId,
                                         value.fieldValue, "");
                }
            }
        }