动易系统如何批量导入节点?
在集群项目中经常会遇到节点变子站的问题。
 当子站很多,而且节点数一旦上千或者更多,并且分级较多的时候就会比较吃力。如下面的示例,单个站点节点数达30个,当子站数X40个的时候,节点总数达到了1K+:
 
| 网站首页 | |||||||
| 学校概况 |  
         |  
       校园动态 |  
         |  
       通知公告 |  
         |  
       教学科研 |  
         |  
      
|  
         |  
       学校简介 |  
         |  
       校园新闻 |  
         |  
       上级来文 |  
         |  
       教研活动 | 
| 教师风采 | 学校喜报 | 学校通知 | 课题研究 | ||||
| 校园美景 |  
         |  
        
         |  
        
         |  
      ||||
| 平安校园 |  
         |  
       德育之窗 |  
         |  
       服务窗口 |  
         |  
       校园主站英文网Home | |
|  
         |  
       安全管理 |  
         |  
       班级管理 |  
         |  
       办事流程 |  
         |  
       About | 
| 安全教育 | 团队活动 | 招生信息 | President | ||||
|  
         |  
        
         |  
        
         |  
       Memorabilia | ||||
|  
         |  
        
         |  
        
         |  
       News | ||||
|  
         |  
        
         |  
        
         |  
       Contact us | ||||
 祭出批量导入神器。
 
  节点导入模板示例:
 
 
 | 节点ID | 父节点ID | 节点名称 | 模型ID | 内容页模板 | 栏目列表页模板 | 节点类型 | 
| 1 | 0 | 观澜中心小学 | 1 |  
        |  
      /PE首页/观澜中心小学-首页.html | 1 | 
| 2 | 1 | 学校概况 | 1 |  
        |  
      /PE单页模板/通用-跳转到第一个子节点.html | 1 | 
| 3 | 2 | 学校简介 | 1 | /PE文章模型/文章-内容页.html | /PE文章模型/文章-列表页.html | 1 | 
| 4 | 2 | 教师风采 | 1 | /PE文章模型/文章-内容页.html | /PE文章模型/文章-列表页.html | 1 | 
| 5 | 2 | 校园美景 | 1 | /PE文章模型/文章-内容页.html | /PE文章模型/文章-列表页.html | 1 | 
| 6 | 1 | 校园动态 | 1 |  
        |  
      /PE单页模板/通用-跳转到第一个子节点.html | 1 | 
| 7 | 6 | 校园新闻 | 1 | /PE文章模型/文章-内容页.html | /PE文章模型/文章-列表页.html | 1 | 
| 8 | 6 | 学校喜报 | 1 | /PE文章模型/文章-内容页.html | /PE文章模型/文章-列表页.html | 1 | 
| 9 | 1 | 通知公告 | 1 |  
        |  
      /PE单页模板/通用-跳转到第一个子节点.html | 1 | 
| 10 | 9 | 上级来文 | 1 | /PE文章模型/文章-内容页.html | /PE文章模型/文章-列表页.html | 1 | 
| 11 | 9 | 学校通知 | 1 | /PE文章模型/文章-内容页.html | /PE文章模型/文章-列表页.html | 1 | 
| 12 | 1 | 教学科研 | 1 |  
        |  
      /PE单页模板/通用-跳转到第一个子节点.html | 1 | 
| 13 | 12 | 教研活动 | 1 | /PE文章模型/文章-内容页.html | /PE文章模型/文章-列表页.html | 1 | 
| 14 | 12 | 课题研究 | 1 | /PE文章模型/文章-内容页.html | /PE文章模型/文章-列表页.html | 1 | 
| 15 | 1 | 平安校园 | 1 |  
        |  
      /PE单页模板/通用-跳转到第一个子节点.html | 1 | 
| 16 | 15 | 安全管理 | 1 | /PE文章模型/文章-内容页.html | /PE文章模型/文章-列表页.html | 1 | 
| 17 | 15 | 安全教育 | 1 | /PE文章模型/文章-内容页.html | /PE文章模型/文章-列表页.html | 1 | 
| 18 | 1 | 德育之窗 | 1 |  
        |  
      /PE单页模板/通用-跳转到第一个子节点.html | 1 | 
| 19 | 18 | 班级管理 | 1 | /PE文章模型/文章-内容页.html | /PE文章模型/文章-列表页.html | 1 | 
| 20 | 18 | 团队活动 | 1 | /PE文章模型/文章-内容页.html | /PE文章模型/文章-列表页.html | 1 | 
| 21 | 1 | 服务窗口 | 1 |  
        |  
      /PE单页模板/通用-跳转到第一个子节点.html | 1 | 
| 22 | 21 | 办事流程 | 1 | /PE文章模型/文章-内容页.html | /PE文章模型/文章-列表页.html | 1 | 
| 23 | 21 | 招生信息 | 1 | /PE文章模型/文章-内容页.html | /PE文章模型/文章-列表页.html | 1 | 
| 24 | 1 | Home | 1 |  
        |  
      /PE单页模板/通用-跳转到第一个子节点.html | 1 | 
| 25 | 24 | About | 1 | /PE单页模板/通用-单页.html | /PE单页模板EN/通用-单页.html | 3 | 
| 26 | 24 | President | 1 | /PE文章模型/文章-内容页.html | /PE文章模型EN/文章-列表页.html | 1 | 
| 27 | 24 | Memorabilia | 1 | /PE文章模型/文章-内容页.html | /PE文章模型EN/文章-列表页.html | 1 | 
| 28 | 24 | News | 1 | /PE文章模型/文章-内容页.html | /PE文章模型EN/文章-列表页.html | 1 | 
| 29 | 24 | Contact us | 1 | /PE单页模板/通用-单页.html | /PE单页模板EN/通用-单页.html | 3 | 
 在做节点模板时,
 一定要注意,父节点ID表示了两个节点的关系。例如学校概况的节点ID是1,学校简介的父节点ID是1,表示后者是前者的子节点。
 
 要排这些节点需要花不少时间,也出错了不少次,认真对应ID是个比较累的工作,但是批量导入已经是最好的解决方法了。
 
 导入节点后再通过sql脚本导入到新网站:
 
 USE [nodeDemo_Data]
 
 INSERT  INTO [dbo].[PE_Nodes]
 
         ( [NodeID],
 
           [NodeIdentifier],
 
           [NodeType],
 
           [ParentID],
 
           [ParentPath],
 
           [Depth],
 
           [RootID],
 
           [Child],
 
           [arrChildID],
 
           [PrevID],
 
           [NextID],
 
           [OrderID],
 
           [NodeDir],
 
           [ParentDir],
 
           [NodeName],
 
           [Tips],
 
           [Description],
 
           [NodePicUrl],
 
           [Meta_Keywords],
 
           [Meta_Description],
 
           [ShowOnMenu],
 
           [ShowOnPath],
 
           [ShowOnMap],
 
           [ShowOnList_Index],
 
           [ShowOnList_Parent],
 
           [PurviewType],
 
           [Creater],
 
           [InheritPurviewFromParent],
 
           [WorkFlowID],
 
           [HitsOfHot],
 
           [OpenType],
 
           [ItemCount],
 
           [ItemChecked],
 
           [CommentCount],
 
           [Custom_Content],
 
           [IsCreateListPage],
 
           [IsCreateContentPage],
 
           [AutoCreateHtmlType],
 
           [ContentPageHtmlRule],
 
           [ListPageHtmlRule],
 
           [ItemAspxFileName],
 
           [RelateNode],
 
           [RelateSpecial],
 
           [DefaultTemplateFile],
 
           [ContainChildTemplateFile],
 
           [ItemOpenType],
 
           [ItemListOrderType],
 
           [ItemPageSize],
 
           [UpLoadDirRule],
 
           [LinkUrl],
 
           [Settings],
 
           [ListPagePostFix],
 
           [ListPageSavePathType],
 
           [NeedCreateHtml],
 
           [LeastOfEliteLevel],
 
           [IPLock],
 
           [CultureName],
 
           [EnableSubDomain],
 
           [SubDomain],
 
           [ConfigType],
 
           [IncrementalUpdatePages],
 
           [EnablePhone],
 
           [EnablePad]
 
         )
 
         SELECT  [PN].[NodeID],
 
                 [PN].[NodeIdentifier],
 
                 [PN].[NodeType],
 
                 [PN].[ParentID],
 
                 [PN].[ParentPath],
 
                 [PN].[Depth],
 
                 [PN].[RootID],
 
                 [PN].[Child],
 
                 [PN].[arrChildID],
 
                 [PN].[PrevID],
 
                 [PN].[NextID],
 
                 [PN].[OrderID],
 
                 [PN].[NodeDir],
 
                 [PN].[ParentDir],
 
                 [PN].[NodeName],
 
                 [PN].[Tips],
 
                 [PN].[Description],
 
                 [PN].[NodePicUrl],
 
                 [PN].[Meta_Keywords],
 
                 [PN].[Meta_Description],
 
                 [PN].[ShowOnMenu],
 
                 [PN].[ShowOnPath],
 
                 [PN].[ShowOnMap],
 
                 [PN].[ShowOnList_Index],
 
                 [PN].[ShowOnList_Parent],
 
                 [PN].[PurviewType],
 
                 [PN].[Creater],
 
                 [PN].[InheritPurviewFromParent],
 
                 [PN].[WorkFlowID],
 
                 [PN].[HitsOfHot],
 
                 [PN].[OpenType],
 
                 [PN].[ItemCount],
 
                 [PN].[ItemChecked],
 
                 [PN].[CommentCount],
 
                 [PN].[Custom_Content],
 
                 [PN].[IsCreateListPage],
 
                 [PN].[IsCreateContentPage],
 
                 [PN].[AutoCreateHtmlType],
 
                 [PN].[ContentPageHtmlRule],
 
                 [PN].[ListPageHtmlRule],
 
                 [PN].[ItemAspxFileName],
 
                 [PN].[RelateNode],
 
                 [PN].[RelateSpecial],
 
                 [PN].[DefaultTemplateFile],
 
                 [PN].[ContainChildTemplateFile],
 
                 [PN].[ItemOpenType],
 
                 [PN].[ItemListOrderType],
 
                 [PN].[ItemPageSize],
 
                 [PN].[UpLoadDirRule],
 
                 [PN].[LinkUrl],
 
                 [PN].[Settings],
 
                 [PN].[ListPagePostFix],
 
                 [PN].[ListPageSavePathType],
 
                 [PN].[NeedCreateHtml],
 
                 [PN].[LeastOfEliteLevel],
 
                 [PN].[IPLock],
 
                 [PN].[CultureName],
 
                 [PN].[EnableSubDomain],
 
                 [PN].[SubDomain],
 
                 [PN].[ConfigType],
 
                 [PN].[IncrementalUpdatePages],
 
                 [PN].[EnablePhone],
 
                 [PN].[EnablePad]
 
         FROM    [NewDemo_Data].[dbo].[PE_Nodes] AS [PN]
 
         WHERE   [PN].[NodeID] >= 0
 
 然后登陆后台即可查看已导入的节点。
 
 导入的节点会有些小问题,需要清除一下网站节点缓存,
 并批量处理下单页节点中的html绑定。
 
 UPDATE PE_Nodes SET ListPageHtmlRule = 'About' WHERE NodeType = '3' and NodeName = 'About'
 
 UPDATE PE_Nodes SET ListPageHtmlRule = 'Contactus' WHERE NodeType = '3' and NodeName = 'Contact us'
 
 完结。
 
