cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HTML descriptor external edit

ki6i
Trusted Contributor

Hi there,

 

Can you somehow edit content HTML text in descriptor or add HTML text to a descriptor from marco?

 

We are generating descriptors based on library structure, so we don't need to edit them manually but when it comes to edit of the content inside of the descriptor I can't find how to do it.

6 Replies

ki6i
Trusted Contributor

1. is a department an org-unit ?

 

no but that doesn't really matter

 

2. Every department only wants to see it's own processes and applications for example when they launch their website?

 

Well no ultimately the goal is the objects to be reused. That is one of the reasons we didn't go for multiple websites based on template - since everybody want to have object pages on all objects the time for generetaion of the entire web content will increase exponentially every time when new site is created

 

______________

 

 

Well that is pretty much what I did also but it is not really elegant solution. I just feel bad that I am using queries to manage content which is not really the purpose of queries.
Furthermore you can do quite mote elaborate stuff for the static index pages like the home page or the single pages listing all indexes for department if you were able to change the content.I really hoped that it is possible, because that is pretty much the only way to automate the website generation if you need to do it from scratch.

 

P.S Thanks.

SVanSchoonlandt
Honored Contributor

some more questions:

 

1. is a department an org-unit ?

2. Every department only wants to see it's own processes and applications for example when they launch their website?

3. It should be easy to go to the info from other departments, how will you present this info? you will need to make an html page from which you point to the different homepages of each department.

4. What kind of text do you try to change in the descriptor? the name of the department?

 

In my opinion, the goal should be to stick with one website template, that is what makes maintenance the easiest. What you describe is something that we have done at different clients but usually what we do is the following:

 

1. Create a generic website template which can serve as a blueprint for every department.

2. Write a VB Script macro which will

a. fetch the departments one by one from an ini/config file

b. use the department in a query to create a resultset in MEGA, eg if the department is represented in MEGA by an org-unit it would be something like Select [Org-Unit] into @OrgUnit where [Absolute Identifier] = '<value coming from config file>' keep @OrgUnit

c. in the generic website template, whenever you need to retrieve info from the specific department you make use of the resultset @OrgUnit eg Select Application where [Org-Unit] in @OrgUnit

 

If you need to add specific hardcoded department info in the html or retrieve specifc data for one department, you can use the If operator in the descriptor.

 

If you follow the above steps you have a generated website for each department. Now it's up to your end-users to decide on how you will crosslink the websites. There are also different possibilities for that.

 

At another use case, we just created one website template for all departments. We have a menu on the left on which all the departments are listed. By clicking your department you get to see the homepage of your department.

 

Hope this helps a bit

 

stijn

ki6i
Trusted Contributor

The use case is not too fancy I must say.

 

Let's say that enterprise have 30 deparetments. The enterprise as whole wants to enforce standardized website template that should be used from every department. Generally department is interested mainly of their own domain but on the other hand the departments should be able still to access the information of the other departments if they need it.

 

The best way to do that in my opinion is with single website gathering groups of sets of index pages based on the department (and using queries only within that department) and I want to make those sets of index pages automatically generated with the needed department query for set. On that way the maintainance of the entire thing will be 1000 times easier.

SVanSchoonlandt
Honored Contributor

Hi,

 

I don't understand the use case you try to achieve with this. If you could explain why you want to duplicate descriptors and change their internal text I could give you some directions.

 

from the last post it seems that you try to instantiate the website generation for different libraries and don't want to enter the parameter which is asked by the query?

 

I would setup the template to retrieve the currentlibrary from a resultset constructed by a query with the keep operator.

 

Duplicating descriptors through VB Script and changing them sounds a bit too complex. As far as I know you can not reach the text part of the descriptor through VB Script. I have tried that in the past myself to bulk change content in descriptors but I could not find a way to do this through the API.

 

regards

ki6i
Trusted Contributor

Well I am using VB Script to generate descriptors based on template descriptor and changing the query in them from the template one to a concrete query.

 

In this VB Script I want to add code which is going to edit the content in the HTML descriptor.

 

For example:

 

Here is how I create (duplicate) the descriptor and change the query set:

 

newDescr.CreateDuplicate(NewDescriptorName, " (auto-generated)")

For Each query In newDescr.GetCollection("Query")
      query.getProp("_Select") = Replace(query.getProp("_Select"), "@mylibrary ", CurrentLibrary & " ")
Next

 

I want after that to change the text in the descriptor itself but I don't know how I can access the text modules of the HTML descriptor with VB Script

 

SVanSchoonlandt
Honored Contributor

Hi Ki6i,

 

I don't completely follow you. Are you referring to the website template descriptors? If so, these can be modified with the right MEGA product license (MEGA Publisher Web in 2009).

 

Regards

 

stijn