class WirisPlugin::GenericParamsProviderImpl

Attributes

properties[RW]

Public Class Methods

new(properties) click to toggle source
Calls superclass method
# File lib/com/wiris/plugin/impl/GenericParamsProviderImpl.rb, line 12
def initialize(properties)
    super()
    self.properties = properties
end

Public Instance Methods

getParameter(param, dflt) click to toggle source
# File lib/com/wiris/plugin/impl/GenericParamsProviderImpl.rb, line 16
def getParameter(param, dflt)
    return PropertiesTools::getProperty(self.properties,param,dflt)
end
getParameters() click to toggle source
# File lib/com/wiris/plugin/impl/GenericParamsProviderImpl.rb, line 27
def getParameters()
    return self.properties
end
getRenderParameters(configuration) click to toggle source
# File lib/com/wiris/plugin/impl/GenericParamsProviderImpl.rb, line 30
def getRenderParameters(configuration)
    renderParams = PropertiesTools::newProperties()
    renderParameterList = configuration::getProperty(ConfigurationKeys::EDITOR_PARAMETERS_LIST,ConfigurationKeys::EDITOR_PARAMETERS_DEFAULT_LIST)::split(",")
    for i in 0..renderParameterList::length - 1
        key = renderParameterList[i]
        value = PropertiesTools::getProperty(self.properties,key)
        if value != nil
            PropertiesTools::setProperty(renderParams,key,value)
        end
        i+=1
    end
    return renderParams
end
getRequiredParameter(param) click to toggle source
# File lib/com/wiris/plugin/impl/GenericParamsProviderImpl.rb, line 19
def getRequiredParameter(param)
    parameter = PropertiesTools::getProperty(self.properties,param,nil)
    if parameter != nil
        return parameter
    else 
        raise Exception,("Error: parameter " + param) + " is required"
    end
end
getServiceParameters() click to toggle source
# File lib/com/wiris/plugin/impl/GenericParamsProviderImpl.rb, line 43
def getServiceParameters()
    serviceParams = PropertiesTools::newProperties()
    serviceParamListArray = Std::split(ConfigurationKeys::SERVICES_PARAMETERS_LIST,",")
    for i in 0..serviceParamListArray::length() - 1
        key = serviceParamListArray::_(i)
        value = PropertiesTools::getProperty(self.properties,key)
        if value != nil
            PropertiesTools::setProperty(serviceParams,key,value)
        end
        i+=1
    end
    return serviceParams
end