Class View

  • All Implemented Interfaces:
    java.io.Serializable

    public class View
    extends java.lang.Object
    implements java.io.Serializable
    View definition
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  View.Item
      View item
    • Constructor Summary

      Constructors 
      Constructor Description
      View()
      Generated view without id
      View​(View view)
      Copy constructor
      View​(java.lang.String id)
      Constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addGroup​(java.lang.String group)
      Set the groups to activate (home page only)
      View.Item addItem​(java.lang.String id, int pos, char type, java.lang.String content, java.util.Map<java.lang.String,​java.lang.String> params, java.lang.String searchSpec, boolean title, java.util.HashMap<java.lang.String,​java.lang.String> display)
      Add one item to the view
      void addLanguages​(java.lang.String langs)
      Add supported languages to scope
      void collapse​(ObjectDB obj)  
      void extend​(ObjectDB obj)  
      java.lang.String getCodeEditorTheme()
      Get the code editor theme name
      java.lang.String getDisplay​(java.lang.String lang)
      Get translation
      java.lang.String getDisposition()
      Get the disposition to activate when this home page is selected
      java.lang.String getFaviconURL​(int size)
      Get favicon URL
      java.lang.String getFont()
      Get the font name
      java.util.List<java.lang.String> getGroups()
      Get the groups to activate when this home page is selected
      DocumentDB getHeaderLogo()
      Get logo for header usage (horizontal)
      java.lang.String getHelp​(java.lang.String lang)
      Get help
      java.lang.String getHtmlEditorTheme()
      Get the HTML editor theme name
      java.lang.String getIcon()
      Get the icon code
      java.lang.String getIcon​(Grant g, java.lang.String defaultIcon, java.lang.String size, java.lang.String cls)
      Get the icon as i, span or img
      java.lang.String getIconSet()
      Get the icon set name
      java.lang.String getIconURL​(Grant g, java.lang.String defaultIcon)
      Get the icon URL
      java.lang.String getId()
      View id (or null in case of generated view of link)
      View.Item getItem​(int i)
      Get one item at index
      View.Item getItemAtPos​(int pos)
      Get one item at position
      static ObjectDB getItemObject​(Grant g, View.Item item, boolean bHome, ObjectDB parent, boolean ajax)
      Parse the item to find the object (if any)
      java.util.List<View.Item> getItems()
      Get all items
      java.lang.String getLanguage()
      Get one supported languages
      java.util.List<java.lang.String> getLanguages()
      Get all supported languages (null means all languages)
      DocumentDB getLogo()
      Get theme logo for scope usage (plain or large)
      java.lang.String getLogo​(boolean header)
      Logo inlined source in base64
      java.lang.String getName()
      Get view name
      static ObjectDB getObjectInstance​(Grant g, boolean home, java.lang.String objName, java.lang.String ext, java.lang.String subSearch, boolean ajax)
      The only way to instantiate one object in the view
      int getOrder()
      Order in link panels
      java.lang.String getReference()
      Get the reference field name when view contains a link
      java.lang.String getScope()
      Get the scope name
      DocumentDB getStyles()
      Get styles document
      java.lang.String getTarget()
      Get the view name or the object name when view contains a link
      java.lang.String getTheme()
      Get the theme
      java.lang.String getUITemplate()
      UI Template for front usage
      static java.lang.String getViewId​(java.lang.String name)
      Get view ID for specified view name
      static java.lang.String getViewModuleId​(java.lang.String id)
      Get view's module ID for specified view ID
      static java.lang.String getViewName​(java.lang.String id)
      Get view name for specified view ID
      boolean hasLanguage​(java.lang.String lang)
      Supports one language?
      boolean isCollapsed()
      Is the object view collapsed ?
      boolean isCompact()
      Is UI compacted ?
      boolean isExtended()
      Is the object view extended ?
      boolean isFormEmbedded()
      Is embedded in object form ?
      boolean isVisible()
      Is the view visible ?
      void setCodeEditorTheme​(java.lang.String name)
      Set the code editor theme name
      void setCollapsed​(ObjectDB obj, boolean collapse)
      Change the collapse flag of the object view
      void setCompact​(boolean compact)
      Set the compact mode
      void setDisplay​(java.lang.String lang, java.lang.String disp, java.lang.String help)  
      void setDisplay​(java.util.HashMap<java.lang.String,​java.lang.String> d)
      Set translations
      void setDisposition​(java.lang.String disp)
      Set the home page disposition (home page only)
      void setFavicon​(java.lang.String docId)
      Set favicon from document
      void setFaviconURL​(int size, java.lang.String url)
      Set favicon URL
      void setFont​(java.lang.String name)
      Set the font name
      void setFormEmbedded​(boolean b)
      Set embedded in object form ?
      void setHeaderLogo​(java.lang.String docId)
      Set document ID for the logo for header usage
      void setHelp​(java.util.HashMap<java.lang.String,​java.lang.String> h)
      Set helps
      void setHtmlEditorTheme​(java.lang.String name)
      Set the HTML editor theme name
      void setIcon​(java.lang.String icon)
      Set the icon code
      void setIconSet​(java.lang.String name)
      Set the icon set
      void setLogo​(java.lang.String docId)
      Set document ID for the logo for scope usage
      void setName​(java.lang.String n)
      Set view name
      void setOrder​(int i)  
      void setScope​(java.lang.String scope)
      Set the scope name
      void setStyles​(java.lang.String docId)
      Set styles document ID
      void setTheme​(java.lang.String name)
      Set the theme name
      void setUITemplate​(java.lang.String t)  
      void setVisible​(boolean vis)  
      java.lang.String toJSON​(Grant g, ObjectDB parent, boolean home)
      View metadata as JSON string
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • View

        public View()
        Generated view without id
      • View

        public View​(java.lang.String id)
        Constructor
        Parameters:
        id - View id or null if generated
      • View

        public View​(View view)
        Copy constructor
        Parameters:
        view - View to copy
    • Method Detail

      • getId

        public java.lang.String getId()
        View id (or null in case of generated view of link)
      • getViewId

        public static java.lang.String getViewId​(java.lang.String name)
        Get view ID for specified view name
        Parameters:
        name - View name
        Returns:
        View ID
      • getViewName

        public static java.lang.String getViewName​(java.lang.String id)
        Get view name for specified view ID
        Parameters:
        id - View ID
        Returns:
        View name
      • getViewModuleId

        public static java.lang.String getViewModuleId​(java.lang.String id)
        Get view's module ID for specified view ID
        Parameters:
        id - View ID
        Returns:
        View module ID
      • getName

        public java.lang.String getName()
        Get view name
        Returns:
        View name
      • setName

        public void setName​(java.lang.String n)
        Set view name
        Parameters:
        n - View name
      • getTarget

        public java.lang.String getTarget()
        Get the view name or the object name when view contains a link
      • getReference

        public java.lang.String getReference()
        Get the reference field name when view contains a link
      • getDisplay

        public java.lang.String getDisplay​(java.lang.String lang)
        Get translation
        Parameters:
        lang - Language
        Returns:
        Translation
      • setDisplay

        public void setDisplay​(java.util.HashMap<java.lang.String,​java.lang.String> d)
        Set translations
        Parameters:
        d - Translations map
      • getHelp

        public java.lang.String getHelp​(java.lang.String lang)
        Get help
        Parameters:
        lang - Language
        Returns:
        Help (HTML content)
      • setHelp

        public void setHelp​(java.util.HashMap<java.lang.String,​java.lang.String> h)
        Set helps
        Parameters:
        h - Helps maps
      • setDisplay

        public void setDisplay​(java.lang.String lang,
                               java.lang.String disp,
                               java.lang.String help)
      • getOrder

        public int getOrder()
        Order in link panels
      • setOrder

        public void setOrder​(int i)
      • getUITemplate

        public java.lang.String getUITemplate()
        UI Template for front usage
      • setUITemplate

        public void setUITemplate​(java.lang.String t)
      • getHeaderLogo

        public DocumentDB getHeaderLogo()
        Get logo for header usage (horizontal)
        Returns:
        Document
      • setHeaderLogo

        public void setHeaderLogo​(java.lang.String docId)
        Set document ID for the logo for header usage
        Parameters:
        docId - Document ID
      • getLogo

        public DocumentDB getLogo()
        Get theme logo for scope usage (plain or large)
        Returns:
        Document
      • setLogo

        public void setLogo​(java.lang.String docId)
        Set document ID for the logo for scope usage
        Parameters:
        docId - Document ID
      • getLogo

        public java.lang.String getLogo​(boolean header)
        Logo inlined source in base64
        Parameters:
        header - get the small logo for header?
      • getStyles

        public DocumentDB getStyles()
        Get styles document
        Returns:
        Document
      • setStyles

        public void setStyles​(java.lang.String docId)
        Set styles document ID
        Parameters:
        docId - Document ID
      • addItem

        public View.Item addItem​(java.lang.String id,
                                 int pos,
                                 char type,
                                 java.lang.String content,
                                 java.util.Map<java.lang.String,​java.lang.String> params,
                                 java.lang.String searchSpec,
                                 boolean title,
                                 java.util.HashMap<java.lang.String,​java.lang.String> display)
        Add one item to the view
        Parameters:
        id - Item ID
        pos - Item position
        type - Item type
        content - Content
        searchSpec - Search spec
        title - True to display the title
        display - Item translations
      • getItem

        public View.Item getItem​(int i)
        Get one item at index
      • getItemAtPos

        public View.Item getItemAtPos​(int pos)
        Get one item at position
      • getItems

        public java.util.List<View.Item> getItems()
        Get all items
      • isVisible

        public boolean isVisible()
        Is the view visible ?
      • setVisible

        public void setVisible​(boolean vis)
      • isCollapsed

        public boolean isCollapsed()
        Is the object view collapsed ?
      • isExtended

        public boolean isExtended()
        Is the object view extended ?
      • setCollapsed

        public void setCollapsed​(ObjectDB obj,
                                 boolean collapse)
        Change the collapse flag of the object view
      • collapse

        public void collapse​(ObjectDB obj)
      • extend

        public void extend​(ObjectDB obj)
      • getIcon

        public java.lang.String getIcon()
        Get the icon code
      • setIcon

        public void setIcon​(java.lang.String icon)
        Set the icon code
      • getIconURL

        public java.lang.String getIconURL​(Grant g,
                                           java.lang.String defaultIcon)
        Get the icon URL
      • getIcon

        public java.lang.String getIcon​(Grant g,
                                        java.lang.String defaultIcon,
                                        java.lang.String size,
                                        java.lang.String cls)
        Get the icon as i, span or img
      • isFormEmbedded

        public boolean isFormEmbedded()
        Is embedded in object form ?
      • setFormEmbedded

        public void setFormEmbedded​(boolean b)
        Set embedded in object form ?
      • getDisposition

        public java.lang.String getDisposition()
        Get the disposition to activate when this home page is selected
      • setDisposition

        public void setDisposition​(java.lang.String disp)
        Set the home page disposition (home page only)
      • getGroups

        public java.util.List<java.lang.String> getGroups()
        Get the groups to activate when this home page is selected
      • addGroup

        public void addGroup​(java.lang.String group)
        Set the groups to activate (home page only)
      • setScope

        public void setScope​(java.lang.String scope)
        Set the scope name
        Parameters:
        scope - Scope name
      • getScope

        public java.lang.String getScope()
        Get the scope name
        Returns:
        Scope name
      • setTheme

        public void setTheme​(java.lang.String name)
        Set the theme name
        Parameters:
        name - Theme name
      • getTheme

        public java.lang.String getTheme()
        Get the theme
        Returns:
        Theme name
      • addLanguages

        public void addLanguages​(java.lang.String langs)
        Add supported languages to scope
        Parameters:
        langs - Languages separated by ;
      • getLanguages

        public java.util.List<java.lang.String> getLanguages()
        Get all supported languages (null means all languages)
        Returns:
        Languages
      • getLanguage

        public java.lang.String getLanguage()
        Get one supported languages
        Returns:
        Language
      • hasLanguage

        public boolean hasLanguage​(java.lang.String lang)
        Supports one language?
        Parameters:
        lang - Language code
        Returns:
        true if language is supported
      • setFont

        public void setFont​(java.lang.String name)
        Set the font name
        Parameters:
        name - Font name
      • getFont

        public java.lang.String getFont()
        Get the font name
        Returns:
        Font name
      • setCompact

        public void setCompact​(boolean compact)
        Set the compact mode
        Parameters:
        compact - compact?
      • isCompact

        public boolean isCompact()
        Is UI compacted ?
        Returns:
        Compact or not
      • setIconSet

        public void setIconSet​(java.lang.String name)
        Set the icon set
        Parameters:
        name - Icon set name
      • getIconSet

        public java.lang.String getIconSet()
        Get the icon set name
        Returns:
        Icon set name
      • getFaviconURL

        public java.lang.String getFaviconURL​(int size)
        Get favicon URL
        Parameters:
        size - Icon size
        Returns:
        Favicon URL
      • setFaviconURL

        public void setFaviconURL​(int size,
                                  java.lang.String url)
        Set favicon URL
        Parameters:
        size - Size
        url - URL
      • setFavicon

        public void setFavicon​(java.lang.String docId)
        Set favicon from document
        Parameters:
        docId - Document ID
      • setCodeEditorTheme

        public void setCodeEditorTheme​(java.lang.String name)
        Set the code editor theme name
        Parameters:
        name - Code editor theme name
      • getCodeEditorTheme

        public java.lang.String getCodeEditorTheme()
        Get the code editor theme name
        Returns:
        Code editor name
      • setHtmlEditorTheme

        public void setHtmlEditorTheme​(java.lang.String name)
        Set the HTML editor theme name
        Parameters:
        name - HTML editor theme name
      • getHtmlEditorTheme

        public java.lang.String getHtmlEditorTheme()
        Get the HTML editor theme name
        Returns:
        HTML editor name
      • getItemObject

        public static ObjectDB getItemObject​(Grant g,
                                             View.Item item,
                                             boolean bHome,
                                             ObjectDB parent,
                                             boolean ajax)
        Parse the item to find the object (if any)
        Parameters:
        item - View item
        bHome - True if on home page
        parent - Optional parent object
        Returns:
        object or null
      • getObjectInstance

        public static ObjectDB getObjectInstance​(Grant g,
                                                 boolean home,
                                                 java.lang.String objName,
                                                 java.lang.String ext,
                                                 java.lang.String subSearch,
                                                 boolean ajax)
                                          throws java.lang.Exception
        The only way to instantiate one object in the view
        Throws:
        java.lang.Exception
      • toJSON

        public java.lang.String toJSON​(Grant g,
                                       ObjectDB parent,
                                       boolean home)
        View metadata as JSON string
        Parameters:
        g - Grant
        parent - Optional parent object
        home - Home page?
        Returns:
        JSON string