Wednesday, 1 May 2019

Introduction Go Language


Go is an open source language to build reliable software in efficient way.

a.   Go is a compiled language.
b.   Go has clean and clear syntax
c.    Go has in built language support for concurrency
d.   Go is statically typed language
e.   Functions are first class citizens in Go
f.     Go initialize default values for uninitialized variables. For example, for the string default value is empty string.
g.   Go has good features that makes the development fast
h.   Go has only few keywords to remember
i.     Most of the computers now a days has multiple cores, but not all languages have efficient ways to utilize these multi cores. But Go has very good support to utilize multi core system in efficient way.
j.     Since Go has very good built-in support for concurrency features, you no need to depend on any threading libraries to develop concurrent applications.
k.    Go has in-built garbage collector, so you no need to take the overhead of managing application memory.
j. In Go, complex types are composed of smaller types. Go encourages composition.



Previous                                                 Next                                                 Home

go language tutorial

      Introduction Go Language
      Install and setup Go
      Go: Hello World Application
      Go language: Build executable
      Go: Primitive Data Types
      Go language: Print value and type of a variable
      Initialize multiple variables in one line
      = : Short Assignment statement
      Default or zero value
      Constants
      iota identifier
      Type Conversion
      Type Inference
      strings
      Concatenate strings
      multi line strings
      Arrays
      Arrays are passed by value
      Slices
      Get capacity of the slice
      Get number of elements in the slice
      Arrays vs slices
      Slices are passed by reference
      Iterate over a slice using range keyword
      Get slice from a slice
      _ symbol
      Append an element to a slice
      Map data structure
      Define map using literal notation
      Get number of items in a map
      Check whether an item exists in map or not
      Delete item from the map
      Print all the keys of map
      Print key, value from map
      if statement
      if-else statement
      if statement: combine initialisation and condition evaluation in same line
      switch statement
      switch without an expression
      for loop
      Use for loop as while loop
      Print elements of array
      Iterate over a map
      Read data from console or user
      Create a function
      Pass by Reference
      Variadic Functions
      Return a value from function
      Anonymous functions
      Functions continued
      return Error from a function
      Structs
      Construct an object to a structure using &
      struct literal notation
      constructor functions
      Adding Methods to a struct
      Interfaces
      Importing multiple packages
      defer the function execution
      Pointers
      Structure pointers
       Read content type from a url
      Exit the program with given status code
      Goroutines

Previous                                                 Next                                                 Home

Monday, 29 April 2019

CMIS: Set extensions to an object


By getting the ObjectData, we can set the extensions to an object.

Below method is used to set the extensions to an object.

         private static void setExtensions(ObjectData objData) {
                  CmisExtensionElement leafExtension1 = new CmisExtensionElementImpl("", "confidentialLevel", null,
                                    "confidential");
                  CmisExtensionElement leafExtension2 = new CmisExtensionElementImpl("", "rootFolderId", null, "folder_1234");
                  CmisExtensionElement leafExtension3 = new CmisExtensionElementImpl("", "classification", null, "public");

                  List<CmisExtensionElement> list = new ArrayList<>();
                  list.add(leafExtension1);
                  list.add(leafExtension2);
                  list.add(leafExtension3);

                  CmisExtensionElement parentExtension = new CmisExtensionElementImpl("", "parentExtension", null, list);

                  List<CmisExtensionElement> extensions = Collections.singletonList(parentExtension);

                  objData.setExtensions(extensions);
         }



Previous                                                 Next                                                 Home