mn8 Language Reference | Index    

EnvHandler

SUMMARY: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTORS SUMMARY  NO OPERATORS  METHODS SUMMARYDETAIL: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTOR DETAILS  NO OPERATORS  METHOD DETAILS

Description

Helper concept to use mn8 environment variables. Env Handler concept can only read mn8 environment variables from memory.

URL format is : env://<path>

Possible options :

Usage

print the '/system/protocols/' names

                $x from "env:/system/protocols/"
                print $x

print the '/system/protocols/' names where names contains tp string

                $x from "env:/system/protocols/" options "filter"=Simplex.create("*tp")
                print $x

Version: 0.1
Authors:Szabo Csaba ()
Location:
Inherits: Concept, URIHandler

Constructor List

create (String $url)
top

Method List

static LogicalacceptsURI (String $uri)
LogicalcloseConnection
ConceptgetContent
Logicalinitialize (Map $options)
LogicalopenConnection
top
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getErrorHandler, getInheritedConcepts, getResourceURI, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML, setResourceURI
Methods inherited from: URIHandler
acceptsURI, closeConnection, getContent, initialize, openConnection, setContent

Detailed Constructor Info

create (String $url)
Parameters:
$url :The url to the location in the memory where the data will be stored.

Creates a new EnvHandler with the given $url.

top

Detailed Method Info

static acceptsURI (String $uri)
Parameters:
$uri :The uri which will be tested if it is acceptable by this handler.
Returns: Logical

Returns true if the given $uri is acceptable by this handler, false otherwise.

                print EnvHandler.acceptsURI("env://system/protocol")
                -- the result is --
                true
            

top
closeConnection
Returns: Logical

Returns true and close this connection.

                $url = "env://system/protocols"                                                                             
                $env = EnvHandler.create($url)                                                                              
                if $env.acceptsURI( $url ) then [                                                                           
                    $m typeof Map                                                                                           
                    if ( $env.initialize( $m ) ) then [                                                                         
                        if ( $env.openConnection ) then [                                                                     
                            print $env.getContent                                                                           
            
                            $env.closeConnection                                                                            
                    
                        ]                                                                                                   
                    ]                                                                                                       
                ] 
                -- the result is --
                env://system/protocols/mbox
                env://system/protocols/file
                env://system/protocols/beep
                env://system/protocols/google
                env://system/protocols/smtp
                env://system/protocols/env
                env://system/protocols/xmlrpc
                env://system/protocols/pop3
                env://system/protocols/mem 
                env://system/protocols/http
                env://system/protocols/ftp
             

top
getContent
Returns: Concept
Exceptions:
badURLException :
(Warning)
The URL isn't valid.

Returns the content of this handler.

                $url = "env://system/protocols"                                                                             
                $env = EnvHandler.create($url)                                                                              
                if $env.acceptsURI( $url ) then [                                                                           
                    $m typeof Map                                                                                           
                    if ( $env.initialize( $m ) ) then [                                                                         
                        if ( $env.openConnection ) then [                                                                     

                            print $env.getContent                                                                           
            
                            $env.closeConnection                                                                                                
                        ]                                                                                                   
                    ]                                                                                                       
                ] 
                -- the result is --
                env://system/protocols/mbox
                env://system/protocols/file
                env://system/protocols/beep
                env://system/protocols/google
                env://system/protocols/smtp
                env://system/protocols/env
                env://system/protocols/xmlrpc
                env://system/protocols/pop3
                env://system/protocols/mem 
                env://system/protocols/http
                env://system/protocols/ftp
             

top
initialize (Map $options)
Parameters:
$options : Contains a filter with which the returned content will be filtered.
Returns: Logical

Returns true.

                $url = "env://system/protocols"                                                                             
                $env = EnvHandler.create($url)                                                                              
                if $env.acceptsURI( $url ) then [                                                                           
                    $m typeof Map    
                                                                                       
                    if ( $env.initialize( $m ) ) then [                                                                         

                        if ( $env.openConnection ) then [                                                                     
                            print $env.getContent                                                                           
                            $env.closeConnection                                                                                                
                        ]                                                                                                   
                    ]                                                                                                       
                ] 
                -- the result is --
                env://system/protocols/mbox
                env://system/protocols/file
                env://system/protocols/beep
                env://system/protocols/google
                env://system/protocols/smtp
                env://system/protocols/env
                env://system/protocols/xmlrpc
                env://system/protocols/pop3
                env://system/protocols/mem 
                env://system/protocols/http
                env://system/protocols/ftp
             

top
openConnection
Returns: Logical

Returns true.

                $url = "env://system/protocols"                                                                             
                $env = EnvHandler.create($url)                                                                              
                if $env.acceptsURI( $url ) then [                                                                           
                    $m typeof Map    
                    if ( $env.initialize( $m ) ) then [                                                                         

                        if ( $env.openConnection ) then [                                                                     

                            print $env.getContent                                                                           
                            $env.closeConnection                                                                                                
                        ]                                                                                                   
                    ]                                                                                                       
                ] 
                -- the result is --
                env://system/protocols/mbox
                env://system/protocols/file
                env://system/protocols/beep
                env://system/protocols/google
                env://system/protocols/smtp
                env://system/protocols/env
                env://system/protocols/xmlrpc
                env://system/protocols/pop3
                env://system/protocols/mem 
                env://system/protocols/http
                env://system/protocols/ftp
             

top