Skip to content

Configuring Library Descriptor

Siminov Framework edited this page Jan 17, 2016 · 17 revisions

Library Descriptor is the one who defines the properties of library.

                    <!-- Design Of LibraryDescriptor.xml -->

    <library-descriptor>

        <!-- General Properties Of Library -->
            <!-- Mandatory Field -->
        <property name="name">name_of_library</property>
	
            <!-- Optional Field -->
        <property name="description">description_of_library</property>

	
        <!-- Entity Descriptors Needed Under This Library Descriptor -->
	
            <!-- Optional Field -->
                <!-- Entity Descriptors -->
        <entity-descriptors>
            <entity-descriptor>name_of_database_descriptor.full_path_of_entity_descriptor_file</entity-descriptor>
        </entity-descriptors>
	 
	
        <!-- Service Descriptors -->
            <!-- Optional Field -->
            <!-- Service Descriptor -->
        <service-descriptors>
            <service-descriptor>full_path_of_service-descriptor_file</service-descriptor>
        </service-descriptors>
	
	
        <!-- Sync Descriptors -->
            <!-- Optional Field -->
            <!-- Sync Descriptor -->
        <sync-descriptors>
            <sync-descriptor>full_path_of_sync_descriptor_file</sync-descriptor>
        </sync-descriptors>
	
        <!-- Adapter Descriptors -->
            <!-- Optional Field -->
            <!-- Adapter Descriptor -->
        <adapter-descriptors>
            <adapter-descriptor>full_path_of_adapter_descriptor_file</adapter-descriptor>
        </adapter-descriptors>	
		
    </library-descriptor>
                 <!-- Android Sample: Library Descriptor -->

    <library-descriptor>

        <property name="name">SIMINOV-HYBRID-PHONEGAP-LIBRARY-SAMPLE</property>
        <property name="description">Siminov Hybrid Phonegap Library Sample</property>

        <entity-descriptors>
            <entity-descriptor>SIMINOV-HYBRID-PHONEGAP-SAMPLE.Credential.xml</entity-descriptor>
        </entity-descriptors>
	 
    </library-descriptor>
                 <!-- iOS Sample: Library Descriptor -->

    <library-descriptor>

        <property name="name">SIMINOV-HYBRID-PHONEGAP-LIBRARY-SAMPLE</property>
        <property name="description">Siminov Hybrid Phonegap Library Sample</property>

        <entity-descriptors>
            <entity-descriptor>SIMINOV-HYBRID-PHONEGAP-SAMPLE.Credential.xml</entity-descriptor>
        </entity-descriptors>
	 
    </library-descriptor>
                 <!-- Windows Sample: Library Descriptor -->

    <library-descriptor>

        <property name="name">SIMINOV-HYBRID-PHONEGAP-LIBRARY-SAMPLE</property>
        <property name="description">Siminov Hybrid Phonegap Library Sample</property>

        <entity-descriptors>
            <entity-descriptor>SIMINOV-HYBRID-PHONEGAP-SAMPLE.Credential.xml</entity-descriptor>
        </entity-descriptors>
	 
    </library-descriptor>

Note: Application Developer can provide their own properties also, and by using following API's they can use properties.

  • Get Properties - [Android:getProperties | iOS:getProperties | Windows:GetProperties | JavaScript:getProperties]: It will return all properties associated with Library Descriptor.

  • Get Property - [Android:getProperty(Name-of-Property) | iOS:getProperty:Name-of-Property | Windows:GetProperty(Name-of-Property) | JavaScript:getProperty(Name-of-Property)]: It will return property value associated with property name provided.

  • Contains Property - [Android:containsProperty(Name-of-Property) | iOS:containsProperty:Name-of-Property | Windows:ContainsProperty(Name-of-Property) | JavaScript:containsProperty(Name-of-Property)]: It will return TRUE/FALSE whether property exists or not.

  • Add Property - [Android:addProperty(Name-of-Property, Value-of-Property) | iOS:addProperty(Name-of-Property, Value-of-Property) | Windows:AddProperty(Name-of-Property, Value-of-Property) | JavaScript:addProperty(Name-of-Property, Value-of-Property)]: It will add new property to the collection of Library Descriptor properties.

  • Remove Property - [Android:removeProperty(Name-of-Property) | iOS:removeProperty:Name-of-Property | Windows:RemoveProperty(Name-of-Property) | JavaScript:removeProperty(Name-of-Property)]: It will remove property from Library Descriptor properties based on name provided.

Library Descriptor Elements

1. General properties about library
  • name*: Name of library. It is mandatory field.

  • descriptor: Description of library. It is optional field.

2. Entity descriptor paths needed under this database descriptor.

Note

  • Provide full entity descriptor file path if you have used xml format to define ORM.

  • Provide full class path of entity descriptor model class if you have used annotation to define ORM.

3. Service descriptor paths needed under the library
  • Provide full service descriptor file path.
4. Sync descriptor paths needed under the library
  • Provide full sync descriptor file path.
5. Adapter descriptor paths needed under this database descriptor.

Note

  • Provide full hybrid adapter file path.
Important points about library descriptor

Note

  • Library descriptor file name should be same as LibraryDescriptor.xml.

  • It should always be in root package specified in DatabaseDescriptor.xml file.

Android Sample: Library Descriptor


![Android Sample: Library Descriptor] (https://raw.github.com/Siminov/hybrid/docs/github/v2.0/library_descriptor_path.android.png "Android Sample: Library Descriptor")


iOS Sample: Library Descriptor


![iOS Sample: Library Descriptor] (https://raw.github.com/Siminov/hybrid/docs/github/v2.0/library_descriptor_path.ios.png "iOS Sample: Library Descriptor")