Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 7:49 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: As Developer, documenting Pub/page Organizer objects
PostPosted: March 20th, 2009, 12:50 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Has anyone done this? Want to share?

I want to create file that will hold a listing of a Publication's Chapters, Pages, and Host-Objects. I think I have a good start, but wonder if I'm reinventing the wheel.

Here's what I have so far.
It lists the Chapter Names in a Pub. Next logical step is of course Page Names, then the structure of a page. At that point, can write out to a File.

Code:
//to use this func., set up a Page var (Array type) named:  PubCHAPAy
//call func. from a button action or other.
function DocuAllPubObjects()
{
PubCHAPAy.length = 0 ;  //zero the Page var array... just in case
var toppage = GetPage(0)
var thisPub = toppage.GetParent().GetParent() ;
var thisPubName = thisPub.GetName() ;
var numChaps = thisPub.GetNumberChildren() ;
var numPagesinChap = 0 ;
Debug.trace( numChaps +"  "+ thisPubName )
wait(3)
   for (i=0; i< numChaps; i++)
   {
   PubCHAPAy[i] = thisPub.GetChild(i).GetName() ;
   onePubCHAP = PubCHAPAy[i] ;  //i want to display it on apage in Preview
   wait(1.3)
   }
}


I am going through a significant overhaul of a pub and want to capture this 'map' before I proceed to wreck it.

My vision is that this is something to put in a Pub in a separate Chapter, get the needed info, and delete it in the version that's published.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Working function now
PostPosted: May 3rd, 2009, 12:22 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Generate a listing of Publication structure, similar to OpusPro Organizer tree.

I would really welcome some help that could convert the current output (that goes to Script Console via Debug.trace) to write to File. Specifically I want to get the output into Excel where I think there is a way in the worksheet to Expand or Collapse individual rows... drill down.

Cheers,
Larry

sample output: attached image
script code: attached file (should be an .ils file, just remove the .txt extension)


You do not have the required permissions to view the files attached to this post.


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: May 6th, 2009, 8:26 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
I've added some Header information to the output listing -- to show Pub Name and date & time stamp. Right now I am simply copy and pasting the listing from debug pane into MS Wordpad, which keeps the appearance of tree structure.

As an extra 'plus', I found this structure listing very handy when it comes to Clones. It is easy to get a 'snapshot' at some point in time showing what Clones currently exist on a Page. I simply did that by clicking on a button to call the function ShowStructure2(), but you could easily insert that call in the middle of your Clone routine.


Note: reminder... this is simply a diagnostic or documenting tool. It does not change anything on the Page itself. Simply add it as a Script Object and call one of the two functions -- currently only outputs to Debug pane.

attach: very minor changed script file. (adds header info)


You do not have the required permissions to view the files attached to this post.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Last edited by Lar_123 on May 6th, 2009, 11:43 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: May 6th, 2009, 12:01 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
For more complex Pages, try this version of the script to Generate Structure Listing. Copy & Paste the output from debug pane direclty into Excel (just select one cell there and do simple Paste). Spacing already set by tabs. Also displays object type.

(I'll probably stop here, as I've got something workable. Some day I may want to write directly to Excel file.)

Enjoy.


You do not have the required permissions to view the files attached to this post.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: May 6th, 2009, 11:53 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Correction. Or rather point of observation on my above comment about displaying Clone names or information.

Clones are named by Opus in an ascending order (increasing numbers in the name). Clone names as the appear in the sequence as they are created.
Quote:
clone index 1 Vector_11.2147483648
clone index 2 Vector_11.2147483649
clone index 3 Vector_11.2147483650
clone index 4 Vector_11.2147483651
clone index 5 Vector_11.2147483652
clone index 6 Vector_11.2147483653


The ShowStructure output sorts the list of Objects in a way that best matches Opus's Organizer Tree. The numbers to the left in the list are Child index numbers and they are descending. But if you were to read that list from the bottom up, it might appear that Clones were named in descending order. (?)
Quote:
21 Vector_11.2147483660 Vector
20 Vector_11.2147483661 Vector
19 Vector_11.2147483662 Vector



What I am saying is that this could be a bit confusing. So check your info for yourself before you rely on the correlation here. It is simple to get the Clone name more directly and create your own counter to verify this.

I have a theory that when it comes to Child order, maybe Clones are created in something akin to a 'push stack' where the newest created Clone becomes the 'higher ranking' child (and all the other children clones are pushed down).

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 45 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group