text:
All URIs are relative to *https://api.kinow.com/api*

Method | HTTP request | Description
------------- | ------------- | -------------
[**attach_director_to_category**](#attach_director_to_category) | **POST** /categories/{category_id}/directors |
[**attach_director_to_product**](#attach_director_to_product) | **POST** /products/{product_id}/directors |
[**create_director**](#create_director) | **POST** /directors |
[**delete_director**](#delete_director) | **DELETE** /directors/{director_id} |
[**detach_director_from_category**](#detach_director_from_category) | **DELETE** /categories/{category_id}/directors/{director_id} |
[**detach_director_from_product**](#detach_director_from_product) | **DELETE** /products/{product_id}/directors/{director_id} |
[**get_category_directors**](#get_category_directors) | **GET** /categories/{category_id}/directors |
[**get_director**](#get_director) | **GET** /directors/{director_id} |
[**get_director_cover_image**](#get_director_cover_image) | **GET** /directors/{director_id}/cover |
[**get_director_products**](#get_director_products) | **GET** /directors/{director_id}/products |
[**get_director_products_role**](#get_director_products_role) | **GET** /directors/{director_id}/products-role |
[**get_directors**](#get_directors) | **GET** /directors |
[**get_product_directors**](#get_product_directors) | **GET** /products/{product_id}/directors |
[**get_product_directors_role**](#get_product_directors_role) | **GET** /products/{product_id}/directors-role |
[**update_director**](#update_director) | **PUT** /directors/{director_id} |
[**upload_director_cover**](#upload_director_cover) | **POST** /directors/{director_id}/cover |

## **attach_director_to_category**
> attach_director_to_category(category_id, director_id)

Attach director to category

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
category_id = 789 # int | Category ID to fetch
director_id = 789 # int | Director ID to attach

try:
    api_instance.attach_director_to_category(category_id, director_id)
except ApiException as e:
    print("Exception when calling DirectorsApi->attach_director_to_category: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **category_id** | **int**| Category ID to fetch |
 **director_id** | **int**| Director ID to attach |

### Return type

void (empty response body)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

## **attach_director_to_product**
> attach_director_to_product(product_id, director_id)

Attach director to product

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
product_id = 789 # int | Product ID to fetch
director_id = 789 # int | Director ID to attach

try:
    api_instance.attach_director_to_product(product_id, director_id)
except ApiException as e:
    print("Exception when calling DirectorsApi->attach_director_to_product: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **product_id** | **int**| Product ID to fetch |
 **director_id** | **int**| Director ID to attach |

### Return type

void (empty response body)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

## **create_director**
> Director create_director(body)

Create new director

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
body = kinow_client.CreateDirectorRequest() # CreateDirectorRequest | Directory settings

try:
    api_response = api_instance.create_director(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DirectorsApi->create_director: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **body** | [**CreateDirectorRequest**](#CreateDirectorRequest)| Directory settings |

### Return type

[**Director**](#Director)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

## **delete_director**
> delete_director(director_id)

Delete director

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
director_id = 56 # int |

try:
    api_instance.delete_director(director_id)
except ApiException as e:
    print("Exception when calling DirectorsApi->delete_director: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **director_id** | **int**|  |

### Return type

void (empty response body)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

## **detach_director_from_category**
> detach_director_from_category(category_id, director_id)

Detach director from category

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
category_id = 789 # int | Category ID to fetch
director_id = 789 # int | Director ID to detach

try:
    api_instance.detach_director_from_category(category_id, director_id)
except ApiException as e:
    print("Exception when calling DirectorsApi->detach_director_from_category: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **category_id** | **int**| Category ID to fetch |
 **director_id** | **int**| Director ID to detach |

### Return type

void (empty response body)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

## **detach_director_from_product**
> detach_director_from_product(product_id, director_id)

Detach director from product

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
product_id = 789 # int | Product ID to fetch
director_id = 789 # int | Director ID to detach

try:
    api_instance.detach_director_from_product(product_id, director_id)
except ApiException as e:
    print("Exception when calling DirectorsApi->detach_director_from_product: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **product_id** | **int**| Product ID to fetch |
 **director_id** | **int**| Director ID to detach |

### Return type

void (empty response body)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

## **get_category_directors**
> CategoryDirectorsListResponse get_category_directors(category_id, page=page, per_page=per_page)

Get directors attached to category

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
category_id = 789 # int | Category ID to fetch
page = 789 # int |  (optional)
per_page = 789 # int |  (optional)

try:
    api_response = api_instance.get_category_directors(category_id, page=page, per_page=per_page)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DirectorsApi->get_category_directors: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **category_id** | **int**| Category ID to fetch |
 **page** | **int**|  | [optional]
 **per_page** | **int**|  | [optional]

### Return type

[**CategoryDirectorsListResponse**](#CategoryDirectorsListResponse)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

## **get_director**
> DirectorResponse get_director(director_id)

Get Director

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
director_id = 789 # int | Director ID to fetch

try:
    api_response = api_instance.get_director(director_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DirectorsApi->get_director: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **director_id** | **int**| Director ID to fetch |

### Return type

[**DirectorResponse**](#DirectorResponse)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

## **get_director_cover_image**
> ImageResponse get_director_cover_image(director_id)

Get cover image of a director

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
director_id = 789 # int | Director ID to fetch

try:
    api_response = api_instance.get_director_cover_image(director_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DirectorsApi->get_director_cover_image: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **director_id** | **int**| Director ID to fetch |

### Return type

[**ImageResponse**](#ImageResponse)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

## **get_director_products**
> DirectorProductListResponse get_director_products(director_id, page=page, per_page=per_page, sort_by=sort_by, sort_direction=sort_direction, ip=ip, features=features, filters=filters)

Get director products

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
director_id = 789 # int | Director ID to fetch
page = 789 # int |  (optional)
per_page = 789 # int |  (optional)
sort_by = 'sort_by_example' # str | Sort by this attribute (id by default) (optional)
sort_direction = 'sort_direction_example' # str | Sorting direction (asc by default) (optional)
ip = 'ip_example' # str | Filter by user IP (optional)
features = 'features_example' # str |  ``` features[*][value]=string&features[*][operator]=strict&features[1][value]=string&features[1][operator]=strict _______________  { \"*\": { \"value\": \"string\", \"operator\": \"strict\" }, \"1\": { \"value\": \"string\", \"operator\": \"contains\" } } ``` Operator can be: strict, contains, between, in, gt (greater than), lt (lower than). To search on all features, you can pass * as featureId. (optional)
filters = 'filters_example' # str |  ``` name[value]=string&name][operator]=contains&date_add[value]=string&date_add[operator]=lt _______________  { \"name\": { \"value\": \"string\", \"operator\": \"contains\" }, \"date_add\": { \"value\": \"string\", \"operator\": \"lt\" } } ``` Operator can be: strict, contains, between, in, gt (greater than), lt (lower than). (optional)

try:
    api_response = api_instance.get_director_products(director_id, page=page, per_page=per_page, sort_by=sort_by, sort_direction=sort_direction, ip=ip, features=features, filters=filters)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DirectorsApi->get_director_products: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **director_id** | **int**| Director ID to fetch |
 **page** | **int**|  | [optional]
 **per_page** | **int**|  | [optional]
 **sort_by** | **str**| Sort by this attribute (id by default) | [optional]
 **sort_direction** | **str**| Sorting direction (asc by default) | [optional]
 **ip** | **str**| Filter by user IP | [optional]
 **features** | **str**|  ``` features[*][value]=string&features[*][operator]=strict&features[1][value]=string&features[1][operator]=strict _______________  { \"*\": { \"value\": \"string\", \"operator\": \"strict\" }, \"1\": { \"value\": \"string\", \"operator\": \"contains\" } } ``` Operator can be: strict, contains, between, in, gt (greater than), lt (lower than). To search on all features, you can pass * as featureId. | [optional]
 **filters** | **str**|  ``` name[value]=string&name][operator]=contains&date_add[value]=string&date_add[operator]=lt _______________  { \"name\": { \"value\": \"string\", \"operator\": \"contains\" }, \"date_add\": { \"value\": \"string\", \"operator\": \"lt\" } } ``` Operator can be: strict, contains, between, in, gt (greater than), lt (lower than). | [optional]

### Return type

[**DirectorProductListResponse**](#DirectorProductListResponse)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

## **get_director_products_role**
> DirectorProductRoleListResponse get_director_products_role(director_id, page=page, per_page=per_page)

Get Products linked to Product with their role

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
director_id = 789 # int | Director ID to fetch
page = 789 # int |  (optional)
per_page = 789 # int |  (optional)

try:
    api_response = api_instance.get_director_products_role(director_id, page=page, per_page=per_page)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DirectorsApi->get_director_products_role: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **director_id** | **int**| Director ID to fetch |
 **page** | **int**|  | [optional]
 **per_page** | **int**|  | [optional]

### Return type

[**DirectorProductRoleListResponse**](#DirectorProductRoleListResponse)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

## **get_directors**
> DirectorListResponse get_directors(page=page, per_page=per_page)

Get directors list

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
page = 789 # int |  (optional)
per_page = 789 # int |  (optional)

try:
    api_response = api_instance.get_directors(page=page, per_page=per_page)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DirectorsApi->get_directors: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **page** | **int**|  | [optional]
 **per_page** | **int**|  | [optional]

### Return type

[**DirectorListResponse**](#DirectorListResponse)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

## **get_product_directors**
> DirectorListResponse get_product_directors(product_id, page=page, per_page=per_page, image_type=image_type)

Get directors of a product

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
product_id = 789 # int | Product ID to fetch
page = 789 # int |  (optional)
per_page = 789 # int |  (optional)
image_type = 'image_type_example' # str |  (optional)

try:
    api_response = api_instance.get_product_directors(product_id, page=page, per_page=per_page, image_type=image_type)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DirectorsApi->get_product_directors: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **product_id** | **int**| Product ID to fetch |
 **page** | **int**|  | [optional]
 **per_page** | **int**|  | [optional]
 **image_type** | **str**|  | [optional]

### Return type

[**DirectorListResponse**](#DirectorListResponse)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

## **get_product_directors_role**
> DirectorRoleListResponse get_product_directors_role(product_id, page=page, per_page=per_page)

Get Directors attached to Product with their role

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
product_id = 789 # int | Product ID to fetch
page = 789 # int |  (optional)
per_page = 789 # int |  (optional)

try:
    api_response = api_instance.get_product_directors_role(product_id, page=page, per_page=per_page)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DirectorsApi->get_product_directors_role: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **product_id** | **int**| Product ID to fetch |
 **page** | **int**|  | [optional]
 **per_page** | **int**|  | [optional]

### Return type

[**DirectorRoleListResponse**](#DirectorRoleListResponse)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

## **update_director**
> update_director(director_id, body)

Update director

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
director_id = 56 # int |
body = kinow_client.UpdateDirectorRequest() # UpdateDirectorRequest | Directory settings

try:
    api_instance.update_director(director_id, body)
except ApiException as e:
    print("Exception when calling DirectorsApi->update_director: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **director_id** | **int**|  |
 **body** | [**UpdateDirectorRequest**](#UpdateDirectorRequest)| Directory settings |

### Return type

void (empty response body)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

## **upload_director_cover**
> ImageResponse upload_director_cover(director_id, file=file, hash=hash, hash_algorithm=hash_algorithm)

Upload director cover

### Example
```python
from __future__ import print_statement
import time
import kinow_client
from kinow_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiClientId
kinow_client.configuration.api_key['X-Client-Id'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Id'] = 'Bearer'
# Configure API key authorization: ApiClientSecret
kinow_client.configuration.api_key['X-Client-Secret'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# kinow_client.configuration.api_key_prefix['X-Client-Secret'] = 'Bearer'

# create an instance of the API class
api_instance = kinow_client.DirectorsApi()
director_id = 3.4 # float | Director ID to fetch
file = '/path/to/file.txt' # file |  (optional)
hash = 'hash_example' # str |  (optional)
hash_algorithm = 'hash_algorithm_example' # str | Hash algorithm to check the hash file (default value is: sha256) (optional)

try:
    api_response = api_instance.upload_director_cover(director_id, file=file, hash=hash, hash_algorithm=hash_algorithm)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DirectorsApi->upload_director_cover: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **director_id** | **float**| Director ID to fetch |
 **file** | **file**|  | [optional]
 **hash** | **str**|  | [optional]
 **hash_algorithm** | **str**| Hash algorithm to check the hash file (default value is: sha256) | [optional]

### Return type

[**ImageResponse**](#ImageResponse)

### HTTP request headers

 - **Content-Type**: multipart/form-data
 - **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)


text:
Scope of Work

				{!! $proposal->{'project-scope-of-work-introduction'} !!}

The CTO will work with {{ $proposal->{'project-details-client-company-name'} }} to augment the organisation's strength in the following areas:

			@foreach( json_decode( $proposal->{'project-scope-of-work'} ) as $section )

{!! $section->{'section-title'} !!}

					@foreach( $section->{'section-items'} as $item )

{!! $item !!}

					@endforeach

			@endforeach

{!! $proposal->{'project-scope-of-work-end'} !!}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>ChartElement (MaltParser 1.8.1)</title>
<meta name="date" content="2014-11-22">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

MaltParser 1.8.1

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.maltparser.core.flow.system.elem

Class ChartElement

java.lang.Object

org.maltparser.core.flow.system.elem.ChartElement

public class ChartElement
extends java.lang.Object

Author:

Johan Hall

Constructor Summary

Constructors

Constructor and Description

ChartElement()

Method Summary

Methods

Modifier and Type
Method and Description

void
addAttribute(java.lang.String name,
                        ChartAttribute attribute)

ChartAttribute
getAttribute(java.lang.String name)

java.util.LinkedHashMap<java.lang.String,ChartAttribute>
getAttributes()

java.lang.Class<? extends ChartItem>
getChartItemClass()

java.lang.String
getItem()

void
read(org.w3c.dom.Element chartElem,
        FlowChartSystem flowChartSystem)

void
setItem(java.lang.String item)

java.lang.String
toString()

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

ChartElement

public ChartElement()

Method Detail

getItem

public java.lang.String getItem()

setItem

public void setItem(java.lang.String item)

addAttribute

public void addAttribute(java.lang.String name,
                ChartAttribute attribute)

getAttribute

public ChartAttribute getAttribute(java.lang.String name)

getChartItemClass

public java.lang.Class<? extends ChartItem> getChartItemClass()

getAttributes

public java.util.LinkedHashMap<java.lang.String,ChartAttribute> getAttributes()

read

public void read(org.w3c.dom.Element chartElem,
        FlowChartSystem flowChartSystem)
          throws MaltChainedException

Throws:

MaltChainedException

toString

public java.lang.String toString()

Overrides:

toString in class java.lang.Object

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

MaltParser 1.8.1

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright 2007-2014 Johan Hall, Jens Nilsson and Joakim Nivre.


text:
require 'rubygems'
require 'bundler/setup'
require 'dotenv'
require 'sinatra'
require 'haml'
require 'mediawiki_api'
require 'oauth'
require 'omniauth'
require 'omniauth-mediawiki'
require 'json'
require 'jbuilder'
require 'rest_client'
require './sinatra/utils/Hash'

if settings.environment == :development
  require 'debugger'
end

#--------------------------------------------------------
# Sinatra Config
#--------------------------------------------------------

set :views, './sinatra/views'
set :raise_errors, true
set :show_exceptions, true
set :dump_errors, true

#--------------------------------------------------------
# ENV Config
#--------------------------------------------------------

Dotenv.load

#--------------------------------------------------------
# Rack Middleware
#--------------------------------------------------------

use Rack::Session::Cookie, :path => '/', :expire_after => 172800, :secret => ENV['SESSION_SECRET']

# BUILD OMNIAUTH PROVIDER
use OmniAuth::Builder do
  provider :mediawiki, ENV["WIKI_KEY"], ENV["WIKI_SECRET"], :client_options => {:site => 'https://en.wikipedia.org'}
end

#--------------------------------------------------------
# Routes
#--------------------------------------------------------

# SET USER AGENT
before do
  headers "User-Agent" => ENV["WIKI_USER_AGENT"]
end

get '/' do
  @title = "Wikiedu Wizard"
  haml :login
end

get '/welcome' do
  ensure_logged_in
  @wikiuser = session['wiki_username']
  haml :app
end

get '/begin' do
  if session['session_id']
    redirect to '/welcome'
  else
    redirect to '/auth/mediawiki'
  end
end

# Use the /test endpoint for local development without OAuth login.
get '/test' do
  haml :app
end

post '/publish' do
  content_type :json
  @wizardData = params['wikitext']
  @conn = OAuth::Consumer.new(ENV["WIKI_KEY"], ENV["WIKI_SECRET"])
  @access_token = OAuth::AccessToken.new(@conn, session['access_token'], session['access_token_secret'])
  get_token = @access_token.get('https://en.wikipedia.org/w/api.php?action=query&meta=tokens&format=json')
  token_response = JSON.parse(get_token.body)
  csrf_token = token_response['query']['tokens']['csrftoken']
  apiAction = 'edit'
  req = @access_token.post('https://en.wikipedia.org/w/api.php', {:action => 'edit', :title => "User:#{session['wiki_username']}/#{params['course_title']}", :text => @wizardData, :format => 'json', :token => csrf_token } )
  response = JSON.parse(req.body)

  if response['edit']
    return { :success => true, :title => response['edit']['title'], :pageid =>  response['edit']['pageid'] , :result => response['edit']['result']}.to_json
  else
    return { :success => false, :result => response }.to_json
  end
end

get '/client' do
  @conn = OAuth::Consumer.new(ENV["WIKI_KEY"], ENV["WIKI_SECRET"])
  @access_token = OAuth::AccessToken.new(@conn, session['access_token'], session['access_token_secret'])
  get_token = @access_token.get('https://en.wikipedia.org/w/api.php?action=query&meta=tokens&format=json')
  token_response = JSON.parse(get_token.body)
  csrf_token = token_response['query']['tokens']['csrftoken']
  res = @access_token.post('https://en.wikipedia.org/w/api.php', {:action => 'query', :meta => 'userinfo', :format => 'json' } )
  userdata = JSON.parse(res.body)
  session['wiki_username'] = userdata['query']['userinfo']['name']
  redirect to '/welcome'
end

post '/publish_test' do
  return params['wikitext']
end

get '/output' do
  ensure_logged_in
  @bodyClass = 'output'
  haml :output
end

# MEDIAWIKI API OAUTH CALLBACK
get '/auth/:provider/callback' do
  @title = 'Wikiedu Wizard - OAuth'
  @auth = request.env['omniauth.auth']
  @access_token = request.env["omniauth.auth"]["extra"]["access_token"]
  session['access_token'] = @access_token.token
  session['access_token_secret'] = @access_token.secret
  redirect to '/client'
end

#--------------------------------------------------------
# Helpers
#--------------------------------------------------------

def ensure_logged_in
  unless session['wiki_username'] && session['access_token']
    redirect to '/'
  end
end


text:
#ifndef _ACTIVEMQ_CORE_ACTIVEMQSESSION_H_
#define _ACTIVEMQ_CORE_ACTIVEMQSESSION_H_

#include <cms/Session.h>
#include <cms/ExceptionListener.h>

#include <activemq/util/Config.h>
#include <activemq/core/kernels/ActiveMQConsumerKernel.h>
#include <activemq/core/kernels/ActiveMQProducerKernel.h>
#include <activemq/core/kernels/ActiveMQSessionKernel.h>
#include <activemq/commands/SessionInfo.h>

#include <decaf/lang/Pointer.h>

#include <string>
#include <memory>

namespace activemq{
namespace core{

    using decaf::lang::Pointer;
    using decaf::util::concurrent::atomic::AtomicBoolean;

    class ActiveMQConnection;

    class AMQCPP_API ActiveMQSession : public virtual cms::Session {
    protected:

        Pointer<activemq::core::kernels::ActiveMQSessionKernel> kernel;

    private:

        ActiveMQSession(const ActiveMQSession&);
        ActiveMQSession& operator=(const ActiveMQSession&);

    public:

        ActiveMQSession(Pointer<activemq::core::kernels::ActiveMQSessionKernel> kernel);

        virtual ~ActiveMQSession();

        /**
         * Stops asynchronous message delivery.
         */
        virtual void start();

        /**
         * Starts asynchronous message delivery.
         */
        virtual void stop();

        /**
         * Indicates whether or not the session is currently in the started
         * state.
         */
        bool isStarted() const {
            return this->kernel->isStarted();
        }

    public:   // Implements Methods

        virtual void close();

        virtual void commit();

        virtual void rollback();

        virtual void recover();

        virtual cms::MessageConsumer* createConsumer(const cms::Destination* destination);

        virtual cms::MessageConsumer* createConsumer(const cms::Destination* destination,
                                                     const std::string& selector);

        virtual cms::MessageConsumer* createConsumer(const cms::Destination* destination,
                                                     const std::string& selector,
                                                     bool noLocal);

        virtual cms::MessageConsumer* createDurableConsumer(const cms::Topic* destination,
                                                            const std::string& name,
                                                            const std::string& selector,
                                                            bool noLocal = false);

        virtual cms::MessageProducer* createProducer(const cms::Destination* destination);

        virtual cms::QueueBrowser* createBrowser(const cms::Queue* queue);

        virtual cms::QueueBrowser* createBrowser(const cms::Queue* queue, const std::string& selector);

        virtual cms::Queue* createQueue(const std::string& queueName);

        virtual cms::Topic* createTopic(const std::string& topicName);

        virtual cms::TemporaryQueue* createTemporaryQueue();

        virtual cms::TemporaryTopic* createTemporaryTopic();

        virtual cms::Message* createMessage();

        virtual cms::BytesMessage* createBytesMessage();

        virtual cms::BytesMessage* createBytesMessage(const unsigned char* bytes, int bytesSize);

        virtual cms::StreamMessage* createStreamMessage();

        virtual cms::TextMessage* createTextMessage();

        virtual cms::TextMessage* createTextMessage(const std::string& text);

        virtual cms::MapMessage* createMapMessage();

        virtual cms::Session::AcknowledgeMode getAcknowledgeMode() const {
            return this->kernel->getAcknowledgeMode();
        }

        virtual bool isTransacted() const {
            return this->kernel->isTransacted();
        }

        virtual void unsubscribe(const std::string& name);

   public:  // ActiveMQSession specific Methods

        /**
         * This method gets any registered exception listener of this sessions
         * connection and returns it.  Mainly intended for use by the objects
         * that this session creates so that they can notify the client of
         * exceptions that occur in the context of another thread.
         * @returns cms::ExceptionListener pointer or NULL
         */
        cms::ExceptionListener* getExceptionListener() {
            return this->kernel->getExceptionListener();
        }

        /**
         * Set an MessageTransformer instance that is passed on to all MessageProducer and MessageConsumer
         * objects created from this Session.
         *
         * @param transformer
         *      Pointer to the cms::MessageTransformer to set on all MessageConsumers and MessageProducers.
         */
        virtual void setMessageTransformer(cms::MessageTransformer* transformer) {
            this->kernel->setMessageTransformer(transformer);
        }

        /**
         * Gets the currently configured MessageTransformer for this Session.
         *
         * @returns the pointer to the currently set cms::MessageTransformer.
         */
        virtual cms::MessageTransformer* getMessageTransformer() const {
            return this->kernel->getMessageTransformer();
        }

        /**
         * Gets the Session Information object for this session, if the
         * session is closed than this method throws an exception.
         * @return SessionInfo Reference
         */
        const commands::SessionInfo& getSessionInfo() const {
            return this->kernel->getSessionInfo();
        }

        /**
         * Gets the Session Id object for this session, if the session
         * is closed than this method throws an exception.
         * @return SessionId Reference
         */
        const commands::SessionId& getSessionId() const {
            return this->kernel->getSessionId();
        }

        /**
         * Gets the ActiveMQConnection that is associated with this session.
         */
        ActiveMQConnection* getConnection() const {
            return this->kernel->getConnection();
        }

    };

}}

#endif /*_ACTIVEMQ_CORE_ACTIVEMQSESSION_H_*/


text:
BEGIN;
-- story_field_values -> answerSet
  SET @answer_offset =(SELECT IF((SELECT count(*) FROM systemEntity) > 0,(SELECT MAX(id) + 1 FROM systemEntity),1));
-- we drive the answerSet off stories; this is how it's all tied in the SYS1
  INSERT INTO systemEntity (id, version, created, lastModified)
    SELECT (id + @answer_offset),1, created_at, updated_at
      FROM stories s
      JOIN importRecord i ON i.sourceId=s.id
      WHERE i.sourceTable='stories';
  INSERT INTO answerSet (id, respondent, questionnaire, locale)
    SELECT (s.id + @answer_offset),
      (SELECT targetId FROM importRecord WHERE sourceTable='people' AND sourceId=s.person_id),
       -- luckilly, there's still one questionnaire per collection for
       -- the imported collections; this will allow us to tie to the
       -- questionnaire
      (SELECT q.id FROM questionnaire q JOIN collection c ON q.collection=c.id JOIN collection_story cs ON cs.collection=c.id WHERE cs.story=s.id AND c.id <= 48706), -- that's the max imported collection; later collections add stories to other collections
      'en'
      FROM stories s
      JOIN importRecord i ON i.sourceId=s.id
      WHERE i.sourceTable='stories';

  SET @rank := 0;
  INSERT INTO answer (answerSet, idx, label, displayValue, reportValue)
    SELECT answerSet, rank, name, displayValue, reportValue FROM
      (
       SELECT (s.id + @answer_offset) AS answerSet, @rank := @rank +1 AS rank , sf.name, sfv.content AS displayValue, sfv.content AS reportValue
         FROM story_field_values sfv
         JOIN story_fields sf ON sfv.story_field_id=sf.id
	 JOIN stories s ON sfv.story_id=s.id
	 JOIN importRecord i ON i.sourceId=s.id AND i.sourceTable='stories'
	 ORDER by sfv.id ASC
      ) AS tmp;
  INSERT INTO importRecord (sourceId, sourceTable, targetId, targetTable)
    SELECT s.id, 'stories', s.id + @answer_offset, 'answerSet'
      FROM stories s
      JOIN importRecord i ON i.sourceId=s.id
      WHERE i.sourceTable='stories';
COMMIT;


text:
from sqlalchemy import Column, ForeignKey
from sqlalchemy.sql.sqltypes import Boolean, BigInteger, Integer, CHAR, SmallInteger

from destiny.main.bdd import Base
from destiny.utils import rep_model

class TeamStats(Base):
    __tablename__ = 'teamstats'

    gameId = Column(BigInteger, ForeignKey("matches.gameId"), primary_key=True)
    teamId = Column(SmallInteger, primary_key=True)
    firstDragon =  Column(Boolean)
    firstInhibitor = Column(Boolean)
    baronKills = Column(SmallInteger)
    firstRiftHerald = Column(Boolean)
    firstBaron =  Column(Boolean)
    riftHeraldKills = Column(SmallInteger)
    firstBlood = Column(Boolean)
    firstTower = Column(Boolean)
    inhibitorKills = Column(SmallInteger)
    towerKills = Column(SmallInteger)
    win = Column(CHAR(6))
    dragonKills = Column(SmallInteger)

    def __repr__(self):
        return rep_model(self)


text:
LiipImagineBundle
=================

Overview
--------

The `LiipImagineBundle`_ package provides an *image manipulation abstraction toolkit*
for Symfony-based projects. Features include:

* :doc:`Filter Sets <basic-usage>`: Using any Symfony-supported configuration language
  (such as YML and XML), you can create *filter set* definitions that specify
  transformation routines. These include a set of *filters* and *post-processors*, as
  well as other, optional parameters.
* :doc:`Filters <filters>`: A number of built-in filters are provided, allowing for an array of
  common image transformations. Examples include :ref:`thumbnail <filter-thumbnail>`,
  :ref:`scale <filter-scale>`, :ref:`crop <filter-crop>`, :ref:`strip <filter-strip>`,
  and :ref:`watermark <filter-watermark>`, and many more. Additionally,
  :ref:`custom filters <filter-custom>` are supported.
* :doc:`Post-Processors <post-processors>`: A number of build-in post-processors are provided,
  allowing for the modification of the resulting binary file created by filters. Examples include
  :ref:`JpegOptim <post-processor-jpegoptim>`, :ref:`OptiPNG <post-processor-optipng>`,
  :ref:`MozJpeg <post-processor-mozjpeg>`, and :ref:`PngQuant <post-processor-pngquant>`. Additionally,
  :ref:`custom post-processors <post-processors-custom>` are supported.

Chapters
--------

Jump into any of the available chapters to learn more about anything from the basic
usage to the architecture of bundle.

.. toctree::
    :maxdepth: 2

    installation
    introduction
    basic-usage
    filters
    post-processors
    configuration
    data-loaders
    cache-resolvers
    cache-manager
    commands

.. _`LiipImagineBundle`: https://github.com/liip/LiipImagineBundle


text:
<?php
namespace Czim\CmsModels\Http\Controllers\Traits;

use Czim\CmsCore\Contracts\Core\CoreInterface;
use Czim\CmsCore\Contracts\Modules\ModuleInterface;
use Czim\CmsCore\Contracts\Modules\ModuleManagerInterface;
use Czim\CmsModels\Contracts\ModelInformation\Data\ModelInformationInterface;
use Czim\CmsModels\Contracts\ModelInformation\Data\Listing\ModelListParentDataInterface;
use Czim\CmsModels\Contracts\Repositories\ModelInformationRepositoryInterface;
use Czim\CmsModels\Contracts\Routing\RouteHelperInterface;
use Czim\CmsModels\Contracts\Support\ModuleHelperInterface;
use Czim\CmsModels\Contracts\Support\Session\ModelListMemoryInterface;
use Czim\CmsModels\Support\Data\ListParentData;
use Czim\CmsModels\ModelInformation\Data\ModelInformation;
use Czim\CmsModels\ModelInformation\Data\Listing\ModelListParentData;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\Relations\Relation;
use UnexpectedValueException;

trait DefaultModelListParentHandling
{

    /**
     * The current parent hierarchy 'breadcrumbs'.
     *
     * @var ListParentData[]
     */
    protected $listParents = [];

    /**
     * The current active list parent relation.
     *
     * String relation method name, or NULL to fall back to default (show everything or only top),
     * or FALSE to apply the opposite of the default.
     *
     * @var string|null|false
     */
    protected $listParentRelation;

    /**
     * The current active list parent record key.
     *
     * @var string
     */
    protected $listParentRecordKey;

    /**
     * Returns currently active list parent record key/indicator, if any.
     *
     * @return string|false|null
     */
    protected function getListParentRecordKey()
    {
        return $this->listParentRecordKey;
    }

    /**
     * Checks and loads list parent from the session.
     *
     * @param bool $update  whether to check for updates through the 'parent' request param
     * @return $this
     */
    protected function checkListParents($update = true)
    {
        if (empty($this->getModelInformation()->list->parents)) {
            return $this;
        }

        $this->retrieveActiveParentFromSession();
        $this->collectListParentHierarchy();

        if ($update) {
            $this->updateActiveParent();
        }

        $this->enrichListParents();

        return $this;
    }

    /**
     * Returns whether a list parent is currently active.
     *
     * @return bool
     */
    protected function hasActiveListParent()
    {
        return (bool) $this->listParentRelation;
    }

    /**
     * Returns whether the index will only show the top level parents.
     *
     * @return bool
     */
    protected function showsTopParentsOnly()
    {
        $relation = $this->getModelInformation()->list->default_top_relation;

        // If the default is to restrict to top-level only,
        // or the reverse with a user-initiated reversal (relation = false):
        // Restrict the query to top level.

        return $relation && false !== $this->listParentRelation;
    }

    /**
     * Applies the context for the current list parent scope.
     *
     * Must be called before other list memory is accessed, since it affects the sub-context of the memory.
     *
     * @return $this
     */
    protected function applyListParentContext()
    {
        $parents = $this->getModelInformation()->list->parents;

        if (empty($parents)) {
            return $this;
        }

        if ($this->listParentRelation) {
            $contextKey = $this->listParentRelation . $this->getListParentSeparator() . $this->listParentRecordKey;
        } else {
            $contextKey = null;
        }

        $this->getListMemory()->setSubContext($contextKey);

        return $this;
    }

    /**
     * Applies the active list parent as a filter on a query builder.
     *
     * @param Builder $query
     * @return $this
     */
    protected function applyListParentToQuery($query)
    {
        if ( ! $this->listParentRelation) {

            if ($this->showsTopParentsOnly()) {
                $query->has($this->getModelInformation()->list->default_top_relation, '<', 1);
            }

            return $this;
        }

        // Use list parent information collected to get the model
        /** @var ListParentData $parentInfo */
        $parentInfo = array_last($this->listParents);

        if ( ! $parentInfo) {
            return $this;
        }

        // For morph relation, we need a special query
        $relationInstance = $query->getModel()->{$this->listParentRelation}();
        if ($relationInstance instanceof MorphTo) {

            $separator = $this->getListParentMorphKeySeparator();

            // If parent record indicator $key does not contain class/key separator symbol, ignore
            if (false === strpos($this->listParentRecordKey, $separator)) {
                return $this;
            }

            list($parentType, $parentKey) = explode($separator, $this->listParentRecordKey, 2);

            $parentType = $this->getRelationMappedMorphType($parentType);

            $query
                ->withoutGlobalScopes()
                ->where($query->getModel()->getTable() . '.' . $relationInstance->getMorphType(), $parentType)
                ->where($relationInstance->getQualifiedForeignKeyName(), $parentKey);

            return $this;
        }

        $query->whereHas($this->listParentRelation, function ($query) use ($parentInfo) {
            /** @var Builder $query */
            $query
                ->withoutGlobalScopes()
                ->where($parentInfo->model->getKeyName(), $this->listParentRecordKey);
        });

        return $this;
    }

    /**
     * Looks up the current full list parent hierarchy chain to the top level.
     *
     * @param string|null $relation     if not set, uses currently stored values
     * @param mixed|null  $key
     */
    protected function collectListParentHierarchy($relation = null, $key = null)
    {
        $this->listParents = [];

        if (null === $relation) {
            $relation = $this->listParentRelation;
            $key      = $this->listParentRecordKey;
        }

        if ( ! $relation || null === $key) {
            return;
        }

        $model = $this->getNewModelInstance();

        $info = $this->getModelInformationForModel($model);

        $this->listParents = $this->getListParentInformation(
            $model,
            $this->listParentRelation,
            $this->listParentRecordKey,
            $info,
            true
        );
    }

    /**
     * Updates the active list parent if the request parameter is set.
     *
     * @return $this
     */
    protected function updateActiveParent()
    {
        // If no update is required, return immediately
        if ( ! request()->has('parents') && ! request()->filled('home') && ! request()->has('parent')) {
            return $this;
        }

        $separator = $this->getListParentSeparator();

        // Check for either a full hierarchy or a 'current level' update
        if (request()->has('parents') || request()->filled('home')) {

            $parents = request()->get('parents');

            if ($parents === 'all' || empty($parents)) {

                // No need to update if no current memorized parent chain
                if (count($this->listParents)) {
                    $this->clearEntireListParentHierarchy();
                }

                $defaultTopRelation = $this->getModelInformation()->list->default_top_relation;

                // Toggling display to all for relations that limit to top by default,
                // which should reset on a home reset aswell.
                if ($parents == 'all') {
                    $this->listParentRelation  = false;
                    $this->listParentRecordKey = null;
                } elseif (request()->filled('home') && $defaultTopRelation) {
                    $this->listParentRelation  = null;
                    $this->listParentRecordKey = null;
                }

            } else {

                if (is_string($parents)) {
                    $parents = explode(';', $parents);
                }

                $parents = array_values($parents);

                // No need to update if everything is the same down the chain
                if (count($this->listParents) == count($parents)) {
                    $same = true;
                    foreach ($this->listParents as $index => $currentParent) {
                        if ($currentParent->relation . $separator . $currentParent->key !== $parents[$index]) {
                            $same = false;
                            break;
                        }
                    }

                    if ($same) {
                        return $this;
                    }
                }

                $this->clearEntireListParentHierarchy();

                // Update, working backwards, starting at the current list; then re-collect the active parent chain
                $this->updateActiveParents(array_reverse($parents));
            }

        } elseif (request()->has('parent')) {

            $parent = request()->get('parent');

            // Interpret special parent values
            $parent = $this->normalizeListParentParameter($parent);

            // If nothing has changed, no need to update
            if (    ! $parent && $this->listParentRelation == $parent
                ||  $parent == $this->listParentRelation . $separator . $this->listParentRecordKey
            ) {
                return $this;
            }

            if ( ! $parent) {
                // Reset this level to its previous list parent, if any
                $this->listParentRelation  = $parent;
                $this->listParentRecordKey = null;
            } else {

                // If the parent is already present in the current history, switch to it
                if ( ! count(array_filter(
                    $this->listParents,
                    function ($checkParent) use ($parent, $separator) {
                        /** @var ListParentData $checkParent */
                        return $checkParent->relation . $separator . $checkParent->key == $parent;
                    }
                ))) {
                    // Not set yet, prepare old parent as one layer deeper

                    $this->setListParentDataInMemory(
                        $this->listParentRelation,
                        $this->listParentRecordKey,
                        $parent
                    );
                }

                list($this->listParentRelation, $this->listParentRecordKey) = explode($separator, $parent, 2);
            }
        }

        $this->storeActiveParentInSession();
        $this->collectListParentHierarchy();

        return $this;
    }

    /**
     * Normalizes 'parent' query parameter for list parent update.
     *
     * @param mixed $parent
     * @return int|null
     */
    protected function normalizeListParentParameter($parent)
    {
        $separator = $this->getListParentSeparator();

        if (is_integer($parent) && $parent < 0 || is_string($parent) && preg_match('#-\d+#', $parent)) {
            $parent = (int) $parent;

            if ($parent < 0) {
                // The the parent that conforms to the index in the parent chain
                // This only works within the context of this model, so no cross-model logic is expected
                $index = count($this->listParents) + $parent - 1;

                if ($index >= 0 && isset($this->listParents[ $index ])) {
                    $parent = $this->listParents[ $index ]->relation . $separator . $this->listParents[ $index ]->key;
                } else {
                    $parent = null;
                }

            } else {
                $parent = null;
            }
        }

        if (is_string($parent) && false === strpos($parent, $separator)) {
            $parent = null;
        }

        return $parent;
    }

    /**
     * Update a full list parent chain.
     *
     * @param array $parents    should be last-first ordered, strings with :-separated relaton:key
     */
    protected function updateActiveParents(array $parents)
    {
        $modelInfo       = $this->getModelInformation();
        $modelClass      = $modelInfo->modelClass();
        $model           = new $modelClass;
        $previousContext = null;
        $previousParent  = array_shift($parents);
        $separator       = $this->getListParentSeparator();

        // Store top level parent as active
        if ( ! $previousParent || is_string($previousParent) && false === strpos($previousParent, $separator)) {
            $this->listParentRelation  = $previousParent === false ? false : null;
            $this->listParentRecordKey = null;
        } else {
            list($this->listParentRelation, $this->listParentRecordKey) = explode($separator, $previousParent, 2);
        }

        $count = 0;

        // Add 'end' marker to force overwriting a previously longer chain link as a terminator
        $parents[] = null;

        // Loop through further parents, where $parent is what $previousParent refers back to
        foreach ($parents as $parent) {

            $count++;

            // If we have no interpretable parent to use as sub-context, stop
            if ( ! $previousParent || is_string($previousParent) && false === strpos($previousParent, $separator)) {
                break;
            }

            // If we have no interpretable parent as target, clear the context, and stop
            if ( ! $parent || is_string($parent) && false === strpos($parent, $separator)) {
                $this->setListParentDataInMemory(null, null, $previousParent, $previousContext);
                break;
            }

            list($relation, $key) = explode($separator, $parent, 2);

            // Set new parent at this level
            $this->setListParentDataInMemory($relation, $key, $previousParent, $previousContext);

            // If this is the last parent, then there is no need to prepare for the next iteration
            if ($count == count($parents)) {
                break;
            }

            // If the context (model) changed, determine the new context and remember it for the next iteration
            $listParentInfo = $this->getListParentInformation($model, $relation, $key, $modelInfo);

            if ( ! count($listParentInfo)) {
                break;
            }

            // Check and update the model class (for the memory context) if necessary.
            // This is only relevant for list parent reference across models.
            $listParentInfo = head($listParentInfo);
            /** @var ListParentData $listParentInfo */

            if ($modelClass !== get_class($listParentInfo->model)) {
                $model           = $listParentInfo->model;
                $modelClass      = get_class($model);
                $previousContext = $this->getModelSessionKey($this->getModuleHelper()->modelSlug($model));
            }

            $previousParent = $parent;
        }
    }

    /**
     * Enriches list parent data for view.
     */
    protected function enrichListParents()
    {
        if (empty($this->listParents)) {
            return;
        }

        // Mark for each list parents entry how the query params should be set up
        $queries        = [];
        $previousModel  = $this->getModelInformation()->modelClass();

        /** @var ListParentData[] $reversed */
        $reversed = array_reverse($this->listParents);

        foreach ($reversed as $index => $parent) {

            $nextParent = isset($reversed[ $index + 1 ]) ? $reversed[ $index + 1 ] : null;

            if ($previousModel != get_class($parent->model)) {
                $queries[] = null;
            } else {

                if ($nextParent) {
                    $queries[] = 'parent=' . $nextParent->relation . $this->getListParentSeparator() . $nextParent->key;
                } else {
                    $queries[] = 'parents=';
                }
            }

            $previousModel = get_class($parent->model);
        }

        $queries = array_values(array_reverse($queries));

        foreach ($queries as $index => $query) {
            $this->listParents[$index]->query = $query;
        }
    }

    // ------------------------------------------------------------------------------
    //      Access & Manipulate List Memory
    // ------------------------------------------------------------------------------

    /**
     * Clears list parent chain as currently memorized.
     */
    protected function clearEntireListParentHierarchy()
    {
        $separator = $this->getListParentSeparator();

        foreach ($this->listParents as $parent) {

            if ( ! $parent || is_string($parent) && false === strpos($parent, $separator)) {
                break;
            }

            // Unset parent at this level
            $context = $this->getModelSessionKey(
                $this->getModuleHelper()->modelSlug(get_class($parent->model))
            );

            $this->setListParentDataInMemory(null, null, $parent->relation . $separator . $parent->key, $context);
        }

        $this->setListParentDataInMemory(null, null, $this->globalSubContext());

        $this->listParentRelation  = null;
        $this->listParentRecordKey = null;
        $this->listParents         = [];
    }

    /**
     * Stores the currently set filters in the session.
     */
    protected function storeActiveParentInSession()
    {
        $this->setListParentDataInMemory(
            $this->listParentRelation,
            $this->listParentRecordKey,
            $this->globalSubContext()
        );
    }

    /**
     * Retrieves the currently set 'global' list parent from the session and stores it locally.
     */
    protected function retrieveActiveParentFromSession()
    {
        $parent = $this->getListParentDataFromMemory($this->globalSubContext());

        if (false === $parent || null === $parent) {
            $this->listParentRelation  = $parent;
            $this->listParentRecordKey = null;
            return;
        }

        $this->listParentRelation  = array_get($parent, 'relation');
        $this->listParentRecordKey = array_get($parent, 'key');
    }

    /**
     * Returns information about a list parent, or all list parents in the chain.
     *
     * Exceptions will be thrown if there are logical problems with the chain.
     *
     * @param Model                                      $model
     * @param string                                     $relation
     * @param mixed                                      $key
     * @param ModelInformationInterface|ModelInformation $info
     * @param bool                                       $recurse   if true, looks up entire chain
     * @return ListParentData[]
     */
    protected function getListParentInformation(
        Model $model,
        $relation,
        $key,
        ModelInformationInterface $info,
        $recurse = false
    ) {
        // Don't attempt to load relation methods if the parent relation is not configured
        if (    empty($info->list->parents)
            ||  ! count(
                    array_filter(
                        $info->list->parents,
                        function ($parent) use ($relation) { return $parent->relation == $relation; }
                    )
                )
        ) {
            return [];
        }

        /** @var Relation $relationInstance */
        $relationInstance = $model->{$relation}();

        // For MorphTo relations, we cannot know the related model from the relation
        // instance, it being polymorphic. We have to trust the record 'key' to contain the model.
        if ($relationInstance instanceof MorphTo) {

            $separator = $this->getListParentMorphKeySeparator();

            // If parent record indicator $key does not contain class/key separator symbol, ignore
            if (false === strpos($key, $separator)) {
                return [];
            }

            list($parentType, $parentKey) = explode($separator, $key, 2);

            $parentModelClass = $this->getRelationMappedMorphClass($parentType);

            if ( ! is_a($parentModelClass, Model::class, true)) {
                // @codeCoverageIgnoreStart
                throw new UnexpectedValueException(
                    "Parent record indicator {$key} does not refer to usable Eloquent model parent."
                );
                // @codeCoverageIgnoreEnd
            }

            $parentModel = new $parentModelClass;
            $key         = $parentKey;

        } else {
            $parentModel = $relationInstance->getRelated();
        }

        $parentModel = $this->getModelByKey($parentModel, $key);

        if ( ! $parentModel) {
            return [];
        }

        $parentInfo = $this->getModelInformationForModel($parentModel);

        $list = [];

        // Check for another link in the chain and recurse if there is
        if ($recurse && ! empty($parentInfo->list->parents)) {

            // When switching from one model to another, use the global subcontext,
            // otherwise, use the subcontext that contains the next step
            // Look up session data for list parent

            $parentListParent = $this->getListParentDataFromMemory(
                get_class($model) != get_class($parentModel) ? $this->globalSubContext() : $relation . ':' . $key,
                $this->getModelSessionKey($this->getModuleHelper()->modelSlug($parentModel))
            );

            if (is_array($parentListParent)) {
                $list = $this->getListParentInformation(
                    $parentModel,
                    array_get($parentListParent, 'relation'),
                    array_get($parentListParent, 'key'),
                    $parentInfo,
                    true
                );
            }
        }

        $module = $this->getModuleByModel($parentModel);

        if ( ! $module) {
            return [];
        }

        /** @var RouteHelperInterface $routeHelper */
        $routeHelper = app(RouteHelperInterface::class);

        $list[] = new ListParentData([
            'relation'          => $relation,
            'key'               => $key,
            'model'             => $parentModel,
            'information'       => $parentInfo,
            'module_key'        => $module->getKey(),
            'route_prefix'      => $routeHelper->getRouteNameForModelClass(get_class($parentModel), true),
            'permission_prefix' => $routeHelper->getPermissionPrefixForModelSlug(
                $this->getModuleHelper()->modelInformationKeyForModel($parentModel)
            ),
        ]);

        return $list;
    }

    /**
     * Returns model instance by key.
     *
     * @param Model $model
     * @param mixed $key
     * @return Model|null
     */
    protected function getModelByKey(Model $model, $key)
    {
        return $model::withoutGlobalScopes()
            ->where($model->getKeyName(), $key)
            ->first();
    }

    /**
     * Returns the module for a given model.
     *
     * @param Model $model
     * @return ModuleInterface|false
     */
    protected function getModuleByModel(Model $model)
    {
        /** @var ModuleManagerInterface $modules */
        $modules = app(ModuleManagerInterface::class);

        return $modules->getByAssociatedClass(get_class($model));
    }

    /**
     * Returns whether the set list parent corresponds to a given field key.
     *
     * @param string $field
     * @return bool
     */
    protected function isFieldValueBeDerivableFromListParent($field)
    {
        if ( ! $this->hasActiveListParent()) {
            return false;
        }

        $listParentData = $this->getListParentDataForRelation($this->listParentRelation);

        if ( ! $listParentData) {
            return false;
        }

        return $field == $listParentData->field();
    }

    /**
     * @param string                         $relation
     * @param ModelInformationInterface|null $information
     * @return ModelListParentDataInterface|ModelListParentData|false
     */
    protected function getListParentDataForRelation($relation, ModelInformationInterface $information = null)
    {
        $information = $information ?: $this->getModelInformation();

        if (empty($information->list->parents)) {
            return false;
        }

        foreach ($information->list->parents as $parentData) {

            if ($parentData->relation == $relation) {
                return $parentData;
            }
        }

        return false;
    }

    /**
     * @param Model $model
     * @return ModelInformation|false
     */
    protected function getModelInformationForModel(Model $model)
    {
        /** @var ModelInformationRepositoryInterface $infoRepository */
        $infoRepository = app(ModelInformationRepositoryInterface::class);

        if ( ! ($info = $infoRepository->getByModel($model))) {
            // @codeCoverageIgnoreStart
            throw new UnexpectedValueException(
                "List parent hierarchy relation model "
                . get_class($model) . " is not part of the CMS."
            );
            // @codeCoverageIgnoreEnd
        }

        return $info;
    }

    /**
     * Retrieves list parent data from memory and resets memory context.
     *
     * @param string|null $subContext
     * @param string|null $context
     * @return array|false|null
     */
    protected function getListParentDataFromMemory($subContext, $context = null)
    {
        $memory = $this->getListMemory();

        $oldContext    = $memory->getContext();
        $oldSubContext = $memory->getSubContext();

        if (null !== $context) {
            $memory->setContext($context);
        }

        $memory->setSubContext($subContext);

        $listParent = $memory->getListParent();

        if (null !== $context) {
            $memory->setContext($oldContext);
        }

        $memory->setSubContext($oldSubContext);

        return $listParent;
    }

    /**
     * Stores list parent data in memory and resets memory context.
     *
     * @param string|null|false $relation
     * @param mixed|null        $key
     * @param string|null       $subContext
     * @param string|null       $context
     */
    protected function setListParentDataInMemory($relation, $key, $subContext, $context = null)
    {
        $memory = $this->getListMemory();

        $oldContext    = $memory->getContext();
        $oldSubContext = $memory->getSubContext();

        if (null !== $context) {
            $memory->setContext($context);
        }

        $memory->setSubContext($subContext);

        $memory->setListParent($relation, $key);

        if (null !== $context) {
            $memory->setContext($oldContext);
        }

        $memory->setSubContext($oldSubContext);
    }

    /**
     * Returns sub-context string for storing global list parent data in.
     *
     * This sub-context should hold the 'active' list parent.
     *
     * @return string
     */
    protected function globalSubContext()
    {
        return '__global__';
    }

    /**
     * Returns separator between relation method name and list parent record key (or morph indicator).
     *
     * @return string
     */
    protected function getListParentSeparator()
    {
        return ':';
    }

    /**
     * Returns separator between class name and key for ListParentRecordKeys for MorphTo.
     *
     * @return string
     */
    protected function getListParentMorphKeySeparator()
    {
        return ':';
    }

    /**
     * Returns morph relation type string for a model class, or returns class if not mapped.
     *
     * @param string $class
     * @return string
     */
    protected function getRelationMappedMorphType($class)
    {
        $map = Relation::morphMap();

        if (empty($map)) {
            return ltrim($class, '\\');
        }

        if (    false !== ($type = array_search($class, $map))
            ||  false !== ($type = array_search(ltrim($class, '\\'), $map))
        ) {
            return $type;
        }

        return trim($class, '\\');
    }

    /**
     * Returns morph relation class string for a morph relation type, or type if already a class.
     *
     * @param string $type
     * @return string
     */
    protected function getRelationMappedMorphClass($type)
    {
        $map = Relation::morphMap();

        if (empty($map)) {
            return $type;
        }

        return array_get($map, $type, ltrim($type, '\\'));
    }

    // ------------------------------------------------------------------------------
    //      Dependencies
    // ------------------------------------------------------------------------------

    /**
     * @return CoreInterface
     */
    abstract protected function getCore();

    /**
     * @return string
     */
    abstract protected function getModuleKey();

    /**
     * @return ModelInformationInterface|ModelInformation|null
     */
    abstract protected function getModelInformation();

    /**
     * @return ModuleHelperInterface
     */
    abstract protected function getModuleHelper();

    /**
     * @return Model
     */
    abstract protected function getNewModelInstance();

    /**
     * @return ModelListMemoryInterface
     */
    abstract protected function getListMemory();

    /**
     * @param string|null $modelSlug    defaults to current module key
     * @return string
     */
    abstract protected function getModelSessionKey($modelSlug = null);

}


text:
package com.same.androidclass.view.adapter;

import android.content.Context;
import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.atermenji.android.iconicdroid.IconicFontDrawable;
import com.atermenji.android.iconicdroid.icon.EntypoIcon;

import com.atermenji.android.iconicdroid.icon.FontAwesomeIcon;

import com.same.androidclass.R;
import com.same.androidclass.bean.SettingAdapterListCell;
import com.same.androidclass.util.Colors;

/**
 * 设置适配器adapter
 * Created by alic on 16-5-3.
 */
public class SettingBaseAdapter extends BaseAdapter {
    private SettingAdapterListCell[] settingItems;
    private Context context;
    private IconicFontDrawable remindIcon,softwareIcon, changeUserIcon,logoutIcon;

    public SettingBaseAdapter(Context context) {
        this.context = context;
        initIcons();
        settingItems = new SettingAdapterListCell[]{
                new SettingAdapterListCell(remindIcon, "提醒设置"),
                new SettingAdapterListCell(softwareIcon, "关于软件"),
                new SettingAdapterListCell(changeUserIcon, "切换账号"),
                new SettingAdapterListCell(logoutIcon, "退出程序"),
        };
    }

    public void initIcons() {
        remindIcon = new IconicFontDrawable(context,FontAwesomeIcon.TIME);
        remindIcon.setIconColor(Color.GRAY);

        softwareIcon = new IconicFontDrawable(context,FontAwesomeIcon.INFO_SIGN);
        softwareIcon.setIconColor(Color.GRAY);

        changeUserIcon = new IconicFontDrawable(context,EntypoIcon.SHUFFLE);
        changeUserIcon.setIconColor(Color.GRAY);

        logoutIcon = new IconicFontDrawable(context,FontAwesomeIcon.OFF);
        logoutIcon.setIconColor(Color.GRAY);
    }

    @Override
    public int getCount() {
        return settingItems.length;
    }

    @Override
    public Object getItem(int position) {
        return settingItems[position];
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    public String getSelectedItemName(int position) {
        return settingItems[position].getSettingName();
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null)
            convertView = LayoutInflater.from(context).inflate(R.layout.setting_item_layout, null);

        SettingAdapterListCell data = (SettingAdapterListCell) getItem(position);

        //获得组件
        ImageView icon = (ImageView) convertView.findViewById(R.id.setting_item_icon);
        TextView settingName = (TextView) convertView.findViewById(R.id.setting_item_name);

        //设置组件信息
//        icon.setImageResource();
        icon.setBackground(data.getIcon());
        settingName.setText(data.getSettingName());

        return convertView;
    }
}


text: docker exec -it nheqminer bash


text:
package org.apache.nifi.atlas.reporting;

import com.sun.jersey.api.client.Client;
import org.apache.atlas.AtlasClientV2;
import org.apache.nifi.atlas.NiFiAtlasClient;
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.components.ValidationResult;
import org.apache.nifi.controller.ConfigurationContext;
import org.apache.nifi.reporting.ReportingContext;
import org.apache.nifi.reporting.ReportingInitializationContext;
import org.apache.nifi.util.MockComponentLog;
import org.apache.nifi.util.MockConfigurationContext;
import org.apache.nifi.util.MockProcessContext;
import org.apache.nifi.util.MockPropertyValue;
import org.apache.nifi.util.MockValidationContext;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Consumer;

import static org.apache.nifi.atlas.reporting.ReportLineageToAtlas.ATLAS_CONF_CREATE;
import static org.apache.nifi.atlas.reporting.ReportLineageToAtlas.ATLAS_CONF_DIR;
import static org.apache.nifi.atlas.reporting.ReportLineageToAtlas.ATLAS_CONNECT_TIMEOUT;
import static org.apache.nifi.atlas.reporting.ReportLineageToAtlas.ATLAS_DEFAULT_CLUSTER_NAME;
import static org.apache.nifi.atlas.reporting.ReportLineageToAtlas.ATLAS_NIFI_URL;
import static org.apache.nifi.atlas.reporting.ReportLineageToAtlas.ATLAS_PASSWORD;
import static org.apache.nifi.atlas.reporting.ReportLineageToAtlas.ATLAS_READ_TIMEOUT;
import static org.apache.nifi.atlas.reporting.ReportLineageToAtlas.ATLAS_URLS;
import static org.apache.nifi.atlas.reporting.ReportLineageToAtlas.ATLAS_USER;
import static org.apache.nifi.atlas.reporting.ReportLineageToAtlas.KAFKA_BOOTSTRAP_SERVERS;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class TestReportLineageToAtlas {

    private final Logger logger = LoggerFactory.getLogger(TestReportLineageToAtlas.class);

    private ReportLineageToAtlas testSubject;
    private MockComponentLog componentLogger;
    private ReportingInitializationContext initializationContext;
    private ReportingContext reportingContext;

    @Before
    public void setUp() throws Exception {
        testSubject = new ReportLineageToAtlas();
        componentLogger = new MockComponentLog("reporting-task-id", testSubject);

        initializationContext = mock(ReportingInitializationContext.class);
        when(initializationContext.getLogger()).thenReturn(componentLogger);
    }

    @Test
    public void validateAtlasUrls() throws Exception {
        final MockProcessContext processContext = new MockProcessContext(testSubject);
        final MockValidationContext validationContext = new MockValidationContext(processContext);

        processContext.setProperty(ATLAS_NIFI_URL, "http://nifi.example.com:8080/nifi");
        processContext.setProperty(ATLAS_USER, "admin");
        processContext.setProperty(ATLAS_PASSWORD, "admin");

        BiConsumer<Collection<ValidationResult>, Consumer<ValidationResult>> assertResults = (rs, a) -> {
            assertTrue(rs.iterator().hasNext());
            for (ValidationResult r : rs) {
                logger.info("{}", r);
                final String subject = r.getSubject();
                if (ATLAS_URLS.getDisplayName().equals(subject)) {
                    a.accept(r);
                }
            }
        };

        // Default setting.
        assertResults.accept(testSubject.validate(validationContext),
                r -> assertTrue("Atlas URLs is required", !r.isValid()));

        // Invalid URL.
        processContext.setProperty(ATLAS_URLS, "invalid");
        assertResults.accept(testSubject.validate(validationContext),
                r -> assertTrue("Atlas URLs is invalid", !r.isValid()));

        // Valid URL
        processContext.setProperty(ATLAS_URLS, "http://atlas.example.com:21000");
        assertTrue(processContext.isValid());

        // Valid URL with Expression
        processContext.setProperty(ATLAS_URLS, "http://atlas.example.com:${literal(21000)}");
        assertTrue(processContext.isValid());

        // Valid URLs
        processContext.setProperty(ATLAS_URLS, "http://atlas1.example.com:21000, http://atlas2.example.com:21000");
        assertTrue(processContext.isValid());

        // Invalid and Valid URLs
        processContext.setProperty(ATLAS_URLS, "invalid, http://atlas2.example.com:21000");
        assertResults.accept(testSubject.validate(validationContext),
                r -> assertTrue("Atlas URLs is invalid", !r.isValid()));
    }

    @Test
    public void testDefaultConnectAndReadTimeout() throws Exception {
        // GIVEN
        Map<PropertyDescriptor, String> properties = new HashMap<>();

        // WHEN
        // THEN
        testConnectAndReadTimeout(properties, 60000, 60000);
    }

    @Test
    public void testSetConnectAndReadTimeout() throws Exception {
        // GIVEN
        int expectedConnectTimeoutMs = 10000;
        int expectedReadTimeoutMs = 5000;

        String atlasConfDir = "target/atlasConfDir";
        File directory = new File(atlasConfDir);
        if (!directory.exists()) {
            directory.mkdirs();
        }

        Map<PropertyDescriptor, String> properties = new HashMap<>();
        properties.put(ATLAS_CONNECT_TIMEOUT, (expectedConnectTimeoutMs / 1000) + " sec");
        properties.put(ATLAS_READ_TIMEOUT, (expectedReadTimeoutMs / 1000) + " sec");

        properties.put(ATLAS_CONF_DIR, atlasConfDir);
        properties.put(ATLAS_CONF_CREATE, "true");
        properties.put(ATLAS_DEFAULT_CLUSTER_NAME, "defaultClusterName");
        properties.put(KAFKA_BOOTSTRAP_SERVERS, "http://localhost:6667");

        // WHEN
        // THEN
        testConnectAndReadTimeout(properties, expectedConnectTimeoutMs, expectedReadTimeoutMs);
    }

    private void testConnectAndReadTimeout(Map<PropertyDescriptor, String> properties, Integer expectedConnectTimeout, Integer expectedReadTimeout) throws Exception {
        // GIVEN
        properties.put(ATLAS_NIFI_URL, "http://localhost:8080/nifi");
        properties.put(ATLAS_URLS, "http://localhost:27000");
        properties.put(ATLAS_USER, "admin");
        properties.put(ATLAS_PASSWORD, "admin123");

        reportingContext = mock(ReportingContext.class);
        when(reportingContext.getProperties()).thenReturn(properties);
        when(reportingContext.getProperty(any())).then(invocation -> new MockPropertyValue(properties.get(invocation.getArguments()[0])));

        ConfigurationContext configurationContext = new MockConfigurationContext(properties, null);

        testSubject.initialize(initializationContext);
        testSubject.setup(configurationContext);

        // WHEN
        NiFiAtlasClient niFiAtlasClient = testSubject.createNiFiAtlasClient(reportingContext);

        // THEN
        Field fieldAtlasClient = niFiAtlasClient.getClass().getDeclaredField("atlasClient");
        fieldAtlasClient.setAccessible(true);
        AtlasClientV2 atlasClient = (AtlasClientV2) fieldAtlasClient.get(niFiAtlasClient);

        Field fieldAtlasClientContext = atlasClient.getClass().getSuperclass().getDeclaredField("atlasClientContext");
        fieldAtlasClientContext.setAccessible(true);
        Object atlasClientContext = fieldAtlasClientContext.get(atlasClient);

        Method getClient = atlasClientContext.getClass().getMethod("getClient");
        getClient.setAccessible(true);
        Client jerseyClient = (Client) getClient.invoke(atlasClientContext);
        Map<String, Object> jerseyProperties = jerseyClient.getProperties();

        Integer actualConnectTimeout = (Integer) jerseyProperties.get("com.sun.jersey.client.property.connectTimeout");
        Integer actualReadTimeout = (Integer) jerseyProperties.get("com.sun.jersey.client.property.readTimeout");

        assertEquals(expectedConnectTimeout, actualConnectTimeout);
        assertEquals(expectedReadTimeout, actualReadTimeout);
    }
}


text:
From a STAT request of 2 hours to a TAT of
24 hours, we guarantee quality and on-time
delivery for all our customers for diverse
locations in the USA.  We have processed more
than 200 million lines till date and in the
process has earned the trust of the top 5
service providers for submitting the transcripts
directly to their hospital clients.


text:
function [V, volsize, voxdims, header] = ReadAnalyze(filename)

% If image filename is not specified, prompt user to select one
if nargin < 1
  [filename,pathname] = uigetfile('*.img;*.hdr','Load Analyze file');
  if filename == 0
    error(' No file selected.');
  end
  filename = [pathname filename(1:end-4)] ;
end

% Read Analyze Header (% mc is usually 'ieee-le')
[header, mc] = ReadAnalyzeHeader(filename);
volsize = double(header.hdr.dime.dim(2:4));
voxdims = double(header.hdr.dime.pixdim(2:4));

% Find image type (precision)
switch (header.hdr.dime.bitpix)
    case 16
        precision = 'int16';
    case 8
        precision = 'int8';
    otherwise
        error('Unsupport Analyze image type!');
end

% Setup memory for image efficently
V = zeros(volsize(1),volsize(2),volsize(3), precision);

% Load image volume
if isempty( strfind(filename,'.img') )
    fid = fopen([filename '.img'],'r', mc);
else
    fid = fopen(filename,'r',mc);
end

for iz = volsize(3):-1:1
    Temp = fliplr(int16(fread(fid,[volsize(1), volsize(2)],precision)));
    V(:,:,iz)= flipud(rot90(Temp));
end

fclose(fid);


text:
// Copyright (c) 2015 Daniel Grunwald
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

use std;
use ffi;
use python::{Python, PythonObject, PythonObjectWithCheckedDowncast, PyClone};
use objects::PyObject;
use err::PyResult;

/// Conversion trait that allows various objects to be converted into Python objects.
pub trait ToPyObject {
    type ObjectType : PythonObject;

    /// Converts self into a Python object.
    fn to_py_object(&self, py: Python) -> Self::ObjectType;

    /// Converts self into a Python object.
    ///
    /// May be more efficient than `to_py_object` in some cases because
    /// it can move out of the input object.
    #[inline]
    fn into_py_object(self, py: Python) -> Self::ObjectType
      where Self: Sized
    {
        self.to_py_object(py)
    }

    /// Converts self into a Python object and calls the specified closure
    /// on the native FFI pointer underlying the Python object.
    ///
    /// May be more efficient than `to_py_object` because it does not need
    /// to touch any reference counts when the input object already is a Python object.
    #[inline]
    fn with_borrowed_ptr<F, R>(&self, py: Python, f: F) -> R
        where F: FnOnce(*mut ffi::PyObject) -> R
    {
        let obj = self.to_py_object(py).into_object();
        f(obj.as_ptr())
    }

    // FFI functions that accept a borrowed reference will use:
    //   input.with_borrowed_ptr(|obj| ffi::Call(obj)
    // 1) input is &PyObject
    //   -> with_borrowed_ptr() just forwards to the closure
    // 2) input is PyObject
    //   -> with_borrowed_ptr() just forwards to the closure
    // 3) input is &str, int, ...
    //   -> to_py_object() allocates new Python object; FFI call happens; PyObject::drop() calls Py_DECREF()

    // FFI functions that steal a reference will use:
    //   let input = try!(input.into_py_object()); ffi::Call(input.steal_ptr())
    // 1) input is &PyObject
    //   -> into_py_object() calls Py_INCREF
    // 2) input is PyObject
    //   -> into_py_object() is no-op
    // 3) input is &str, int, ...
    //   -> into_py_object() allocates new Python object
}

py_impl_to_py_object_for_python_object!(PyObject);

/// FromPyObject is implemented by various types that can be extracted from a Python object.
///
/// Normal usage is through the `PyObject::extract` helper method:
/// ```let obj: PyObject = ...;
/// let value = try!(obj.extract::<TargetType>(py));
/// ```
///
/// TODO: update this documentation
/// Note: depending on the implementation, the lifetime of the extracted result may
/// depend on the lifetime of the `obj` or the `prepared` variable.
///
/// For example, when extracting `&str` from a python byte string, the resulting string slice will
/// point to the existing string data (lifetime: `'source`).
/// On the other hand, when extracting `&str` from a python unicode string, the preparation step
/// will convert the string to UTF-8, and the resulting string slice will have lifetime `'prepared`.
/// Since only which of these cases applies depends on the runtime type of the python object,
/// both the `obj` and `prepared` variables must outlive the resulting string slice.
///
/// In cases where the result does not depend on the `'prepared` lifetime,
/// the inherent method `PyObject::extract()` can be used.
pub trait FromPyObject<'source> : Sized {
    /// Extracts `Self` from the source `PyObject`.
    fn extract(py: Python, obj: &'source PyObject) -> PyResult<Self>;
}

py_impl_from_py_object_for_python_object!(PyObject);

pub trait RefFromPyObject {
    fn with_extracted<F, R>(py: Python, obj: &PyObject, f: F) -> PyResult<R>
        where F: FnOnce(&Self) -> R;
}

impl <T: ?Sized> RefFromPyObject for T
    where for<'a> &'a T: FromPyObject<'a>
{
    #[inline]
    fn with_extracted<F, R>(py: Python, obj: &PyObject, f: F) -> PyResult<R>
        where F: FnOnce(&Self) -> R
    {
        match FromPyObject::extract(py, obj) {
            Ok(val) => Ok(f(val)),
            Err(e) => Err(e)
        }
    }
}

/*
impl <'prepared, T> ExtractPyObject<'prepared> for T
where T: PythonObjectWithCheckedDowncast
{
    type Prepared = PyObject;

    #[inline]
    fn prepare_extract(py: Python, obj: &PyObject) -> PyResult<Self::Prepared> {
        Ok(obj.clone_ref(py))
    }

    #[inline]
    fn extract(py: Python, obj: &'prepared Self::Prepared) -> PyResult<T> {
        Ok(try!(obj.clone_ref(py).cast_into(py)))
    }
}
*/

// ToPyObject for references
impl <'a, T: ?Sized> ToPyObject for &'a T where T: ToPyObject {
    type ObjectType = T::ObjectType;

    #[inline]
    fn to_py_object(&self, py: Python) -> T::ObjectType {
        <T as ToPyObject>::to_py_object(*self, py)
    }

    #[inline]
    fn into_py_object(self, py: Python) -> T::ObjectType {
        <T as ToPyObject>::to_py_object(self, py)
    }

    #[inline]
    fn with_borrowed_ptr<F, R>(&self, py: Python, f: F) -> R
        where F: FnOnce(*mut ffi::PyObject) -> R
    {
        <T as ToPyObject>::with_borrowed_ptr(*self, py, f)
    }
}

/// `Option::Some<T>` is converted like `T`.
/// `Option::None` is converted to Python `None`.
impl <T> ToPyObject for Option<T> where T: ToPyObject {
    type ObjectType = PyObject;

    fn to_py_object(&self, py: Python) -> PyObject {
        match *self {
            Some(ref val) => val.to_py_object(py).into_object(),
            None => py.None()
        }
    }

    fn into_py_object(self, py: Python) -> PyObject {
        match self {
            Some(val) => val.into_py_object(py).into_object(),
            None => py.None()
        }
    }
}

impl <'source, T> FromPyObject<'source> for Option<T> where T: FromPyObject<'source> {
    fn extract(py: Python, obj: &'source PyObject) -> PyResult<Self> {
        if obj.as_ptr() == unsafe { ffi::Py_None() } {
            Ok(None)
        } else {
            match T::extract(py, obj) {
                Ok(v) => Ok(Some(v)),
                Err(e) => Err(e)
            }
        }
    }
}

/*
impl <'prepared, T> ExtractPyObject<'prepared> for Option<T>
where T: ExtractPyObject<'prepared>
{
    type Prepared = Option<T::Prepared>;

    fn prepare_extract(py: Python, obj: &PyObject) -> PyResult<Self::Prepared> {
        if obj.as_ptr() == unsafe { ffi::Py_None() } {
            Ok(None)
        } else {
            Ok(Some(try!(T::prepare_extract(py, obj))))
        }
    }

    fn extract(py: Python, obj: &'prepared Self::Prepared) -> PyResult<Option<T>> {
        match *obj {
            Some(ref inner) => {
                match T::extract(py, inner) {
                    Ok(v) => Ok(Some(v)),
                    Err(e) => Err(e)
                }
            },
            None => Ok(None)
        }
    }
}
*/