/*
    Copyright 2020 Siemens Digital Industries Software
    ==================================================
    Copyright 2014.
    Siemens Product Lifecycle Management Software Inc.
    All Rights Reserved.
    ==================================================
    Copyright 2020 Siemens Digital Industries Software
*/

/**
    @file

    This file implements Lifecycle Interoperability service extended resource.

*/

#ifndef LIS0LISFMWRK_IEXTENDEDRESOURCE_HXX
#define LIS0LISFMWRK_IEXTENDEDRESOURCE_HXX

#include <map>
#include <string>
#include <vector>

#include <base_utils/TcBaseTypes.hxx> 
#include <Lis0lisfmwrk/toolkit/IResource.hxx>
#include <Lis0lisfmwrk/libLis0lisfmwrk_exports.h>

/**
    @defgroup LIS0LISFMWRK Lifecycle Interoperability Services Framework IExtendedResource class
    @ingroup TC 

    A resource that can hold unknown properties and content. 
    <br/>If a setter is not found for a property when reading a resource, it is added as an extended property. 
    <br/>These extended properties are preserved when writing the resource back out, for instance on a PUT request. 
    <br/>In Open Services for Lifecycle Collaboration (OSLC), clients must preserve unknown content when performing updates of resources.
    @{
*/

namespace lis0lisfmwrk
{
    class Property;
    class IExtendedResource;
}

class LIS0LISFMWRK_API lis0lisfmwrk::IExtendedResource
    : public lis0lisfmwrk::IResource
{
public:

    /** Contructor */
    IExtendedResource();

    /** Destructor */
    virtual ~IExtendedResource();

    /**
    * Sets resource type values
    * @param [in] types Resource types to be set on the resource
    * @returns void
    */
    virtual void setTypes( const std::vector<std::string>& types ) = 0;

    /**
    * Retrieves the resource type values
    * @returns list of types set on the resource
    */
    virtual std::vector<std::string> getTypes() = 0;

    /**
    * Retrieves the the resource type value
    * @param [in] types Resource type set on the resource
    * @returns void
    */
    virtual std::string getType() = 0;

     /**
    * Sets resource type value
    * @param [in] types Resource type to be set on the resource
    * @returns void
    */
    virtual void addType( const std::string& type ) = 0;

    /**
    * Adds namespace URL to the list
    * @param [in] key Resource namespace key i.e. prefix
    * @param [in] value Resource namespace value i.e. URL
    * @returns void
    */
    virtual void addNamespace( const std::string& value, const std::string& key ) = 0;

    /**
    * Retrieves the namespace URL prefix for a given URL
    * @param [in] url Namespace URL of the Resource
    * @param [in] isNull Flag if output is null or not
    * @returns namespace prefix of the Resource
    */
    virtual std::string getNamespacePrefix( const std::string& url, bool &isNull ) = 0;

    /**
    * Retrieves the namespace URL for a given prefix 
    * @param [in] prefix Namespace prefix of the Resource
    * @param [in] isNull Flag if output is null or not
    * @returns Namespace URL of the Resource 
    */
    virtual std::string getNamespaceURL( const std::string& prefix, bool &isNull ) = 0;

     /**
    * Retrieves the namespace prefix and URL list
    * @returns namespace prefix and URl map of the resource
    */
    virtual std::map<std::string, std::string> getNamespaces() = 0;

    /**
    * Adds Linked data property to the property map
    * @param [in] key Resource property name with prefix 
    * @param [in] value Resouce property to add
    * @returns void
    */
    virtual void addProperty( lis0lisfmwrk::Property* value, const std::string& key ) = 0;

    /**
    * Retrieves the Linked data property from the property map
    * @param [in] key Resource property name with prefix
    * @returns Linked data property of the Resource 
    */
    virtual lis0lisfmwrk::Property* getProperty( const std::string& key ) = 0;

    /**
    * Retrieves all the Linked data properties of the Resource
    * @returns Linked data property map of the Resource
    */
    virtual std::map<std::string, lis0lisfmwrk::Property*> getProperties() = 0;

    /**
    * Adds extended Linked data property to the extended property map of the Resource
    * @param [in] key Resource property name with prefix 
    * @param [in] value Resource property to add
    * @returns void
    */
    virtual void addExtendedProperty( lis0lisfmwrk::Property* value, const std::string& key  ) = 0;

    /**
    * Retrieves the extended Linked data property from the extended property map for a given key
    * @param [in] key Resource property name with prefix
    * @returns Linked data property of the Resource
    */
    virtual lis0lisfmwrk::Property* getExtendedProperty( const std::string& key ) = 0;

    /**
    * Retrieves all the Extended Linked data properties
    * @returns Extended Linked data property map
    */
    virtual std::map<std::string, lis0lisfmwrk::Property*> getExtendedProperties() = 0;

    /**
    * Adds XML literal property to the property map
    * @param [in] str XML literal property value of the Resource
    * @param [in] key Resource property name with prefix 
    * @returns void
    */
    virtual void addXmlLiteralPropertyValue( const std::string& str, const std::string& key ) = 0;

    /**
    * Retrieves the XML literal property from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns XML literal property value of the Resource
    */
    virtual std::string getXmlLiteralPropertyValue( const std::string& key ) = 0;

    /**
    * Adds simple string property to the property map
    * @param [in] str simple string property value of the Resource
    * @param [in] key Resource property name with prefix 
    * @returns void
    */
    virtual void addSimpleStringPropertyValue( const std::string& str, const std::string& key ) = 0;

    /**
    * Retrieves the simple string property from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns string Property value of the Resource
    */
    virtual std::string getSimpleStringPropertyValue( const std::string& key ) = 0;

    /**
    * Adds resource property to the property map
    * @param [in] str Property value of the Resource
    * @param [in] key Resource property name with prefix 
    * @returns void
    */
    virtual void addResourcePropertyValue( const std::string& str, const std::string& key ) = 0;

    /**
    * Retrieves the resource property from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns string Property value of the Resource
    */
    virtual std::string getResourcePropertyValue( const std::string& key ) = 0;

    /**
    * Retrieves the resource properties from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns string Property values of the Resource
    */
    virtual std::vector<std::string> getResourcePropertyValues( const std::string& key ) = 0;

    /**
    * Adds boolean property to the property map
    * @param [in] str Boolean property value of the Resource
    * @param [in] key Resource property name with prefix 
    * @returns void
    */
    virtual void addBoolDataPropertyValue( const bool& value, const std::string& key  ) = 0;

    /**
    * Retrieves the boolean property from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns boolean Property value of the Resource
    */
    virtual bool getBoolDataPropertyValue( const std::string& key, bool &isNull ) = 0;
     /**
    * Retrieves the boolean properties from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns boolean Property values of the Resource
    */
    virtual Teamcenter::BoolVector getBoolDataPropertyValues( const std::string& key ) = 0;
    
    /**
    * Adds double property to the property map
    * @param [in] str Double property value of the Resource
    * @param [in] key Resource property name with prefix 
    * @returns void
    */
    virtual void addDoubleDataPropertyValue( const double& value, const std::string& key  ) = 0;

    /**
    * Retrieves the double property from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns double Property value of the Resource
    */
    virtual double getDoubleDataPropertyValue( const std::string& key, bool &isNull ) = 0;

    /**
    * Retrieves the double properties from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns double Property values of the Resource
    */
    virtual Teamcenter::DoubleVector getDoubleDataPropertyValues( const std::string& key ) = 0;
    /**
    * Retrieves the float property from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns float Property value of the Resource
    */
    virtual void addFloatDataPropertyValue( const double& value, const std::string& key  ) = 0;

    /**
    * Retrieves the float property from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns float Property value of the Resource
    */
    virtual double getFloatDataPropertyValue( const std::string& key, bool &isNull ) = 0;

    /**
    * Retrieves the float properties from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns float Property values of the Resource
    */
    virtual Teamcenter::DoubleVector getFloatDataPropertyValues( const std::string& key ) = 0;

    /**
    * Adds decimal property to the property map
    * @param [in] str Decimal property value of the Resource
    * @param [in] key Resource property name with prefix 
    * @returns void
    */
    virtual void addDecimalDataPropertyValue( const double& value, const std::string& key  ) = 0;

    /**
    * Retrieves the decimal property from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns decimal Property value of the Resource
    */
    virtual double getDecimalDataPropertyValue( const std::string& key, bool &isNull ) = 0;

    /**
    * Retrieves the decimal properties from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns decimal Property values of the Resource
    */
    virtual Teamcenter::DoubleVector getDecimalDataPropertyValues( const std::string& key ) = 0;

    /**
    * Adds integer property to the property map
    * @param [in] str Integer property value of the Resource
    * @param [in] key Resource property name with prefix 
    * @returns void
    */
    virtual void addIntDataPropertyValue( const int& value, const std::string& key  ) = 0;

    /**
    * Retrieves the integer property from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns integer Property value of the Resource
    */
    virtual int getIntDataPropertyValue( const std::string& key, bool &isNull ) = 0;

    /**
    * Retrieves the integer properties from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns integer Property value of the Resource
    */
    virtual Teamcenter::IntVector getIntDataPropertyValues( const std::string& key ) = 0;

    /**
    * Adds string property to the property map
    * @param [in] str String property value of the Resource
    * @param [in] key Resource property name with prefix
    * @returns void
    */
    virtual void addStringDataPropertyValue( const std::string& value, const std::string& key  ) = 0;

    /**
    * Retrieves the string property from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns Resource property value string
    */
    virtual std::string getStringDataPropertyValue( const std::string& key, bool &isNull ) = 0;

    /**
    * Retrieves the string properties from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns string Property values of the Resource.
    */
    virtual std::vector<std::string> getStringDataPropertyValues( const std::string& key ) = 0;

    /**
    * Adds DateTime property to the property map
    * @param [in] str DateTime property value of the Resource
    * @param [in] key Resource property name with prefix 
    * @returns void
    */
    virtual void addDateTimePropertyValue( const date_t& value, const std::string& key  ) = 0;

     /**
    * Retrieves the DateTime property from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns DateTime Property value of the Resource
    */
    virtual date_t getDateTimePropertyValue( const std::string& key, bool &isNull ) = 0;

    /**
    * Retrieves the DateTime properties from the property map for a given key
    * @param [in] key Resource property name with prefix 
    * @returns DateTime Property values of the Resource
    */
    virtual Teamcenter::DateVector getDateTimePropertyValues( const std::string& key ) = 0;

private:

    /** Copy Constructor */
    IExtendedResource( const IExtendedResource& );

    /** Assignment Operator */
    IExtendedResource& operator=(const IExtendedResource& );

};

/** @} */

#include <Lis0lisfmwrk/libLis0lisfmwrk_undef.h>
#endif
