Focal Point
[SOLVED] Systematically search the Content Repository

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

April 04, 2017, 11:19 AM
W Kassebaum
[SOLVED] Systematically search the Content Repository
Is there a way yet to search the Content Repository (ie the DB structure which stores content code)

All our presentation logic is stored in the content area..and we are not able to search all that focus code for fields etc when looking things from a change impact. (ie..if we need to change a title of a field from "titla A" to "title B"..

We cannot find the entire population of fexes we would have to change.

if I knew the RDBMS table it was stored in, then I could make a Focus (or SQL ) call to look at the code.

Any thoughts/considerations would be greatly appreciated.

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
April 04, 2017, 11:20 AM
W Kassebaum
I should have mentioned this is 8.1.05


WebFOCUS 8
Windows, All Outputs
April 04, 2017, 11:24 AM
BabakNYC
Here's a potential starting point. I'd love to hear how you crack this one. I may need it some day.

http://localhost:8080/ibi_apps/rs?IBIRS_action=TEST


WebFOCUS 8206, Unix, Windows
April 04, 2017, 11:40 AM
FP Mod Chuck
William

What RDBMS is your repository stored in? There was a presentation called Reporting From the WebFOCUS Repository: Utilities You Can Use Now at summit last year by Barry Austin where he shared some code that does exactly what you are looking for.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
April 04, 2017, 12:51 PM
Hank W.
Doesn't the Repository export come out in plain text these days?

Make a full export => copy onto your workstation => 'search in files' with Notepad++

And you'll get a code backup made at the same time...


Cheers,
H.

WebFOCUS 8.1.05M
Oracle 11g - DB2
RedHat
April 04, 2017, 02:32 PM
W Kassebaum
thanks everyone

does anyone know where I can find this doc
"WebFOCUS Repository: Utilities You Can Use "

or any documentation on how to export the repository..

thanks in advance.

wm


WebFOCUS 8
Windows, All Outputs
April 05, 2017, 07:07 AM
Hank W.
Export documentation comes under "Change Management", for when you do code promotion. The folders will be under WebFOCUS80\cm\export on the client box.


Cheers,
H.

WebFOCUS 8.1.05M
Oracle 11g - DB2
RedHat
April 05, 2017, 08:38 AM
Emily Max
Good morning,
Our WebFocus repository is on SQL Server, and I use the following query to search fex code:
 SELECT HANDLE, OBJNAME, PRT_PATH 
FROM WF_REPOSOBJ
WHERE HANDLE IN (SELECT OBJ_HANDLE FROM WF_CONTENT_REVS WHERE CAST(CAST(BCONTENT AS varbinary(MAX))AS varchar(MAX)) LIKE '%CAR%');
 


Have a great day,
Emily


WF 8.1.05 on Windows machines
Backend: Informix, SQL and Oracle databases
April 06, 2017, 01:57 PM
W Kassebaum
quote:
Utilities You Can Use Now


this was a great set of tools to introspect the repository. It was created by Barry Austin at IBI.


WebFOCUS 8
Windows, All Outputs
April 06, 2017, 03:48 PM
Francis Mariani
Where may I find "Reporting From the WebFOCUS Repository: Utilities You Can Use Now"?


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
April 06, 2017, 05:00 PM
CoolGuy
Hey all,

Here's the SQL scripts that work this magic if you're using SQL Server (as far as I've used such, it works in 8.1.05+):

-- Find file names in the repo:

SELECT
T2.PRT_PATH + '/' + T2.OBJNAME AS WFCPATH,
T2.OBJNAME,
T2.PRT_PATH,
T1.OBJ_HANDLE
FROM dbo.WF_CONTENT_REVS T1 
    INNER JOIN dbo.WF_REPOSOBJ T2 ON T1.OBJ_HANDLE = T2.HANDLE
WHERE LOWER(T2.OBJNAME) IN(
	'fexName1.fex',
	'fexName1.fex',
	'fexName3.fex')

-- Find any content and where it's referenced in the repository (not the file names, actual content (in the code)):

SELECT
T2.PRT_PATH + '/' + T2.OBJNAME AS WFCPATH,
T2.OBJNAME,
T2.PRT_PATH,
T1.OBJ_HANDLE,
CAST(CAST(BCONTENT AS VARBINARY(MAX)) AS VARCHAR(MAX)) AS CODE
FROM dbo.WF_CONTENT_REVS T1
    INNER JOIN dbo.WF_REPOSOBJ T2 ON T1.OBJ_HANDLE = T2.HANDLE
WHERE CAST(CAST(BCONTENT AS VARBINARY(MAX)) AS VARCHAR(MAX)) LIKE '%anything you want to find%'


Happy early Christmas!

P.S. Francis...you can't.

This message has been edited. Last edited by: CoolGuy,


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
April 06, 2017, 05:13 PM
Francis Mariani
Ah, yes. I recognize this code. I spent some time improving on this, one thing I have not been able to figure out is how to determine if a resource is published.


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
April 06, 2017, 05:18 PM
CoolGuy
Don't quote me on this, but I think there's an "ACTIVE" field somewhere. Maybe I'm crossing my streams Ghostbusters-style... Something that would be good to add for sure.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
April 06, 2017, 11:41 PM
Francis Mariani
No field. If a value does NOT exist in some table then it's published. But this is complicated by the status of one or all the parent folders... Could not deconstruct this.


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
April 06, 2017, 11:44 PM
Francis Mariani
And, the original code uncovered a secret in WF v8.0.08 - a blob is added to the table every time you save a resource, and I save often, so, for some resources I might have 50 versions saved in the table. This tremendously slows down opening folders where lots of saving has occurred.


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