微擎在安裝或卸載模塊時會根據manifest.xml生成(或刪除)數據庫中相應記錄,並執行manifest.xml里指定的腳本。
manifest.xml文件內容詳細介紹如下:
manifest - xmlns (新增)
用來為此模塊XML的命令空間,此處必須填寫”http://www.we7.cc“.
manifest - versionCode
用來說明當前模塊適用於哪個版本的微擎, 用來保證模塊的兼容性. 多個支持的版本請使用逗號隔開.
<manifest xmlns="http://www.zhiyuanweixin.com" versionCode="1.0">
manifest - application
用來定義模塊的基本設置屬性
manifest - application - setting
用來說明此模塊是否有針對模塊的設置項, 設置項可以保存此模塊需要的配置參數(此參數針對不同的公眾號分別保存)
manifest - application - name
模塊的名稱
manifest - application - identifie
模塊標識符, 應對應模塊文件夾的名稱, 微擎系統按照此標識符查找模塊定義
manifest - application - version
模塊當前版本, 此版本用於模塊的版本更新
manifest - application - type (新增)
模塊的類型,方便在左側菜單中歸類與顯示, 目前分為 business(主要業務),customer(客戶關系),activity(營銷及活動),services(常用服務及工具),other(其他)
manifest - application - ability
模塊功能描述, 使用簡單的語言描述模塊的作用, 來吸引用戶
manifest - application - description
模塊詳細描述, 詳細介紹模塊的功能和使用方法
manifest - application - author
模塊的作者, 留下你的大名吧
manifest - application - url
模塊的發布頁, 可以通過這個url來訪問你的模塊最新情況
<application setting="false">
<name><![CDATA[人人商城V2]]></name>
<identifie><![CDATA[ewei_shopv2]]></identifie>
<version><![CDATA[3.0.7]]></version>
<type><![CDATA[business]]></type>
<ability><![CDATA[人人商城(分銷),多用戶分權,淘寶商品一鍵轉換,多種插件支持。]]></ability>
<description><![CDATA[人人商城(分銷),多項信息模板,強大的自定義規格設置]]></description>
<author><![CDATA[xxx社區]]></author>
<url><![CDATA[https://www.xxxxx.com]]></url>
</application>
manifest - platform
用來定義模塊用以處理公眾平台消息的設置項
manifest - platform - subscribes
消息訂閱器定義(消息訂閱器提供了一種處理公眾平台消息的方式, 可以接受到指定類型的消息, 來進行分析和統計, 不能用以處理消息返回結果. 這種處理是並行的, 同一個消息會被每一個訂閱它的模塊接收到)
manifest - platform - subscribes - message
定義需要被訂閱器訂閱的消息類型, 這里的消息被 WeModuleReceiver 處理
manifest - platform - handles
消息處理器定義(消息處理器用於接收公眾平台的消息, 並返回相應的處理結果. 這種處理是互斥的, 同一個消息只能從一個模塊返回處理結果)
manifest - platform - handles - message
定義需要被處理器處理的消息類型, 這里的消息被 WeModuleProcessor 處理
manifest - platform - rule (變更)
定義此模塊是否需要規則觸發
manifest - platform - rule - embed
當前模塊進行消息處理時需要定義規則, 是否使用規則路由. (使用規則路由必須要能處理text類型消息, handles節點中必須包含 )
<platform>
<subscribes>
<message type="text" /> <message type="image" />
<message type="voice" /> <message type="video" />
<message type="shortvideo" /> <message type="location" />
<message type="link" /> <message type="subscribe" />
<message type="unsubscribe" /> <message type="qr" />
<message type="trace" /> <message type="click" />
<message type="view" /> <message type="merchant_order" />
</subscribes> <handles> <message type="text" />
<message type="image" /> <message type="voice" />
<message type="video" /> <message type="shortvideo" />
<message type="location" /> <message type="link" />
<message type="subscribe" /> <message type="qr" />
<message type="trace" /> <message type="click" />
<message type="merchant_order" /> </handles>
<rule embed="false" /> <card embed="false" />
</platform>
manifest - bindings (新增)
定義此模塊的封面,管理菜單,微站菜單及規則擴展菜單
manifest - bindings - cover
定義模塊的封面入口,封面入口為單條圖文信息即是模塊需要對用戶開放的入口地址.
manifest - bindings - cover - call
定義模塊動態擴展菜單項, 此值對應 WeModuleSite 類中的方法, 返回的值結構與entry相同, 將成為此節點的菜單項.
manifest - bindings - cover - entry
模塊綁定菜單的定義結構. 需要定義 title - 操作的名稱, do - 模塊操作入口, state - 附加的用戶參數(定義於WeModuleSite)
manifest - bindings - rule
定義規則的附加操作, 每個entry代表一個附加操作.
manifest - bindings - menu
定義模塊在左側本模塊菜單下拉列表中的附加菜單操作, 每一個entry代表一個菜單操作.
manifest - bindings - home
定義模塊在微站首頁的擴展菜單項, 每一個entry代表一個微站首頁菜單項.
manifest - bindings - profile
定義模塊在微站個人中心的擴展菜單項, 每一個entry代表一個微站個人中心菜單項.
manifest - bindings - shortcut
定義模塊在微站快捷菜單的擴展菜單項, 每一個entry代表一個微站快捷菜單項.
<bindings> <cover> <entry title="商城入口" do="mobile" state="" direct="false" /> </cover> <menu call="getMenus"> </menu> </bindings>
manifest - install
安裝執行腳本, 這里支持兩種形式: php腳本和sql語句. 如果安裝時只需要寫入數據庫相關內容, 可以在此直接定義sql語句. 也可以使用php文件, 例如: install.php 代表執行模塊定義目錄下的 install.php
manifest - uninstall
卸載執行腳本, 參上
manifest - upgrade
升級執行腳本, 參上
<permissions> </permissions> <install><![CDATA[install.php]]></install> <uninstall><![CDATA[]]></uninstall> <upgrade><![CDATA[upgrade.php]]></upgrade>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns="http://www.we7.cc" versionCode="0.6">
<application setting="true">
<name><![CDATA[校內兼職平台]]></name>
<identifie><![CDATA[gzvju_part_time]]></identifie>
<version><![CDATA[1.0.0]]></version>
<type><![CDATA[customer]]></type>
<ability><![CDATA[校內兼職平台]]></ability>
<description><![CDATA[為高校提供校內兼職信息平台]]></description>
<author><![CDATA[ZeroMiss]]></author>
<url><![CDATA[http://bbs.we7.cc/]]></url>
</application>
<platform>
<subscribes>
<message type="text" />
<message type="image" />
<message type="voice" />
<message type="video" />
<message type="shortvideo" />
<message type="location" />
<message type="link" />
<message type="subscribe" />
<message type="unsubscribe" />
<message type="qr" />
<message type="trace" />
<message type="click" />
<message type="view" />
<message type="merchant_order" />
</subscribes>
<handles>
<message type="text" />
<message type="image" />
<message type="voice" />
<message type="video" />
<message type="shortvideo" />
<message type="location" />
<message type="link" />
<message type="subscribe" />
<message type="qr" />
<message type="trace" />
<message type="click" />
<message type="merchant_order" />
</handles>
<rule embed="true" />
<card embed="false" />
</platform>
<bindings>
<cover>
<entry title="首頁入口" do="indexcover" state="" direct="true" />
</cover>
<rule>
<entry title="回復規則列表" do="replylist" state="" direct="true" />
</rule>
<menu>
<entry title="企業設置" do="qiyeset" state="" direct="true" />
<entry title="招聘設置" do="zhaopinset" state="" direct="true" />
<entry title="簡歷管理" do="jianliguanli" state="" direct="true" />
</menu>
<home>
<entry title="首頁導航" do="indexdispay" state="" direct="true" />
</home>
<profile>
<entry title="個人中心" do="profiledisplay" state="" direct="true" />
</profile>
<shortcut>
<entry title="招聘設置快捷" do="shortcutzp" state="" direct="true" />
</shortcut>
<function>
<entry title="微站獨立功能演示" do="onlyone" state="" direct="true" />
</function>
</bindings>
<permissions>
<function>
<entry title="微站獨立功能演示" do="onlyone" state="" direct="true" />
</function>
<entry title="添加簡歷" do="ZeroMiss_jianli_add" />
<entry title="刪除簡歷" do="ZeroMiss_jianli_delete" />
</permissions>
<install><![CDATA[]]></install>
<uninstall><![CDATA[]]></uninstall>
<upgrade><![CDATA[]]></upgrade>
</manifest>
