#/usr/bin/python2
#encoding=utf-8  
import sys
import urllib
import urllib2
import json
import ssl
from datetime import datetime,timedelta

sys.path.append(r'C:\\Users\\admin\\Documents\\Visual Studio 2015\\Projects\\PythonApplication1\\PythonApplication1')  
from Model.AnalyzeData import *
from Model.AttributeEvaluationResult import *
from Model.ItemTracking import *
from Model.ItemCountData import *
from Model.ItemReply import *
from Model.ResearchReport import *
from Model.ItemLabelData import *
from Model.Structured import *


class Item:

    def __init__(self):


        self.__ItemAnalyzeDataList = [];#语义分析结果字段 包含多个AnalyzeData对象
        self.__UpdateTime = "";#该条目信息本系统最后更新的时间,string类型需要转义使用。或程序需要，在赋值时转义为time类型。
        self.__IndexTime = "";#该条目信息的存储时间，用于分析分析效率与计算抓取质量

        #内容详细程度
        #0仅有标题(的网页)
        #1微博
        #2标题和摘要
        #3首页内容
        #4所有页面内容我不确定是否需要区分首页和绝对的全文--Chol
        #5评论类型
        self.__ContentDetailLevel = 0;

        #文章ID
        self.__ItemID = ""; 

        #客户系统或对方网站的ItemID
        self.__ClientItemID = "";

        #父级ItemID
        self.__ParentItemID = "";

         #文章Url
        self.__Url = "";
 
         #标题
        self.__CleanTitle = "";

        #短标题
        self.__ShortTitle = "";
        #正文
        self.__CleanText = "";

        #HTML正文（如需要）
        self.__HTMLText = ""  ;
               
        #摘要
        self.__Summary = "";

        #页面显示发布时间,string类型需要转义使用。或程序需要，在赋值时转义为time类型。

        self.__PubDate = "";

        #作者名（分词索引）
        self.__AuthorName = "";

        #作者ID
        self.__AuthorID = "";

        #Author.Tag字段，用于区分人
        self.__AuthorTag = "";

        #显示来源(比如使用终端等)
        self.__Source = "";

        #转载的ID,如果有的话
        self.__RetweetID = "";


        #region 媒体信息

        #媒体编号ID
        self.__MediaID = "";

        #媒体名称（分词索引）
        self.__MediaName = "";

        #频道/版面
        self.__MediaChannel = "";


        #在媒体中的排序，用以表示顺序或者重要性(例如头版、首页之类) int
        self.__Rank = 0;
        

        #媒体类型（网站|论坛|博客……）
        #0其他未知
        #1报刊杂志报刊
        #2广播电视电台电视台
        #3新闻网络媒体(新闻性)
        #4论坛
        #5博客
        #6微博
        #7社交网站社交网
        #8电子商务电子商务/供求类网站
        #9视频网站网络视频
        #10百科问答
        #11微信
        #20网页搜索Web搜索引擎
        #23新闻搜索News搜索引擎
        #24论坛搜索
        #25博客搜索
        #26微博搜索
        #27社交网站搜索
        #28图片搜索
        #29视频搜索
        #30百科搜索百科问答
        #31新闻项目
        #32"组织机构网站
        #100内部数据内部数据（企业局域网）
        #101行业媒体，无此类别，仅供统计时使用
        self.__MediaType = 0;



        #媒体发行范围（全国|地方|海外）
        #0未知
        #1全国
        #2地方
        #3海外
        self.__MediaRegionType = 0;


        #媒体权重，主流媒体等 SByte
        self.__MediaWeight = 0;


        #媒体性质（党报|市场化）
        #0未知
        #1行政类媒体（党报）
        #2市场化媒体(非极端)
        #3极端反华
        #4极端红色
        self.__MediaOrganType = 0;

        #语体类型（新闻|评论|转发……）
        #0未知
        #1新闻
        #2评论
        self.__MediaStyle = 0;


        #政治倾向性（-3反动 -2极左 -1左倾 0中立 1右倾 2极右 3极端右）SByte
        self.__MediaTendency = 0;

        #媒体行业属性
        self.__MediaIndustryIDs = "";

        #Media.MediaTag用于区分媒体集合
        self.__MediaTag = "";

        #代理分区 >0表示要翻墙 SByte
        self.__ProxyZone = 0;

        #原始媒体ID（如果在媒体库中找到匹配）
        self.__ReproducedMediaID = "";


        
        #原始媒体名称
        self.__ReproducedMediaName = "";

        #原始媒体的Url
        self.__ReproducedUrl = "";

        #该媒体版权int；0 未知，11 黑名单，12 无版权，13 不允许转载，14 拒绝抓取，20 白名单，21 采购可转授，22 自编，23
        #开放可商业转载，31 采购需单独授权，32 用户自有版权，33 用户自行承担版权，41 非商业使用
        self.__MediaCopyright = 0;

    #endregion 媒体信息


    #region Item跟踪

        #跟踪设置和信息(评论) ItemTracking对象1个
        self.__Tracking = "";

        #跟踪设置和信息（转发） ItemTracking对象1个
        self.__Tracking_Forward = "";

        #最新的点击数、评论数、转发数 ItemCountData对象1个
        self.__CurrentCount = "";

        #定时获取的点击数、评论数、转发数（存ES） ItemCountData[] 多个
        self.__CountHistory = [];

        #回复数据 ItemReply[]
        self.__Reply = [];
     #endregion Item跟踪

     #region 扩展数据

        #相似转载ID（早先入库的相似文章ID，第一篇该字段为空，其他均为第一篇的ID） string
        self.__DuplicationID = "";

        #分词结果
        self.__SpliteTitle = "";

        #分词结果
        self.__SpliteText = "";

        #是否进行过转载分析bool
        self.__ProsdDuplication = 0;

        #通用标签，根据各实体库中的Tag字段设置
        self.__Tag = "";

        #研报 ResearchReport 1个对象 先初始为空string
        self.__ResearchReport = "";

        #语料标注字段，每个客户一条记录(支持不同的标注标准) ItemLabelData[]
        self.__LabelData = [];

        #原文是否已被删除 bool
        self.__IsOriginalDeleted = 0;

        #是否是epr公司发布的软广 bool
        self.__IsEPRPublished = 0;

    #endregion

    #region 文本结构化信息
        #文本结构化信息 Structured对象1个
        self.__Struct = "";
    #endregion



 #region


    @property
    def Struct(self):
        return self.__Struct

    @Struct.setter
    def Struct(self,Struct):
        self.__Struct = Structured(Struct)
    @property
    def IsEPRPublished(self):
        return self.__IsEPRPublished

    @IsEPRPublished.setter
    def IsEPRPublished(self,IsEPRPublished):
        self.__IsEPRPublished = int(IsEPRPublished)

    @property
    def IsOriginalDeleted(self):
        return self.__IsOriginalDeleted

    @IsOriginalDeleted.setter
    def IsOriginalDeleted(self,IsOriginalDeleted):
        self.__IsOriginalDeleted = int(IsOriginalDeleted)
    @property
    def LabelData(self):
        return self.__LabelData

    @LabelData.setter
    def LabelData(self,LabelData):
            self.__LabelData = [](LabelData)
    @property
    def ResearchReport(self):
        return self.__ResearchReport

    @ResearchReport.setter
    def ResearchReport(self,ResearchReport):
        self.__ResearchReport = ResearchReport(ResearchReport)

    @property
    def Tag(self):
        return self.__Tag

    @Tag.setter
    def Tag(self,Tag):
        self.__Tag = str(Tag)
    @property
    def ProsdDuplication(self):
        return self.__ProsdDuplication

    @ProsdDuplication.setter
    def ProsdDuplication(self,ProsdDuplication):
            self.__ProsdDuplication = int(ProsdDuplication)

    @property
    def SpliteText(self):
        return self.__SpliteText

    @SpliteText.setter
    def SpliteText(self,SpliteText):
        self.__SpliteText = str(SpliteText)

    @property
    def SpliteTitle(self):
        return self.__SpliteTitle

    @SpliteTitle.setter
    def SpliteTitle(self,SpliteTitle):
        self.__SpliteTitle = str(SpliteTitle)

    @property
    def DuplicationID(self):
        return self.__DuplicationID

    @DuplicationID.setter
    def DuplicationID(self,DuplicationID):
        self.__DuplicationID = str(DuplicationID)

    @property
    def Reply(self):
        return self.__Reply

    @Reply.setter
    def Reply(self,Reply):
            self.__Reply = [](Reply)
    @property
    def CountHistory(self):
        return self.__CountHistory

    @CountHistory.setter
    def CountHistory(self,CountHistory):
        self.__CountHistory = [](CountHistory)

    @property
    def CurrentCount(self):
        return self.__CurrentCount

    @CurrentCount.setter
    def CurrentCount(self,CurrentCount):
        self.__CurrentCount = ItemCountData(CurrentCount)

    @property
    def Tracking_Forward(self):
        return self.__Tracking_Forward

    @Tracking_Forward.setter
    def Tracking_Forward(self,Tracking_Forward):
        self.__Tracking_Forward = ItemTracking(Tracking_Forward)
    @property
    def Tracking(self):
        return self.__Tracking

    @Tracking.setter
    def Tracking(self,Tracking):
        self.__Tracking = ItemTracking(Tracking)

    @property
    def MediaCopyright(self):
        return self.__MediaCopyright

    @MediaCopyright.setter
    def MediaCopyright(self,MediaCopyright):
        self.__MediaCopyright = int(MediaCopyright)
    @property
    def ReproducedUrl(self):
        return self.__ReproducedUrl

    @ReproducedUrl.setter
    def ReproducedUrl(self,ReproducedUrl):
        self.__ReproducedUrl = str(ReproducedUrl)
    @property
    def ReproducedMediaName(self):
        return self.__ReproducedMediaName

    @ReproducedMediaName.setter
    def ReproducedMediaName(self,ReproducedMediaName):
        self.__ReproducedMediaName = str(ReproducedMediaName)


    @property
    def ReproducedMediaID(self):
        return self.__ReproducedMediaID

    @ReproducedMediaID.setter
    def ReproducedMediaID(self,ReproducedMediaID):
        self.__ReproducedMediaID = str(ReproducedMediaID)
    @property
    def ProxyZone(self):
        return self.__ProxyZone

    @ProxyZone.setter
    def ProxyZone(self,ProxyZone):
        self.__ProxyZone = int(ProxyZone)
    @property
    def MediaTag(self):
        return self.__MediaTag

    @MediaTag.setter
    def MediaTag(self,MediaTag):
        self.__MediaTag = str(MediaTag)

    @property
    def MediaIndustryIDs(self):
        return self.__MediaIndustryIDs

    @MediaIndustryIDs.setter
    def MediaIndustryIDs(self,MediaIndustryIDs):
        self.__MediaIndustryIDs = str(MediaIndustryIDs)
    @property
    def MediaTendency(self):
        return self.__MediaTendency

    @MediaTendency.setter
    def MediaTendency(self,MediaTendency):
        self.__MediaTendency = int(MediaTendency)


    @property
    def MediaStyle(self):
        return self.__MediaStyle

    @MediaStyle.setter
    def MediaStyle(self,MediaStyle):
        self.__MediaStyle = int(MediaStyle)

    @property
    def MediaOrganType(self):
        return self.__MediaOrganType

    @MediaOrganType.setter
    def MediaOrganType(self,MediaOrganType):
        self.__MediaOrganType = int(MediaOrganType)
    @property
    def MediaWeight(self):
        return self.__MediaWeight

    @MediaWeight.setter
    def MediaWeight(self,MediaWeight):
        self.__MediaWeight = int(MediaWeight)

    @property
    def MediaRegionType(self):
        return self.__MediaRegionType

    @MediaRegionType.setter
    def MediaRegionType(self,MediaRegionType):
        self.__MediaRegionType = int(MediaRegionType)
    @property
    def MediaType(self):
        return self.__MediaType

    @MediaType.setter
    def MediaType(self,MediaType):
        self.__MediaType = int(MediaType)

    @property
    def Rank(self):
        return self.__Rank

    @Rank.setter
    def Rank(self,Rank):
        self.__Rank = int(Rank)

    @property
    def MediaChannel(self):
        return self.__MediaChannel

    @MediaChannel.setter
    def MediaChannel(self,MediaChannel):
        self.__MediaChannel = str(MediaChannel)
    @property
    def MediaName(self):
        return self.__MediaName

    @MediaName.setter
    def MediaName(self,MediaName):
        self.__MediaName = str(MediaName)

    @property
    def MediaID(self):
        return self.__MediaID

    @MediaID.setter
    def MediaID(self,MediaID):
        self.__MediaID = str(MediaID)

    @property
    def RetweetID(self):
        return self.__RetweetID

    @RetweetID.setter
    def RetweetID(self,RetweetID):
        self.__RetweetID = str(RetweetID)


    @property
    def Source(self):
        return self.__Source

    @Source.setter
    def Source(self,Source):
        self.__Source = str(Source)

    @property
    def AuthorTag(self):
        return self.__AuthorTag

    @AuthorTag.setter
    def AuthorTag(self,AuthorTag):
        self.__AuthorTag = str(AuthorTag)

    @property
    def AuthorID(self):
        return self.__AuthorID

    @AuthorID.setter
    def AuthorID(self,AuthorID):
        self.__AuthorID = str(AuthorID)
    @property
    def AuthorName(self):
        return self.__AuthorName

    @AuthorName.setter
    def AuthorName(self,AuthorName):
        self.__AuthorName = str(AuthorName)
    @property
    def PubDate(self):
        return self.__PubDate

    @PubDate.setter
    def PubDate(self,PubDate):
        self.__PubDate = str(PubDate)

    @property
    def Summary(self):
        return self.__Summary

    @Summary.setter
    def Summary(self,Summary):
        self.__Summary = str(Summary)



    @property
    def HTMLText(self):
        return self.__HTMLText

    @HTMLText.setter
    def HTMLText(self,HTMLText):
        self.__HTMLText = str(HTMLText)

    @property
    def CleanText(self):
        return self.__CleanText

    @CleanText.setter
    def CleanText(self,CleanText):
        self.__CleanText = str(CleanText)
    @property
    def ShortTitle(self):
        return self.__ShortTitle

    @ShortTitle.setter
    def ShortTitle(self,ShortTitle):
        self.__ShortTitle = str(ShortTitle)
    
    @property
    def CleanTitle(self):
        return self.__CleanTitle

    @CleanTitle.setter
    def CleanTitle(self,CleanTitle):
        self.__CleanTitle = str(CleanTitle)

    @property
    def Url(self):
        return self.__Url

    @Url.setter
    def Url(self,Url):
        self.__Url = str(Url)
        

    @property
    def ParentItemID(self):
        return self.__ParentItemID

    @ParentItemID.setter
    def ParentItemID(self,ParentItemID):
        self.__ParentItemID = str(ParentItemID)



    @property
    def ItemAnalyzeDataList(self):
        return self.__ItemAnalyzeDataList

    @ItemAnalyzeDataList.setter
    def ItemAnalyzeDataList(self,ItemAnalyzeDataList):
            self.__ItemAnalyzeDataList = [](ItemAnalyzeDataList)
      


    
    @property
    def UpdateTime(self):
        return self.__UpdateTime

    @UpdateTime.setter
    def UpdateTime(self,UpdateTime):
        self.__UpdateTime = str(UpdateTime)
        

    @property
    def IndexTime(self):
        return self.__IndexTime

    @IndexTime.setter
    def IndexTime(self,IndexTime):
        self.__IndexTime = str(IndexTime)
       

    @property
    def ContentDetailLevel(self):
        return self.__ContentDetailLevel

    @ContentDetailLevel.setter
    def ContentDetailLevel(self,ContentDetailLevel):
        self.__ContentDetailLevel = int(ContentDetailLevel)

    @property
    def ItemID(self):
        return self.__ItemID

    @ItemID.setter
    def ItemID(self,ItemID):
        self.__ItemID = str(ItemID)


    @property
    def ClientItemID(self):
        return self.__ClientItemID

    @ClientItemID.setter
    def ClientItemID(self,ClientItemID):
        self.__ClientItemID = str(ClientItemID)
  

#endregion
