TWI407372B - System and method for automatically generating a website based on pre-defined webpage templates - Google Patents

System and method for automatically generating a website based on pre-defined webpage templates Download PDF

Info

Publication number
TWI407372B
TWI407372B TW97124072A TW97124072A TWI407372B TW I407372 B TWI407372 B TW I407372B TW 97124072 A TW97124072 A TW 97124072A TW 97124072 A TW97124072 A TW 97124072A TW I407372 B TWI407372 B TW I407372B
Authority
TW
Taiwan
Prior art keywords
tag
label
webpage
jump
template
Prior art date
Application number
TW97124072A
Other languages
Chinese (zh)
Other versions
TW201001287A (en
Inventor
xiao-jun Chang
Original Assignee
Hon Hai Prec Ind Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hon Hai Prec Ind Co Ltd filed Critical Hon Hai Prec Ind Co Ltd
Priority to TW97124072A priority Critical patent/TWI407372B/en
Publication of TW201001287A publication Critical patent/TW201001287A/en
Application granted granted Critical
Publication of TWI407372B publication Critical patent/TWI407372B/en

Links

Abstract

The present invention provides a method for automatically generating a website based on pre-defined webpage templates. The method includes the steps of: (a) reading a corresponding configuration file; (b) extracting all codes in a home page template, and obtaining user-defined tags from the extracted code; (c) parsing each user-defined tag in turn thereby generating a static webpage; (d) finding a skip tag which jumps to a sub-webpage in the configuration file; (e) extracting all codes in a webpage template corresponding to a skip tag if such a skip tag is found, obtaining user-defined tags from the extracted codes, and going to step (c); (f) recording a structure of the generated static webpages, and generating a log file. A system for automatically generating a website based on pre-defined webpage templates is also provided. The invention can automatically generating static webpages based on pre-defined webpage templates and user-defined tags.

Description

基於建模的智慧化網站開發系統及方法Intelligent website development system and method based on modeling

本發明涉及一種基於建模的智慧化網站開發系統及方法。The invention relates to a smart website development system and method based on modeling.

隨著網際網路的飛速發展,網站已經廣泛應用於我們工作與生活的各個領域,而對於網站開發的技術也層出不窮,從最早的ASP和JSP到現在炙手可熱的.NET和JSF等。這些技術的普及和推廣將Web程式的開發提升到一個新的高度,最終導致了Web 2.0時代的到來。然而這些新技術同時存在一些缺點與不足,主要歸納為以下三點:1.過份強調動態,造成性能的損耗。With the rapid development of the Internet, the website has been widely used in all areas of our work and life, and the technology for website development has emerged from the earliest ASP and JSP to the now hot .NET and JSF. The popularity and promotion of these technologies has taken the development of Web programs to a new level, which eventually led to the arrival of the Web 2.0 era. However, these new technologies have some shortcomings and shortcomings, which are mainly summarized into the following three points: 1. Excessive emphasis on dynamics, resulting in loss of performance.

隨著資訊的成倍增長,網頁需要顯示的內容也越來越多,這種情況促使了網站與資料庫技術的融合。傳統的網頁開發技術在這一點上,採用動態網頁的技術,根據特定的頁面解析網頁中包含的程式語句,同時即時從資料庫中提取資訊,網站伺服器結合此頁面生成包含該提取資訊的後台代碼,然後回饋給用戶的瀏覽器。其流程為:用戶發出請求→網站伺服器解析網頁→網站伺服器提取資料並生成代碼→網站伺服器回饋代碼到用戶瀏覽器。As information grows exponentially, more and more content needs to be displayed on web pages, which has prompted the convergence of web and database technologies. Traditional web development technology uses dynamic web page technology to parse the program statements contained in the web page according to a specific page, and simultaneously extract information from the database. The web server combines this page to generate a background containing the extracted information. The code is then fed back to the user's browser. The process is: the user sends a request → the web server parses the web page → the web server extracts the data and generates the code → the website server feedback code to the user browser.

網站伺服器的解析動作是反復進行的,每次解析不僅僅是更新部分的資料,而且包括網頁的程式語句、樣式、顏色等都需要進行解析。這種方式對於資料時效性要求較高、用戶數量不多的小型系統而言是合適的。但是對於資 料時效性要求不高、用戶數量多的系統(如圖片網站和新聞資訊網站等)而言卻不適合。因為解析的過程需要耗費一定時間,當用戶訪問量大時會導致網頁打開緩慢,且會增加網站伺服器的壓力,不利於網站伺服器性能的穩定,甚至會導致網站伺服器崩潰。The parsing action of the web server is repeated. Each parsing is not only the information of the updated part, but also the program statement, style, color, etc. of the web page need to be parsed. This approach is suitable for small systems with high data timeliness requirements and a small number of users. But for capital Systems that require less timeliness and a large number of users (such as photo sites and news sites) are not suitable. Because the process of parsing takes a certain amount of time, when the user access is large, the webpage will be opened slowly, and the pressure on the web server will increase, which is not conducive to the stability of the performance of the web server, and may even cause the web server to crash.

2.開發難度大,對運行環境要求高,缺乏通用性。2. It is difficult to develop, requires high operating environment and lacks versatility.

傳統的動態網頁開發方式,需要熟練掌握相關的程式語言,比如JSP需要Java知識,.NET需要C#知識等。同時,這些網站開發語言開發出來的系統需要特定的伺服器程式來解析,不利於網站的快速開發與通用。Traditional dynamic web development methods require proficiency in the relevant programming languages, such as JSP requires Java knowledge, .NET requires C# knowledge. At the same time, the systems developed by these web development languages require specific server programs to parse, which is not conducive to the rapid development and universality of the website.

3.動態網頁的網站不利於推廣。3. The website of the dynamic webpage is not conducive to promotion.

對於一個網站,流量是其價值的基本體現,目前網站推廣的主流方式是透過搜索引擎收錄完成的。由於動態網頁需要解析,會造成時間上的損耗,所以不易被搜索引擎所收錄。而不包含程式語句的靜態網頁最容易被搜索引擎收錄,從而更利於網站的推廣應用。For a website, traffic is a basic manifestation of its value. At present, the mainstream way of website promotion is completed through search engines. Since dynamic web pages need to be parsed, it will cause time loss, so it is not easily included by search engines. Static web pages that do not contain program statements are most easily indexed by search engines, which is more conducive to the promotion of the website.

鑒於以上內容,有必要提供一種基於建模的智慧化網站開發系統及方法,其可根據自定義的建模標籤和網頁範本,進行資料庫查詢,生成靜態網頁。In view of the above, it is necessary to provide a smart website development system and method based on modeling, which can perform database query and generate static web pages according to customized modeling tags and webpage templates.

一種基於建模的智慧化網站開發系統,包括一個網站伺服器,所述網站伺服器包括:配置檔讀取模組,用於從存儲體中讀取所需的範本配置檔,從所述範本配置檔中獲取每個網頁範本的存儲路徑和各個網頁範本之間的層級關 係;標籤獲取模組,用於提取網站首頁範本的所有編碼,從所述編碼中獲取建模標籤,所述建模標籤包括跳轉標籤和資料獲取標籤;標籤解析模組,用於依次解析所獲取的每個建模標籤,並根據解析結果生成靜態網頁;檢測模組,用於檢測所述範本配置檔中是否存在跳轉到次級網頁的跳轉標籤;所述標籤獲取模組,還用於當所述範本配置檔中存在跳轉到次級網頁的跳轉標籤時,提取所述跳轉標籤對應的網頁範本的所有編碼,從所述編碼中獲取建模標籤;所述標籤解析模組,還用於對所述跳轉標籤對應的網頁範本編碼中的建模標籤進行解析,生成次級網頁;日誌生成模組,用於當所述範本配置檔中不存在跳轉到次級網頁的跳轉標籤時,對所生成的所有的靜態網頁進行結構記錄,並生成日誌檔記錄生成操作。A modeling-based intelligent website development system includes a website server, the website server includes: a configuration file reading module, configured to read a required template configuration file from the storage body, from the template Get the storage path of each webpage template and the level between each webpage template in the configuration file. a tag acquisition module, configured to extract all codes of a homepage template of the website, obtain a modeling tag from the code, the modeling tag includes a jump tag and a data acquisition tag, and a tag parsing module, configured to sequentially parse the Obtaining each modeling label, and generating a static webpage according to the parsing result; the detecting module is configured to detect whether there is a jump label that jumps to the secondary webpage in the template configuration file; and the label obtaining module is further used for When there is a jump label that jumps to the secondary webpage in the template configuration file, extract all the codes of the webpage template corresponding to the jump label, and obtain a modeling label from the encoding; the label parsing module is further used And parsing the modeling label in the webpage template encoding corresponding to the jump label to generate a secondary webpage; and the log generating module is configured to: when there is no jump label to jump to the secondary webpage in the template configuration file, Perform structural records on all generated static web pages and generate log file record generation operations.

一種基於建模的智慧化網站開發方法,包括如下步驟:(a)從存儲體中讀取所需的範本配置檔,從所述範本配置檔中獲取每個網頁範本的存儲路徑和各個網頁範本之間的層級關係;(b)提取網站首頁範本的所有編碼,從所述編碼中獲取建模標籤,所述建模標籤包括跳轉標籤和資料獲取標籤;(c)依次解析所獲取的每個建模標籤,並根據解析結果生成靜態網頁;(d)檢測所述範本配置檔中是否存在跳轉到次級網頁的跳轉標籤;(e)當所述範本配置檔中存在跳轉到次級網頁的跳轉標籤時,提取所述跳轉標籤對應的網頁範本的所有編碼,從所述編碼中獲取建模標籤,然後流程轉到步驟(c);(f)當所述範本配置檔中 不存在跳轉到次級網頁的跳轉標籤時,對所生成的所有的靜態網頁進行結構記錄,並生成日誌檔記錄生成操作。A modeling-based intelligent website development method includes the following steps: (a) reading a required template configuration file from a storage body, obtaining a storage path of each webpage template and each webpage template from the template configuration file (b) extracting all the codes of the home page template, obtaining modeling tags from the encoding, the modeling tags including jump tags and data acquisition tags; (c) sequentially parsing each acquired Modeling a tag and generating a static web page according to the parsing result; (d) detecting whether there is a jump tag in the template configuration file that jumps to the secondary web page; (e) when there is a jump to the secondary web page in the template configuration file When the label is jumped, all the codes of the webpage template corresponding to the jump label are extracted, the modeling label is obtained from the encoding, and then the flow proceeds to step (c); (f) in the template configuration file When there is no jump label to jump to the secondary web page, all the generated static web pages are structurally recorded, and a log file record generating operation is generated.

相較於習知技術,所述的基於建模的智慧化網站開發系統及方法,其可根據自定義的建模標籤和網頁範本,進行資料庫查詢,生成靜態網頁,加快了網站開發速度,提高了網站伺服器的運行效率。Compared with the prior art, the modeling-based intelligent website development system and method can query the database according to the customized modeling label and the webpage template, generate a static webpage, and speed up the website development speed. Improve the efficiency of the website server.

參閱圖1所示,係本發明基於建模的智慧化網站開發系統較佳實施方式的系統架構圖。該系統主要包括多個用戶端電腦10和網站伺服器20。所述多個用戶端電腦10和網站伺服器20透過網路30相連,所述網路30可以是網際網路(Internet)或企業內部網路(Intranet)。所述管理伺服器20透過資料庫連接與資料庫21相連,所述資料庫21中存儲有網頁中的資料。所述資料庫連接可為開放式資料庫連接(Open Database Connectivity,ODBC),或者Java資料庫連接(Java Database Connectivity,JDBC),所述資料庫21可為Microsoft SQL Server 2000等。Referring to FIG. 1, a system architecture diagram of a preferred embodiment of the intelligent website development system based on the present invention is shown. The system mainly includes a plurality of client computers 10 and a web server 20. The plurality of client computers 10 and the web server 20 are connected through a network 30, which may be an Internet or an intranet. The management server 20 is connected to the database 21 through a database connection, and the database 21 stores data in the web page. The database connection may be an Open Database Connectivity (ODBC) or a Java Database Connectivity (JDBC), and the database 21 may be Microsoft SQL Server 2000 or the like.

所述網站伺服器20的存儲體(如硬碟)中還存儲有多種範本配置檔和網頁範本,所述範本配置檔是一種XML(Extensible Markup Language)檔。每種範本配置檔用於設置該種範本配置檔所對應的每個網頁範本的存儲路徑和各個網頁範本之間的層級關係等。例如,用符號“<父範本名稱></子範本名稱>”記錄兩個網頁範本之間的層級關係。一般而言,每個網站都包含首頁,首頁下面又包含不 同的次級網頁,最終是包含資料的內容網頁。所述的次級網頁可能有一級或者多級,但基本都在五級以下。在本發明中,透過對網站中每一級網頁設置對應的網頁範本,在用戶登錄網站後,所述網站伺服器20將根據不同的網頁範本生成相應的靜態網頁,整個生成過程從首頁開始。A plurality of template profiles and webpage templates are stored in a storage body (such as a hard disk) of the website server 20, and the template configuration file is an XML (Extensible Markup Language) file. Each template configuration file is used to set a storage path of each webpage template corresponding to the template configuration file and a hierarchical relationship between each webpage template. For example, use the symbol "<parent template name></submodel name>" to record the hierarchical relationship between two webpage templates. In general, each website contains a home page, and the home page contains no The same sub-page, and ultimately the content page containing the information. The secondary web pages may have one or more levels, but are basically below level five. In the present invention, by setting a corresponding webpage template for each level of webpage in the website, after the user logs in to the website, the web server 20 generates a corresponding static webpage according to different webpage templates, and the entire generating process starts from the first page.

參閱圖2所示,係圖1中所示網站伺服器20的功能模組圖。所述網站伺服器20包括配置檔讀取模組210、標籤獲取模組211、標籤解析模組212、檢測模組213和日誌生成模組214。本發明所稱的模組是完成一特定功能的電腦程式段,比程式更適合於描述軟體在電腦中的執行過程,因此在本發明以下對軟體描述中都以模組描述。Referring to FIG. 2, it is a functional module diagram of the website server 20 shown in FIG. 1. The website server 20 includes a configuration file reading module 210, a label acquisition module 211, a label analysis module 212, a detection module 213, and a log generation module 214. The module referred to in the present invention is a computer program segment for performing a specific function, and is more suitable for describing the execution process of the software in the computer than the program. Therefore, the following description of the software is described in the module.

其中,所述配置檔讀取模組210用於在用戶透過用戶端電腦10登錄網站後,從網站伺服器20的存儲體中讀取所需的範本配置檔,從所述範本配置檔中獲取每個網頁範本的存儲路徑和各個網頁範本之間的層級關係,並載入標籤解析API(Application Programming Interface,應用編程介面)開始生成靜態網頁。The configuration file reading module 210 is configured to read a required template configuration file from the storage body of the website server 20 after the user logs in to the website through the user computer 10, and obtain the template configuration file from the template configuration file. The hierarchical relationship between the storage path of each web page template and each web page template, and loading the Application Programming Interface (Application Programming Interface) to start generating static web pages.

所述標籤獲取模組211用於提取網站首頁範本的所有編碼,從所述編碼中獲取建模標籤。此時,所述網站首頁範本的所有編碼和建模標籤都暫存在記憶體空間。所述建模標籤是一種自定義的HTML(Hypertext Markup Language,超文本鏈結標示語言)標籤,主要包括跳轉標籤和資料獲取標籤等。The tag obtaining module 211 is configured to extract all codes of the website homepage template, and obtain a modeling tag from the code. At this point, all the encoding and modeling tags of the homepage template of the website are temporarily stored in the memory space. The modeling tag is a custom HTML (Hypertext Markup Language) tag, which mainly includes a jump tag and a data acquisition tag.

其中,所述跳轉標籤負責超鏈結(Hyperlink)的跳轉, 例如,可以設定跳轉標籤為:<m:a></m:a>,其包括參數href、model和randomId。其中,參數href的定義與HTML標籤中的href定義相同,比如<m:a href href=”/Aegean/test.action”></m:a>,參數model指定跳轉後網頁的範本,比如<m:a href href=”Aegean/test.action”model=”test.jsp”>,參數randomId是一個遞增的數值,用於記錄該跳轉標籤出現的順序,系統將以該參數randomId的值命名該跳轉標籤對應網頁的名稱。Wherein, the jump label is responsible for a jump of a hyperlink (Hyperlink), For example, you can set the jump label to: <m:a></m:a>, which includes the parameters href, model, and randomId. The definition of the parameter href is the same as the definition of the href in the HTML tag, such as <m:a href href=”/Aegean/test.action”></m:a>, and the parameter model specifies the template of the web page after the jump, such as < m:a href href=”Aegean/test.action”model=”test.jsp”>, the parameter randomId is an incremental value used to record the order in which the jump label appears. The system will name the value of the parameter randomId. The jump label corresponds to the name of the web page.

所述資料獲取標籤用於設定資料獲取方式、從資料庫21中查詢的資料庫表名和所對應的欄位名、資料顯示時的格式等,所述資料獲取方式包括直接獲取和從資料庫中讀取資料。例如,可以設定資料獲取標籤為:<m:txt></m:txt>,其包括參數Scope、Table、Field、Lable和MaxRow等。其中,參數Scope指定直接獲取資料時的範圍,包括Request或Session,參數Table指定從資料庫中讀取資料時查詢的資料庫表名,參數Field指定查詢的欄位名,參數Lable指定前端顯示文字,參數MaxRow指定網頁中顯示的記錄條數,超過此條數則分頁顯示。The data acquisition label is used to set a data acquisition manner, a database table name queried from the database 21, a corresponding column name, a format when the data is displayed, and the like, and the data acquisition manner includes direct acquisition and retrieval from the database. Read the data. For example, you can set the data acquisition label to: <m:txt></m:txt>, which includes parameters Scope, Table, Field, Lable, and MaxRow. The parameter Scope specifies the range when the data is directly obtained, including Request or Session. The parameter Table specifies the name of the database table to be queried when reading data from the database. The parameter Field specifies the name of the field to be queried. The parameter Lable specifies the front end display text. The parameter MaxRow specifies the number of records displayed on the web page. If the number of records exceeds this number, the page is displayed.

所述標籤解析模組212用於依次解析所獲取的每個建模標籤,並根據解析結果生成靜態網頁,具體過程如下所述。The tag parsing module 212 is configured to parse each acquired model tag in turn, and generate a static web page according to the parsing result. The specific process is as follows.

如果所述建模標籤是跳轉標籤,則標籤解析模組212將該跳轉標籤和跳轉後的網頁範本資訊存儲到所述範本配置檔中,所述網頁範本資訊包括網頁顯示的樣式、顏色和 功能表等。If the modeling tag is a jump tag, the tag parsing module 212 stores the jump tag and the redirected webpage template information in the template configuration file, where the webpage template information includes a style, a color, and a webpage display. Menu, etc.

如果所述建模標籤是資料獲取標籤,則標籤解析模組212根據所述資料獲取標籤中設定的資料獲取方式獲取相應資料。具體而言,如果所述資料獲取方式為直接獲取,則所述標籤解析模組212在程式的Request範圍或Session範圍內獲取資料。如果所述資料獲取方式為從資料庫21中讀取資料,則所述標籤解析模組212根據所述資料獲取標籤中設定的資料庫表名和所對應的欄位名進行資料庫查詢,獲取相應的資料。然後,所述標籤解析模組212格式化所述獲取的資料,所述格式化包括換行、設置顯示長度和分頁等。最後,所述標籤解析模組212將所述格式化後的資料替換掉所述資料獲取標籤,並輸出最終的編碼,生成靜態網頁。If the modeling tag is a data acquisition tag, the tag parsing module 212 acquires the corresponding data according to the data acquisition manner set in the data acquisition tag. Specifically, if the data acquisition mode is direct acquisition, the tag parsing module 212 acquires data in a Request scope or a Session scope of the program. If the data acquisition method is to read the data from the database 21, the label analysis module 212 performs a database query according to the database table name and the corresponding field name set in the data acquisition label, and obtains corresponding information. data of. The tag parsing module 212 then formats the acquired material, including formatting, setting display length, and paging. Finally, the tag parsing module 212 replaces the formatted data with the data acquisition tag, and outputs the final code to generate a static web page.

如果所述建模標籤中只含有跳轉標籤,則所述標籤解析模組212直接將跳轉標籤轉化為普通的HTML標籤,並將整個頁面輸出為靜態網頁。If the modeling tag only contains a jump tag, the tag parsing module 212 directly converts the jump tag into a normal HTML tag and outputs the entire page as a static web page.

所述檢測模組213用於檢測所述範本配置檔中是否存在跳轉到次級網頁的跳轉標籤。如果一個跳轉標籤跳轉後的網頁範本為當前網頁範本的下級範本,則所述檢測模組213判斷該跳轉標籤為跳轉到次級網頁的跳轉標籤。如果所述範本配置檔中存在跳轉到次級網頁的跳轉標籤,則所述標籤獲取模組211提取所述跳轉標籤對應的網頁範本的所有編碼,從所述編碼中獲取建模標籤。然後,所述標籤解析模組212開始對其編碼中的建模標籤進行解析,生成 次級網頁。整個解析過程以一個遞迴的方式進行,將所有次級網頁依次進行解析,從而構建出整個網站。The detecting module 213 is configured to detect whether there is a jump label in the template configuration file that jumps to the secondary webpage. If the template of the webpage after the jump label is the subordinate template of the current webpage template, the detecting module 213 determines that the jump label is a jump label that jumps to the secondary webpage. If there is a jump label in the template configuration file that jumps to the secondary webpage, the label acquisition module 211 extracts all the codes of the webpage template corresponding to the jump label, and acquires the modeling label from the encoding. Then, the tag parsing module 212 starts parsing and modeling the modeled tags in the encoding. Secondary page. The entire parsing process is performed in a recursive manner, and all secondary web pages are parsed in turn to construct the entire website.

所述日誌生成模組214用於當所述範本配置檔中不存在跳轉到次級網頁的跳轉標籤時,透過XML對所生成的所有的靜態網頁進行結構記錄,並生成日誌檔用於記錄生成操作。所述結構記錄是指記錄所生成的所有的靜態網頁的層級關係。The log generation module 214 is configured to perform structural record on all generated static web pages through XML when the jump label of the secondary webpage does not exist in the template configuration file, and generate a log file for record generation. operating. The structure record refers to a hierarchical relationship of all static web pages generated by the record.

參閱圖3所示,係本發明基於建模的智慧化網站開發方法較佳實施方式的流程圖。步驟S401,所述配置檔讀取模組210在用戶透過用戶端電腦10登錄網站後,從網站伺服器20的存儲體中讀取所需的範本配置檔,從所述範本配置檔中獲取每個網頁範本的存儲路徑和各個網頁範本之間的層級關係,並載入標籤解析API(Application Programming Interface,應用編程介面)開始生成靜態網頁。Referring to FIG. 3, it is a flow chart of a preferred embodiment of the intelligent website development method based on the present invention. Step S401, after the user logs in to the website through the client computer 10, the profile reading module 210 reads the required template configuration file from the storage body of the website server 20, and obtains each template from the template configuration file. The hierarchical relationship between the storage path of each web page template and each web page template, and loading the Application Programming Interface (Application Programming Interface) to start generating static web pages.

步驟S402,所述標籤獲取模組211提取網站首頁範本的所有編碼,從所述編碼中獲取建模標籤。此時,所述網站首頁範本的所有編碼和建模標籤都暫存在記憶體空間。所述建模標籤是一種自定義的HTML(Hypertext Markup Language,超文本鏈結標示語言)標籤,主要包括跳轉標籤和資料獲取標籤等。Step S402, the tag obtaining module 211 extracts all codes of the homepage template of the website, and acquires a modeling tag from the code. At this point, all the encoding and modeling tags of the homepage template of the website are temporarily stored in the memory space. The modeling tag is a custom HTML (Hypertext Markup Language) tag, which mainly includes a jump tag and a data acquisition tag.

其中,所述跳轉標籤負責超鏈結(Hyperlink)的跳轉,例如,可以設定跳轉標籤為:<m:a></m:a>,其包括參數href、model和randomId。其中,參數href的定義與HTML標籤中的href定義相同,比如<m:a href href=”/Aegean/test.action”></m:a>,參數model指定跳轉後網頁的範本,比如<m:a href href=”Aegean/test.action”model=”test.jsp”>,參數randomId是一個遞增的數值,用於記錄該跳轉標籤出現的順序,系統將以該參數randomId的值命名該跳轉標籤對應網頁的名稱。The jump label is responsible for the jump of the hyperlink. For example, the jump label can be set to: <m:a></m:a>, which includes the parameters href, model, and randomId. The definition of the parameter href is the same as the definition of the href in the HTML tag, such as <m:a href Href=”/Aegean/test.action”></m:a>, the parameter model specifies the template of the page after the jump, such as <m:a href href=”Aegean/test.action”model=”test.jsp”> The parameter randomId is an incremental value used to record the order in which the jump label appears. The system will name the web page corresponding to the jump label with the value of the parameter randomId.

所述資料獲取標籤用於設定資料獲取方式、從資料庫21中查詢的資料庫表名和所對應的欄位名、資料顯示時的格式等,所述資料獲取方式包括直接獲取和從資料庫中讀取資料。例如,可以設定資料獲取標籤為:<m:txt></m:txt>,其包括參數Scope、Table、Field、Lable和MaxRow等。其中,參數Scope指定直接獲取資料時的範圍,包括Request或Session,參數Table指定從資料庫中讀取資料時查詢的資料庫表名,參數Field指定查詢的欄位名,參數Lable指定前端顯示文字,參數MaxRow指定網頁中顯示的記錄條數,超過此條數則分頁顯示。The data acquisition label is used to set a data acquisition manner, a database table name queried from the database 21, a corresponding column name, a format when the data is displayed, and the like, and the data acquisition manner includes direct acquisition and retrieval from the database. Read the data. For example, you can set the data acquisition label to: <m:txt></m:txt>, which includes parameters Scope, Table, Field, Lable, and MaxRow. The parameter Scope specifies the range when the data is directly obtained, including Request or Session. The parameter Table specifies the name of the database table to be queried when reading data from the database. The parameter Field specifies the name of the field to be queried. The parameter Lable specifies the front end display text. The parameter MaxRow specifies the number of records displayed on the web page. If the number of records exceeds this number, the page is displayed.

步驟S403,所述標籤解析模組212依次解析所獲取的每個建模標籤,並根據解析結果生成靜態網頁,具體流程如下所述。In step S403, the tag parsing module 212 sequentially parses each acquired modeling tag, and generates a static webpage according to the parsing result. The specific process is as follows.

如果所述建模標籤是跳轉標籤,則標籤解析模組212將該跳轉標籤和跳轉後的網頁範本資訊存儲到所述範本配置檔中,所述網頁範本資訊包括網頁顯示的樣式、顏色和功能表等。If the modeling tag is a jump tag, the tag parsing module 212 stores the jump tag and the redirected webpage template information in the template configuration file, where the webpage template information includes a style, a color, and a function of the webpage display. Table and so on.

如果所述建模標籤是資料獲取標籤,則標籤解析模組212根據所述資料獲取標籤中設定的資料獲取方式獲取相 應資料。具體而言,如果所述資料獲取方式為直接獲取,則所述標籤解析模組212在程式的Request範圍或Session範圍內獲取資料。如果所述資料獲取方式為從資料庫21中讀取資料,則所述標籤解析模組212根據所述資料獲取標籤中設定的資料庫表名和所對應的欄位名進行資料庫查詢,獲取相應的資料。然後,所述標籤解析模組212格式化所述獲取的資料,所述格式化包括換行、設置顯示長度和分頁等。最後,所述標籤解析模組212將所述格式化後的資料替換掉所述資料獲取標籤,並輸出最終的編碼,生成靜態網頁。If the modeling tag is a data acquisition tag, the tag parsing module 212 acquires the phase according to the data acquisition mode set in the data acquisition tag. Information should be provided. Specifically, if the data acquisition mode is direct acquisition, the tag parsing module 212 acquires data in a Request scope or a Session scope of the program. If the data acquisition method is to read the data from the database 21, the label analysis module 212 performs a database query according to the database table name and the corresponding field name set in the data acquisition label, and obtains corresponding information. data of. The tag parsing module 212 then formats the acquired material, including formatting, setting display length, and paging. Finally, the tag parsing module 212 replaces the formatted data with the data acquisition tag, and outputs the final code to generate a static web page.

如果所述建模標籤中只含有跳轉標籤,則所述標籤解析模組212直接將跳轉標籤轉化為普通的HTML標籤,並將整個頁面輸出為靜態網頁。If the modeling tag only contains a jump tag, the tag parsing module 212 directly converts the jump tag into a normal HTML tag and outputs the entire page as a static web page.

步驟S404,所述檢測模組213檢測所述範本配置檔中是否存在跳轉到次級網頁的跳轉標籤。如果一個跳轉標籤跳轉後的網頁範本為當前網頁範本的下級範本,則所述檢測模組213判斷該跳轉標籤為跳轉到次級網頁的跳轉標籤。如果所述範本配置檔中存在跳轉到次級網頁的跳轉標籤,則流程進入步驟S405,如果所述範本配置檔中不存在跳轉到次級網頁的跳轉標籤,則流程進入步驟S406。Step S404, the detecting module 213 detects whether there is a jump label in the template configuration file that jumps to the secondary webpage. If the template of the webpage after the jump label is the subordinate template of the current webpage template, the detecting module 213 determines that the jump label is a jump label that jumps to the secondary webpage. If there is a jump label in the template configuration file that jumps to the secondary web page, the flow proceeds to step S405, and if there is no jump label to jump to the secondary web page in the template configuration file, the flow proceeds to step S406.

步驟S405,所述標籤獲取模組211提取所述跳轉標籤對應的網頁範本的所有編碼,從所述編碼中獲取建模標籤,然後流程轉到步驟S403,所述標籤解析模組212開始對其編碼中的建模標籤進行解析,生成次級網頁。整個解 析過程以一個遞迴的方式進行,將所有次級網頁依次進行解析,從而構建出整個網站。Step S405, the tag obtaining module 211 extracts all the codes of the webpage template corresponding to the jump label, acquires the modeling label from the encoding, and then the process goes to step S403, and the label parsing module 212 starts to The modeling tags in the encoding are parsed to generate secondary web pages. Entire solution The analysis process is carried out in a recursive manner, and all secondary web pages are parsed in turn to construct the entire website.

步驟S406,所述日誌生成模組214透過XML對所生成的所有的靜態網頁進行結構記錄,並生成日誌檔用於記錄生成操作。所述結構記錄是指記錄所生成的所有的靜態網頁的層級關係。Step S406, the log generation module 214 performs structural record on all generated static web pages through XML, and generates a log file for recording and generating operations. The structure record refers to a hierarchical relationship of all static web pages generated by the record.

本發明基於建模的智慧化網站開發系統及方法,雖以較佳實施例揭露如上,然其並非用以限定本發明。任何熟悉此項技藝之人士,在不脫離本發明之精神及範圍內,當可做更動與潤飾,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。The present invention is based on a modeled intelligent website development system and method. Although the above is disclosed in the preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art will be able to make changes and refinements without departing from the spirit and scope of the invention, and the scope of the invention is defined by the scope of the appended claims.

用戶端電腦‧‧‧10Client computer ‧‧10

網站伺服器‧‧‧20Website server ‧ ‧ 20

資料庫‧‧‧21Database ‧ ‧ 21

網路‧‧‧30Internet ‧ ‧ 30

配置檔讀取模組‧‧‧210Configuration file reading module ‧‧‧210

標籤獲取模組‧‧‧211Tag acquisition module ‧‧‧211

標籤解析模組‧‧‧212Label Resolution Module ‧‧212

檢測模組‧‧‧213Detection module ‧‧ 213

日誌生成模組‧‧‧214Log generation module ‧‧‧214

讀取所需的範本配置檔‧‧‧S401Read the required template configuration file ‧‧‧S401

提取網站首頁範本的所有編碼,從所述編碼中獲取建模標籤‧‧‧S402Extract all the code of the homepage template and get the modeling tag from the code. ‧‧S402

依次解析所獲取的每個建模標籤,並根據解析結果生成靜態網頁‧‧‧S403Parse each of the acquired modeling tags in turn, and generate a static web page based on the analysis results. ‧‧S403

所述範本配置檔中是否存在跳轉到次級網頁的跳轉標籤‧‧‧S404Is there a jump label in the template configuration file that jumps to the secondary web page? ‧‧S404

提取所述跳轉標籤對應的網頁範本的所有編碼,從所述編碼中獲取建模標籤‧‧‧S405Extracting all the codes of the webpage template corresponding to the jump label, and obtaining the modeling label from the code ‧‧‧S405

對所生成的所有的靜態網頁進行結構記錄,並生成日誌檔‧‧‧S406Perform structural records on all generated static web pages and generate log files ‧‧‧S406

圖1係本發明基於建模的智慧化網站開發系統較佳實施方式的硬體架構圖。1 is a hardware architecture diagram of a preferred embodiment of a modeling-based intelligent website development system of the present invention.

圖2係圖1中所示網站伺服器的功能模組圖。FIG. 2 is a functional block diagram of the website server shown in FIG. 1.

圖3係本發明基於建模的智慧化網站開發方法較佳實施方式的流程圖。3 is a flow chart of a preferred embodiment of a modeling-based intelligent website development method of the present invention.

讀取所需的範本配置檔‧‧‧S401Read the required template configuration file ‧‧‧S401

提取網站首頁範本的所有編碼,從所述編碼中獲取建模標籤‧‧‧S402Extract all the code of the homepage template and get the modeling tag from the code. ‧‧S402

依次解析所獲取的每個建模標籤,並根據解析結果生成靜態網頁‧‧‧S403Parse each of the acquired modeling tags in turn, and generate a static web page based on the analysis results. ‧‧S403

所述範本配置檔中是否存在跳轉到次級網頁的跳轉標籤‧‧‧S404Is there a jump label in the template configuration file that jumps to the secondary web page? ‧‧S404

提取所述跳轉標籤對應的網頁範本的所有編碼,從所述編碼中獲取建模標籤‧‧‧S405Extracting all the codes of the webpage template corresponding to the jump label, and obtaining the modeling label from the code ‧‧‧S405

對所生成的所有的靜態網頁進行結構記錄,並生成日誌檔‧‧‧S406Perform structural records on all generated static web pages and generate log files ‧‧‧S406

Claims (8)

一種基於建模的智慧化網站開發系統,包括一個網站伺服器,其中,所述網站伺服器包括:配置檔讀取模組,用於從存儲體中讀取所需的範本配置檔,從所述範本配置檔中獲取每個網頁範本的存儲路徑和各個網頁範本之間的層級關係;標籤獲取模組,用於提取網站首頁範本的所有編碼,從所述編碼中獲取建模標籤,所述建模標籤包括跳轉標籤和資料獲取標籤;標籤解析模組,用於依次解析所獲取的每個建模標籤,並根據解析結果生成靜態網頁;檢測模組,用於檢測所述範本配置檔中是否存在跳轉到次級網頁的跳轉標籤;所述標籤獲取模組,還用於當所述範本配置檔中存在跳轉到次級網頁的跳轉標籤時,提取所述跳轉標籤對應的網頁範本的所有編碼,從所述編碼中獲取建模標籤;所述標籤解析模組,還用於對所述跳轉標籤對應的網頁範本編碼中的建模標籤進行解析,生成次級網頁;及日誌生成模組,用於當所述範本配置檔中不存在跳轉到次級網頁的跳轉標籤時,對所生成的所有的靜態網頁進行結構記錄,並生成日誌檔 記錄生成操作。A modeling-based intelligent website development system includes a website server, wherein the website server includes: a configuration file reading module for reading a required template configuration file from a storage body, Obtaining a hierarchical relationship between a storage path of each webpage template and each webpage template in the template configuration file; a label obtaining module, configured to extract all encodings of the website homepage template, and obtain a modeling label from the encoding, The modeling tag includes a jump tag and a data acquisition tag, and the tag parsing module is configured to sequentially parse each of the acquired modeling tags, and generate a static webpage according to the parsing result; and the detecting module is configured to detect the template configuration file. Whether there is a jump label that jumps to the secondary webpage; the label acquisition module is further configured to: when there is a jump label that jumps to the secondary webpage in the template configuration file, extract all the template of the webpage corresponding to the jump label Encoding, obtaining a modeling tag from the encoding; the tag parsing module is further configured to build a webpage template code corresponding to the jump tag The tag is parsed to generate a secondary webpage; and a log generating module is configured to perform structural recording on all generated static webpages when the jump profile of the secondary webpage does not exist in the template configuration file, and generate Log file Record generation operation. 如申請專利範圍第1項所述之基於建模的智慧化網站開發系統,其中,所述標籤解析模組依次解析所獲取的每個建模標籤,並根據解析結果生成靜態網頁包括:如果所述建模標籤是跳轉標籤,則所述標籤解析模組將該跳轉標籤和跳轉後的網頁範本資訊存儲到所述範本配置檔中;如果所述建模標籤是資料獲取標籤,則所述標籤解析模組根據所述資料獲取標籤中設定的資料獲取方式獲取相應資料,然後格式化所述獲取的資料,將所述格式化後的資料替換掉所述資料獲取標籤,並輸出最終的編碼,生成靜態網頁;及如果所述建模標籤中只含有跳轉標籤,則所述標籤解析模組直接將跳轉標籤轉化為普通的HTML標籤,並將整個頁面輸出為靜態網頁。The modeling-based intelligent website development system of claim 1, wherein the label parsing module sequentially parses each of the acquired modeling tags, and generates a static webpage according to the parsing result: The modeling tag is a jump tag, and the tag parsing module stores the jump tag and the redirected webpage template information in the template configuration file; if the modeling tag is a data acquisition tag, the tag The parsing module acquires the corresponding data according to the data obtaining manner set in the data obtaining label, and then formats the obtained data, replaces the formatted data with the data obtaining label, and outputs the final encoding. Generating a static web page; and if the modeling tag only contains a jump tag, the tag parsing module directly converts the jump tag into a normal HTML tag and outputs the entire page as a static web page. 如申請專利範圍第2項所述之基於建模的智慧化網站開發系統,其中,所述標籤解析模組根據所述資料獲取標籤中設定的資料獲取方式獲取相應資料包括:如果所述資料獲取方式為直接獲取,則所述標籤解析模組在程式的Request範圍或Session範圍內獲取資料;及 如果所述資料獲取方式為從資料庫中讀取資料,則所述標籤解析模組根據所述資料獲取標籤中設定的資料庫表名和所對應的欄位名進行資料庫查詢,獲取相應的資料。The model-based intelligent website development system of claim 2, wherein the label parsing module acquires corresponding data according to the data acquisition manner set in the data acquisition label, including: if the data is acquired The method is direct acquisition, and the label parsing module acquires data in a Request scope or a Session range of the program; and If the data acquisition method is to read the data from the database, the label analysis module performs a database query according to the database table name and the corresponding field name set in the data acquisition label, and obtains corresponding data. . 如申請專利範圍第2項所述之基於建模的智慧化網站開發系統,其中,所述網頁範本資訊包括網頁顯示的樣式、顏色和功能表,所述格式化包括換行、設置顯示長度和分頁。The model-based intelligent website development system of claim 2, wherein the webpage template information includes a style, a color, and a function table of a webpage display, the formatting including line feed, setting display length, and paging . 一種基於建模的智慧化網站開發方法,該方法包括如下步驟:(a)從存儲體中讀取所需的範本配置檔,從所述範本配置檔中獲取每個網頁範本的存儲路徑和各個網頁範本之間的層級關係;(b)提取網站首頁範本的所有編碼,從所述編碼中獲取建模標籤,所述建模標籤包括跳轉標籤和資料獲取標籤;(c)依次解析所獲取的每個建模標籤,並根據解析結果生成靜態網頁;(d)檢測所述範本配置檔中是否存在跳轉到次級網頁的跳轉標籤;(e)當所述範本配置檔中存在跳轉到次級網頁的跳轉標籤時,提取所述跳轉標籤對應的網頁範本的所有編碼,從所述編碼中獲取建模標籤,然後流程轉到步驟(c);及 (f)當所述範本配置檔中不存在跳轉到次級網頁的跳轉標籤時,對所生成的所有的靜態網頁進行結構記錄,並生成日誌檔記錄生成操作。A modeling-based intelligent website development method, the method comprising the steps of: (a) reading a required template configuration file from a storage body, obtaining a storage path of each webpage template from the template configuration file, and each a hierarchical relationship between webpage templates; (b) extracting all the codes of the homepage template of the website, obtaining modeling tags from the encoding, the modeling tags including jump tags and data acquisition tags; (c) sequentially parsing the acquired tags Each modeling tag generates a static web page according to the parsing result; (d) detecting whether there is a jump label in the template configuration file that jumps to the secondary web page; (e) when there is a jump to the secondary in the template configuration file When the jump label of the webpage is obtained, extract all the codes of the webpage template corresponding to the jump label, obtain a modeling label from the encoding, and then the flow proceeds to step (c); (f) When there is no jump label jumping to the secondary web page in the template configuration file, structural records are recorded for all generated static web pages, and a log file record generating operation is generated. 如申請專利範圍第5項所述之基於建模的智慧化網站開發方法,其中,所述步驟(c)包括:如果所述建模標籤是跳轉標籤,則將該跳轉標籤和跳轉後的網頁範本資訊存儲到所述範本配置檔中;如果所述建模標籤是資料獲取標籤,則根據所述資料獲取標籤中設定的資料獲取方式獲取相應資料,然後格式化所述獲取的資料,將所述格式化後的資料替換掉所述資料獲取標籤,並輸出最終的編碼,生成靜態網頁;及如果所述建模標籤中只含有跳轉標籤,則直接將跳轉標籤轉化為普通的HTML標籤,並將整個頁面輸出為靜態網頁。The method for developing a smart website according to claim 5, wherein the step (c) comprises: if the modeling tag is a jump tag, the jump tag and the web page after the jump The template information is stored in the template configuration file; if the modeling tag is a data acquisition tag, the corresponding data is obtained according to the data acquisition manner set in the data acquisition tag, and then the obtained data is formatted, and the The formatted data replaces the data acquisition label, and outputs the final encoding to generate a static web page; and if the modeling label contains only the jump label, the jump label is directly converted into a normal HTML label, and Output the entire page as a static web page. 如申請專利範圍第6項所述之基於建模的智慧化網站開發方法,其中,所述步驟根據所述資料獲取標籤中設定的資料獲取方式獲取相應資料包括:如果所述資料獲取方式為直接獲取,則在程式的Request範圍或Session範圍內獲取資料;及如果所述資料獲取方式為從資料庫中讀取資料,則根據所述資料獲取標籤中設定的資料庫 表名和所對應的欄位名進行資料庫查詢,獲取相應的資料。The method for developing a smart website based on the model of claim 6, wherein the step of obtaining the corresponding data according to the data acquisition manner set in the data acquisition label comprises: if the data acquisition method is direct Acquiring, obtaining data in the Request scope or the scope of the program; and if the data acquisition method is to read the data from the database, obtaining the database set in the label according to the data acquisition The name of the table and the corresponding field name are searched in the database to obtain the corresponding data. 如申請專利範圍第6項所述之基於建模的智慧化網站開發方法,其中,所述網頁範本資訊包括網頁顯示的樣式、顏色和功能表,所述格式化包括換行、設置顯示長度和分頁。The model-based intelligent website development method according to claim 6, wherein the webpage template information includes a style, a color, and a function table of the webpage display, the formatting including line feed, setting display length, and paging .
TW97124072A 2008-06-27 2008-06-27 System and method for automatically generating a website based on pre-defined webpage templates TWI407372B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW97124072A TWI407372B (en) 2008-06-27 2008-06-27 System and method for automatically generating a website based on pre-defined webpage templates

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW97124072A TWI407372B (en) 2008-06-27 2008-06-27 System and method for automatically generating a website based on pre-defined webpage templates

Publications (2)

Publication Number Publication Date
TW201001287A TW201001287A (en) 2010-01-01
TWI407372B true TWI407372B (en) 2013-09-01

Family

ID=44824811

Family Applications (1)

Application Number Title Priority Date Filing Date
TW97124072A TWI407372B (en) 2008-06-27 2008-06-27 System and method for automatically generating a website based on pre-defined webpage templates

Country Status (1)

Country Link
TW (1) TWI407372B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6606525B1 (en) * 1999-12-27 2003-08-12 Motorola, Inc. System and method of merging static data in web pages
US20040230983A1 (en) * 2003-05-13 2004-11-18 Shi Shepherd S.B. Object oriented technology system for building business websites
TWI277903B (en) * 2005-09-08 2007-04-01 Tul Corp Method of automatically generating and updating webpage for man-machine interface
TW200813761A (en) * 2006-09-01 2008-03-16 Hon Hai Prec Ind Co Ltd System and method for downloading static web page
CN101183395A (en) * 2007-12-25 2008-05-21 北京中企开源信息技术有限公司 Method and system for realizing staticize of dynamic page

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6606525B1 (en) * 1999-12-27 2003-08-12 Motorola, Inc. System and method of merging static data in web pages
US20040230983A1 (en) * 2003-05-13 2004-11-18 Shi Shepherd S.B. Object oriented technology system for building business websites
TWI277903B (en) * 2005-09-08 2007-04-01 Tul Corp Method of automatically generating and updating webpage for man-machine interface
TW200813761A (en) * 2006-09-01 2008-03-16 Hon Hai Prec Ind Co Ltd System and method for downloading static web page
CN101183395A (en) * 2007-12-25 2008-05-21 北京中企开源信息技术有限公司 Method and system for realizing staticize of dynamic page

Also Published As

Publication number Publication date
TW201001287A (en) 2010-01-01

Similar Documents

Publication Publication Date Title
CN101609399B (en) Intelligent website development system based on modeling and method thereof
Myllymaki Effective Web data extraction with standard XML technologies
JP5756386B2 (en) Method, apparatus, and program for supporting generation and management of metadata for correcting problems of dynamic web application
US8321396B2 (en) Automatically extracting by-line information
CN102073726B (en) Structured data import method and device for search engine system
US8397161B1 (en) Content compilation and publishing system
US20080114745A1 (en) Simplified search interface for querying a relational database
CN102053994B (en) Language parser and parsing method using same
CN106951231B (en) Computer software development method and device
CN101872350A (en) Web page text extracting method and device thereof
CN101763255A (en) Format conversion method and device of special interface tool
US20130124969A1 (en) Xml editor within a wysiwyg application
US20110078165A1 (en) Document-fragment transclusion
CN106980619B (en) Data query method and device
CN113177168A (en) Positioning method based on Web element attribute characteristics
Mitrevski et al. WikiHist. html: English Wikipedia's full revision history in HTML format
KR20010094955A (en) Aggregation of content as a personalized document
Liu et al. An XML-enabled data extraction toolkit for web sources
TWI407372B (en) System and method for automatically generating a website based on pre-defined webpage templates
KR20050071720A (en) Methods for dynamically building the home page and apparatus embodied on the web therefor
WO2010147453A1 (en) System and method for designing a gui for an application program
KR101231329B1 (en) System for web data extraction for mobile platform
Yu et al. A novel method for extracting entity data from Deep Web precisely
CN108733353B (en) Interface construction method and device
CN110618809B (en) Front-end webpage input constraint extraction method and device

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees
MM4A Annulment or lapse of patent due to non-payment of fees