Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Searching Fex's in web Focus 8
Page 1 2 
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Searching Fex's in web Focus 8
 Login/Join
 
Master
posted Hide Post
This works with SQL Server (ReportCaster.BOTLDATA.REPORT):

Since the payload 'decompiles' to PDF which is gibberish when viewed as plain text, perhaps someone can test this on a blob field with plain text contents? Even better, test against WF8 fex contents?

SELECT convert(varchar(max), cast(REPORT as binary)) 
FROM BOTLDATA
WHERE report_id ='some_report_id'


thread I borrowed this from, here: http://stackoverflow.com/quest...to-string-sql-server


MySQL version (tested on an SAP CMS database in MySQL with a text based blob field):

select LastModifyTime, CONVERT(LastModifyTime USING utf8) 
FROM boe120.CMS_InfoObjects6
where objectid = '98016'


http://stackoverflow.com/quest...lob-to-text-in-mysql

- ABT

This message has been edited. Last edited by: ABT,
 
Posts: 561 | Registered: February 03, 2010Reply With QuoteReport This Post
Master
posted Hide Post
Just to clarify, the creature ate Sheboygan.

J.



 
Posts: 931 | Location: At the Mast | Registered: May 17, 2007Reply With QuoteReport This Post
Platinum Member
posted Hide Post
This is news to me. Like many have commented, I am constantly using tools to search through fexes in order to find certain parts of code... and also to batch replace strings (I use astrogrep and notepad++ btw). And winmerge for comparisons. This will certainly be more complicated once everything is stored in blobs in the db....


WF 8.0.0.5M
 
Posts: 246 | Location: Montreal, QC, Canada | Registered: October 01, 2003Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Hi running

I tested the select statement, provided by ABT in webfocus 8. It returns the fex that is stored in the BLOB. And it is in a readable format.


Crystal


Webfocus 8.0.7 on Windows
 
Posts: 176 | Location: Ohio | Registered: October 26, 2006Reply With QuoteReport This Post
Master
posted Hide Post
quote:
Originally posted by CLH:
Hi running

I tested the select statement, provided by ABT in webfocus 8. It returns the fex that is stored in the BLOB. And it is in a readable format.

Crystal


Thanks for the confirmation, this is good news. Would you mind creating a simple 'TABLE FILE CAR' program and then decoding the text via that query and posting the full result set (via a SELECT * from the database)?

Your test tells me that the data *can* be gotten to, but with some pain (the decode function is very slow (at least in my ReportLibrary PDF test)). ReportCaster ZULU TIME, anyone?

I'm assuming that the FEX text either shows as one big long string (with or without embedded carriage return/new lines) or as a block with line breaks. If so, I'm wondering if an ETL function could be written that could then reinsert the individual lines to another table for easier searching?

Something like this:

MREDOMAIN   FEXNAME   FEXTITLE   CREATE_NAME         CREATE_DATE       MODIFY_DATE       LINE   PROGRAM TEXT
mydomain    car.fex   Car Test   Joe Blow (a12345)   20130206 080000   20130206 080000   1      TABLE FILE CAR
mydomain    car.fex   Car Test   Joe Blow (a12345)   20130206 080000   20130206 080000   2      PRINT
mydomain    car.fex   Car Test   Joe Blow (a12345)   20130206 080000   20130206 080000   3      *
mydomain    car.fex   Car Test   Joe Blow (a12345)   20130206 080000   20130206 080000   4      WHERE COUNTRY EQ 'JAPAN';
mydomain    car.fex   Car Test   Joe Blow (a12345)   20130206 080000   20130206 080000   5      END


Or it could be normalized, but you get the idea.

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
And I'd like to know if you can use a SELECT statement determine all the fex names that match a search criteria that searches the text of the fex.

Thanks very much.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
It's interesting that all us 7.7'ers can do is speculate and beg the 8.0'ers for information - the 8.0 docs are under lock and key...


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Master
posted Hide Post
quote:
Originally posted by Francis Mariani:
And I'd like to know if you can use a SELECT statement determine all the fex names that match a search criteria that searches the text of the fex.

Thanks very much.


That's what I was getting to with the load, an easy way to query the contents. As it stands, per CLH's assertion, you could do the following:

MySQL Dialect using Business Objects CMS database:
Select * 
from (
   select LastModifyTime, CONVERT(LastModifyTime USING utf8) as charLastModifyTime
   FROM boe120.CMS_InfoObjects6
   where objectid = '98016'
   limit 2
) as modifyTime
where charLastModifyTime like '%2012 01 19%'


Results:
LastModifyTime    charLastModifyTime
[BLOB]            2012 01 19 04 40 44 329


I'm thinking that the fex data store could be queried similarly. Decoding on the fly would be slow and provide fewer capabilities. UNIONS or another subselect could then be used to query for a second term.

Off-Topic: Something I've never liked about this or other text based methodologies is the loss of context. Just because a word is found doesn't mean it is used in the way that I want. Like a comment or local variable/hold file name that may match a watch word. That is one thing I like about Impact Analysis. It just can't be used to manage effectively.

- ABT


------------------------------------
WF Environment:
------------------------------------
Server/Client, ReportCaster, Dev Studio: 7.6.11
Resource Analyzer, Resource Governor, Library, Maintain, InfoAssist
OS: Windows Server 2003
Application/Web Server: Tomcat 5.5.25
Java: JDK 1.6.0_03
Authentication: LDAP, MRREALM Driver
Output: PDF, EXL2K, HTM

------------------------------------
Databases:
------------------------------------
Oracle 10g
DB2 (AS/400)
MSSQL Server 2005
Access/FoxPro
 
Posts: 561 | Registered: February 03, 2010Reply With QuoteReport This Post
Gold member
posted Hide Post
I created this query to grab fex code from content folders:

  
USE WebFocus

SELECT CR.OBJ_HANDLE AS 'Fex Name'
      ,CR.[CREATEDBY] as 'Created By'
      ,CR.[CREATEDON] as 'Created On'
	  ,CAST(cast(cast(CR.BCONTENT as varbinary(max)) as varchar(max)) AS nTEXT) AS 'Fex Code',
	  RO.PRT_PATH AS 'Content Path'	
FROM [WebFocus].[dbo].[WF_CONTENT_REVS] CR
JOIN WebFocus.dbo.WF_REPOSOBJ RO ON RO.HANDLE = CR.OBJ_HANDLE




Prod/Dev: WebFOCUS 8.0.08 on Windows Server 2008/Tomcat , WebFOCUS DevStudio 8.0.08 on Windows 7 Pro


 
Posts: 94 | Location: Austin, TX | Registered: August 08, 2012Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Joey - this is wonderful - I've been looking for something like this to find out which *.fex may have a variable or table for quite some time.

I made very minor tweak to order - and added fileName to the output. I think the only thing I'd really like to see added, if possible, is "private". I poked around the database - and I wasn't able to figure out how to tell if a particular object was private.

SELECT CR.OBJ_HANDLE AS 'Fex ID'
		,RO.PRT_PATH AS 'Content Path'	
		,RO.OBJNAME as fileName
		,RO.OBJTYPE as 'Object Type'
		,CR.[CREATEDBY] as 'Created By'
		,CR.[CREATEDON] as 'Created On'
		,RO.[LASTMODON] as 'Last Modified On'
		,CAST(cast(cast(CR.BCONTENT as varbinary(max)) as varchar(max)) AS nTEXT) AS 'Fex Code'	  
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 '%H2O_SINGLE_ITM_DDL%'
--where RO.PRT_PATH like '%H2OSales/Products%'
--where objname like '%logo%'
order by RO.[LASTMODON] 


webFOCUS 8203
WindowsServer 2012 R2,
Excel, PDF, HTML, ActiveReports
 
Posts: 124 | Location: Minnesota | Registered: August 26, 2013Reply With QuoteReport This Post
Guru
posted Hide Post
I am trying this using db2 files. I keep getting BCONTENT displayed in hexadecimal. What is a good value to replace nTEXT with?


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
 
Posts: 341 | Location: Pembroke NH/Jericho NY | Registered: June 15, 2011Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Hi,

Depending on what version you have of 8.0 you can set IB_CM_FORMAT_RAW to true in the administration console.

Then create an export of your code. It will read it from the repository and store it in readable format on your drive. You can then use that code for searches etc.

Now if there was a way to schedule this then you could always have a current copy of the code to search or use for restores.

Crystal


Webfocus 8.0.7 on Windows
 
Posts: 176 | Location: Ohio | Registered: October 26, 2006Reply With QuoteReport This Post
Guru
posted Hide Post
Thanks!

I will look into that.


WebFocus 8.1.5
iSeries/Windows
DB2/SQL/Access
Dev Studio
App Studio
Maintain
ReportCaster
 
Posts: 341 | Location: Pembroke NH/Jericho NY | Registered: June 15, 2011Reply With QuoteReport This Post
  Powered by Social Strata Page 1 2  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Searching Fex's in web Focus 8

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.