AddDefaultSchema() public method

Adds a default document schema to be sent in all requests.
For more details about schemas, check Nuxeo Documentation Center.
public AddDefaultSchema ( string schema ) : Client
schema string A string containing the schema's name.
return Client
        public BusinessObjects()
        {
            client = new Client(Config.ServerUrl());
            client.AddDefaultSchema("dublincore");

            // populate
            document = (Document)client.DocumentFromPath("/").Post(new Document
            {
                Type = "Folder",
                Name = "bofolder",
                Properties = new Properties { { "dc:title", "Just a folder" } }
            }).Result;
        }
        public WorkflowAdapters()
        {
            client = new Client(Config.ServerUrl());
            client.AddDefaultSchema("dublincore");

            // populate
            document = (Document)client.DocumentFromPath("/").Post(new Document
            {
                Type = "File",
                Name = "JustAfile",
                Properties = new Properties { { "dc:title", "Just a file" } }
            }).Result;
        }
        public ContentEnrichers()
        {
            client = new Client(Config.ServerUrl());
            client.AddDefaultSchema("dublincore");

            // populate
            testDocument = (Document)client.DocumentFromPath("/").Post(new Document
            {
                Type = "Folder",
                Name = "folder2",
                Properties = new Properties { { "dc:title", "A Folder 2" } }
            }).Result;
        }
示例#4
0
        public BatchUpload()
        {
            client = new Client(Config.ServerUrl());
            client.AddDefaultSchema("*");

            // populate
            testFolder = (Document)client.DocumentFromPath("/").Post(new Document
            {
                Type = "Folder",
                Name = "TestFolder3",
                Properties = new Properties { { "dc:title", "Upload Test Folder" } }
            }).Result;
        }
示例#5
0
        public BlobUpload()
        {
            client = new Client(Config.ServerUrl());
            client.AddDefaultSchema("dublincore");

            // populate
            blobsFolder = (Document)client.Operation("Document.Create")
                                                   .SetInput("doc:/")
                                                   .SetParameter("type", "Folder")
                                                   .SetParameter("name", "TestBlobs")
                                                   .SetParameter("properties", new ParamProperties { { "dc:title", "Blob Operations" } })
                                                   .Execute()
                                                   .Result;

            blobContainer = (Document)client.Operation("Document.Create")
                                            .SetInput("doc:" + blobsFolder.Path)
                                            .SetParameter("type", "File")
                                            .SetParameter("name", "MyFileWithPics")
                                            .SetParameter("properties", new ParamProperties { { "dc:title", "My File With Pics" } })
                                            .Execute()
                                            .Result;
        }
示例#6
0
        public Adapters()
        {
            client = new Client(Config.ServerUrl());
            client.AddDefaultSchema("dublincore");

            // populate
            folder = (Document)client.DocumentFromPath("/").Post(new Document
            {
                Type = "Folder",
                Name = "TestFolder4",
                Properties = new Properties { { "dc:title", "Adapter Tests" } }
            }).Result;
            Assert.NotNull(folder);

            Document document = (Document)client.DocumentFromPath(folder.Path).Post(new Document
            {
                Type = "File",
                Name = "TestFile1",
                Properties = new Properties { { "dc:title", "File 1" } }
            }).Result;
            Assert.NotNull(document);

            document = (Document)client.DocumentFromPath(folder.Path).Post(new Document
            {
                Type = "File",
                Name = "TestFIle2",
                Properties = new Properties { { "dc:title", "File 2" } }
            }).Result;
            Assert.NotNull(document);

            Blob blob = Blob.FromFile("Puppy.docx");
            document = (Document)client.Operation("FileManager.Import")
                                       .SetInput(blob)
                                       .SetContext("currentDocument", folder.Path)
                                       .Execute()
                                       .Result;
        }
示例#7
0
 public Marshalling()
 {
     client = new Client(Config.ServerUrl());
     client.AddDefaultSchema("dublincore");
     creationFields = @"[
     {
     ""fieldType"": ""string"",
     ""description"": ""desc field0"",
     ""roles"": [
     ""Decision"",
     ""Score""
     ],
     ""name"": ""field0"",
     ""columnName"": ""col0"",
     ""sqlTypeHint"": ""whatever""
     },
     {
     ""fieldType"": ""string"",
     ""description"": ""desc field1"",
     ""roles"": [
     ""Decision"",
     ""Score""
     ],
     ""name"": ""field1"",
     ""columnName"": ""col1"",
     ""sqlTypeHint"": ""whatever""
     },
     {
     ""fieldType"": ""string"",
     ""description"": ""desc field2"",
     ""roles"": [
     ""Decision"",
     ""Score""
     ],
     ""name"": ""field2"",
     ""columnName"": ""col2"",
     ""sqlTypeHint"": ""whatever""
     },
     {
     ""fieldType"": ""string"",
     ""description"": ""desc field3"",
     ""roles"": [
     ""Decision"",
     ""Score""
     ],
     ""name"": ""field3"",
     ""columnName"": ""col3"",
     ""sqlTypeHint"": ""whatever""
     },
     {
     ""fieldType"": ""string"",
     ""description"": ""desc field4"",
     ""roles"": [
     ""Decision"",
     ""Score""
     ],
     ""name"": ""field4"",
     ""columnName"": ""col4"",
     ""sqlTypeHint"": ""whatever""
     }
     ]";
     updateFields = @"[
     {
     ""fieldType"":""string"",
     ""description"":""desc fieldA"",
     ""name"":""fieldA"",
     ""columnName"":""colA"",
     ""sqlTypeHint"":""whatever""
     },
     {
     ""fieldType"":""string"",
     ""description"":""desc fieldB"",
     ""name"":""fieldB"",
     ""columnName"":""colB"",
     ""sqlTypeHint"":""whatever""
     }
     ]";
 }
示例#8
0
 public CRUD()
 {
     client = new Client(Config.ServerUrl());
     client.AddDefaultSchema("dublincore");
 }