Focal Point
[SOLVED] AS v8.0.08 - is there a way to search for a string in the existing fexes?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1317019276

October 01, 2014, 01:02 PM
Francis Mariani
[SOLVED] AS v8.0.08 - is there a way to search for a string in the existing fexes?
I'd like to search for a particularly complicated piece of code that I wrote in a fex. Is there a way for me to find it? I haven't found one.

For the WF7 environment, I mapped a network drive to the basedir directory and then used EditPlus to search for a string. In WF 8, the fexes are stored in a database - there appears to be no way to search in the database. I tied the Change Management Export, but that creates folder contents that are unreadable.

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 01, 2014, 01:17 PM
MartinY
If you know the database and the table name that contain the fex you can do a SELECT * FROM db.tb WHERE field LIKE '%yourstring%';, isn't it ?

I've made that kind of search already for RC tables when it was installed in SQL DB in a previous life :-)

I think that for now it's the only way.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 01, 2014, 01:39 PM
Francis Mariani
Martin, aren't the fexes stored in blobs, which are not readable?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 01, 2014, 02:03 PM
MartinY
Your probably right, I haven't seen yet how the tables looks like.
It's just something I heard that since it's now in SQL table it will be more "easy" to do search/maintenance instead of doing it in htm files. Maybe that is only about the basedir and we're loosing "flexibility" when we're talking EDASERVE...

I remember that there was another discussion about this (looking for a tool to do search in fex with v8) a few weeks ago but can't find it.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 01, 2014, 02:36 PM
<Kathryn Henning>
Hi Francis and Martin,

Is this the thread that you're looking for?

List Procedures by Synonyms

Cheers!

Kathryn
October 01, 2014, 03:00 PM
MartinY
That is the one that I was talking about.

Whish this may help Francis :-)


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
October 01, 2014, 03:30 PM
stur0063
Ourdatbase is SQL Server:


I query the WF_CONTENT_REVS table in the webfocus database. We use SQL Passthrough. There's a little cast action cooking for a like statement. I dug around Focal Point awhile back and found a post that got me started - Joey S. had the good stuff: http://forums.informationbuild...537068176#3537068176



Here's the final *.fex we use to find X in code.


-*Report to dump *.fex that have a certain variable.
-DEFAULT &MYJUNK = 'SET CURSORS'
-DEFAULT &OUTFORMAT = 'HTML';
-SET &MYJUNK = '%' | &MYJUNK | '%';


SET EMPTYREPORT = ON

ENGINE SQLMSS SET DEFAULT_CONNECTION webFOC
SQL SQLMSS PREPARE SQLOUT FOR
SELECT CR.OBJ_HANDLE
		,RO.PRT_PATH
		,RO.OBJNAME
		,RO.OBJTYPE
		,CR.[CREATEDBY]
		,CR.[CREATEDON]
		,RO.[LASTMODON]
		,RO.[LASTACCESSBY]
		,CAST(cast(cast(CR.BCONTENT as varbinary(max)) as varchar(max)) AS nTEXT) AS 'FexCode'
FROM [WF_CONTENT_REVS] CR
JOIN WF_REPOSOBJ RO ON RO.HANDLE = CR.OBJ_HANDLE
where CAST(cast(cast(CR.BCONTENT as varbinary(max)) as varchar(max)) AS nTEXT) like &MYJUNK.QUOTEDSTRING
order by RO.[LASTMODON]
END

TABLE FILE SQLOUT
PRINT
 	PRT_PATH AS 'Content Path'
 	OBJNAME AS 'fileName'
	LASTACCESSBY AS 'Last Accessed By'
-* 	OBJTYPE AS 'Object Type'
-* 	CREATEDON AS 'Created On'
-*    LASTMODON AS 'Last Modified On'
-*	OBJ_HANDLE AS 'Fex ID'
-*	FexCode AS 'Fex Code'
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT &OUTFORMAT.EVAL
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END




webFOCUS 8207.15
WindowsServer 2019
October 01, 2014, 03:37 PM
bug
I haven't had a chance to try WF 8 but the client is planning an upgrade early next year. I'm surprised fex programs will be saved in the database instead of files.

With code being saved into tables, we can't use any external editors in favor. Everything would depends on the app studio. And of course it's not easy to search for code in folders.

Anyone thinks this is a better move?


7.66 and 7.704
System: Windows / AIX / Linux
Output: Mostly HTML, with some PDF, Excel and Lotus(!)
October 01, 2014, 04:32 PM
Francis Mariani
The post Kathryn suggested we look at is very helpful.

The Change Management setting IBI_CM_Format_Raw does help a lot.

I really do mourn the loss of being able to open the 20 fexes and HTML files of a particular project in an external text editor, make changes to one or many of the files and then save them all - all this without App Studio. In App Studio v8.0.08 you have to click on each file, right click, open in External text editor, make changes, save all, and then hope the changes get applied back via App Studio (they sometimes don't). Because version v8.0.08 does not update the Last Update date/time, you have to quit and restart App Studio.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 01, 2014, 04:51 PM
Francis Mariani
In theory I should be able to run Change Management Export, open the exported files in an external text editor, make and save changes, run Change Management Import, test the reports/HTML pages - all without App Studio. Hopefully no check-sums are included in the CM package.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 01, 2014, 05:28 PM
Francis Mariani
Oh well Frowner

After changing the CM setting, Export creates a package containing two main folders, root and root_content. It used to contain only one, root.

This suggests that the root_content is for reading only.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server