Disable toc items based on build parameter in DocFx - docfx

I am looking for a solution where I can change the generated output of a docfx build based on some parameters during build time. I have seen that there is a filter property in docfx.json where I can filter out some api stuff. But I would like to change the structure/content of my site which is generated from the toc.yml files.
The reason I would like to have this feature is that I generate the documentation specific for every customer we have. Based on the features a customer has registered on our product some pages of the static documentation have to appear and some pages should not be available for this customer.

This may be something to start with:
File structure
articles
--topic1.md
--topic2.md
--topic3.md
--topic4.md
customer1
--index.md
--toc.yml
customer2
--index.md
--toc.yml
customer1/toc.yml
- name: Customer 1 home
homepage: index.md
- name: Topic 1
href: ../articles/topic1.md
- name: Topic 2
href: ../articles/topic2.md
customer2/toc.yml
- name: Customer 2 home
homepage: index.md
- name: Topic 1
href: ../articles/topic1.md
- name: Topic 2
href: ../articles/topic2.md
- name: Topic 3
href: ../articles/topic1.md
- name: Topic 4
href: ../articles/topic2.md
docfx.json
{
"build": {
"content": [
{
"files": [
"articles/*.md",
"customer1/**",
"customer2/**"
]
}
],
"dest": "_site"
}
}
Output site structure
articles
--topic1.html
--topic2.html
--topic3.html
--topic4.html
customer1
--index.html
--toc.html
customer2
--index.html
--toc.html
Result
site/customer1 is a customized landing page and table of contents for Customer 1
site/customer2 is a customized landing page and table of contents for Customer 2

Related

Binding QML widgets to a list model, but having some widget only bind to a specific index?

I'm writing a QML GUI that talks to a monitoring server. In one case, there's 3 grouped remote systems, one is is a master, the other two are slaves. I have the full statuses of each one, but need to show more details for the master system.
So for example I'm receiving an update message containing:
{
systems: {
1: {
type: Debian,
name: system1,
status: OK,
detailedStatus1: 123,
detailedStatus2: xyz
},
2: {
type: Ubuntu,
name: system2,
status: OK,
detailedStatus1: 456,
detailedStatus2: abc
},
3: {
type: Windows,
name: system3,
status: OK,
detailedStatus1: 789,
detailedStatus2: def
}
},
currentMaster: (1 or 2 or 3)
}
...and I want to show type, name, and status for all 3 systems, but only show detailedStatus1 and detailedStatus2 for the currentMaster system.
What should my QML model be like? Should I have a "masterModel ListModel" that my detailedStatus widgets bind to, and an "allsystems ListModel" for type/name/status, and update masterModel everytime currentMaster changes? Or is there a way to do this from a single "allsystems ListModel" , using currentMaster to know what to bind to? Should I be doing something else altogether?

How to create a search Action in Alfresco

I am using Alfresco Enterprise 6.2. Similar to the live search, I am creating a search Action for folders that I have in document library.
I have updated the custom-actions.js as follows:
onActionSearch: function dla_onActionSearch(record){
window.open(Alfresco.constants.PAGECONTEXT +'dp/ws/faceted-search?', "_self");
}
I have also added folder scope in faceted-search.get.js as below. I have hardcoded the value folder1 just to test if it works:
scopeOptions.push({
id: "FCTSRCH_SET_FOLDER_SCOPE",
name: "alfresco/menus/AlfCheckableMenuItem",
config: {
label: "folder",
value: "folder1",
group: "SEARCHLIST_SCOPE",
publishTopic: "ALF_SEARCHLIST_SCOPE_SELECTION",
checked: false,
hashName: "scope",
publishPayload: {
label: "folder",
value: "folder1"
}
}
});
However it dos not consider the folder scope when performing the search. Instead, it consider 'folder1' as a site. How can I correctly perform a search within folder scope?
Please check below widget,It is considering scope as a siteId always.
https://dev.alfresco.com/resource/docs/aikau-jsdoc/AlfSearchList.js_.html

Can't get jQuery Datatables in Meteor to work

Unfortunately I'm completely lost when trying to implement jQuery DataTables in Meteor. The documentation for the Meteor version is non-existent and the examples it gives don't make sense to me and don't follow the Discover Meteor book's application structure (ie. What the heck is Template.myTemplateName.browsers ? .browsers? I know .rendered, .created, .helpers, etc. Where the heck did .browsers come from?
I did meteor create, mrt add iron-router, mrt add jquery-datatables
Nothing gets displayed on the page with the following files. (the route's working but I get a Spacebars error).
I have a pre-defined Services collection with title, description, and sku
Client:
index.html
<template name="index">
<h1>Hello</h1>
{{> DataTable services }}
</template>
index.coffee
Template.index.services = -> return {
# ## Id
# * While not required, setting a unique table id makes external manipulation possible through jquery
id: "my-unique-table-id"
# ## Columns
# * Map your dataset to columns you want displayed
columns: [{
title: "Title"
data: "title"
},{
title: "Description"
data: "description"
},{
title: "SKU"
data: "sku"
}]
# ## Subscription
# * the datatables publication providing the data on the server
subscription: "services"
# ## Query
# * the initial client filter on the dataset
query:
grade: "A"
}
Server
datatables.coffee
if Meteor.isServer
ServicesTable = new DataTableComponent
subscription: "services"
collection: Services
ServicesTable.publish()

How to get unsecured page's url in a project?

I want to write a program in my symfony1.4 project which can return/give the unsecured page's url, how can I write this?
I secured the actions with credentials and i used sfDoctrineGuard for security.
If user is not authorized for any pages then that pages show me 401 code from sfwebresponse.
I gave the credentials for every actions.My first question is
Now how can i test that the actions are secured.
I want to generate a report which contains the every pages url's and respective urls are secured or not?
my routing.yml is like follows:
annual_performance_appraisal_details:
class: sfDoctrineRouteCollection
options:
model: AnnualPerformanceAppraisalDetails
module: AnnualPerformanceAppraisalDetails
prefix_path: /AnnualPerformanceAppraisalDetails
column: id
with_wildcard_routes: true
annual_performance_appraisal:
class: sfDoctrineRouteCollection
options:
model: AnnualPerformanceAppraisal
module: AnnualPerformanceAppraisal
prefix_path: /AnnualPerformanceAppraisal
column: id
with_wildcard_routes: true
apa_question_answer:
class: sfDoctrineRouteCollection
options:
model: ApaQuestionAnswer
module: ApaQuestionAnswer
prefix_path: /ApaQuestionAnswer
column: id
with_wildcard_routes: true
In my Second(2) question i want a report like follows:
Url: ...../AnnualPerformanceAppraisalDetails
SecurityReport: 401(Athorization requried)
Url: ...../AnnualPerformanceAppraisal
SecurityReport: 401(Athorization requried) or 403 Forbidden
About 1 You can check the status code of the pages. You will need an explicit list of urls to test.
You can probably write something like this :
$secured_urls=array('default/index','myModule/index',...);
foreach ($secured_urls as $url) {
$browser->get($url)
->with('response')
->begin()
->isStatusCode(401)
->end();
}
About 2 are you trying to build that report from the tests results?

Is there a smart way to override form action links in sfDoctrineGuard plugin?

I've set up my Symfony 1.4 project to route /admin in the URL to my backend app. This works fine until I want to edit a user or interact with the generated forms in any way. This is because the generated links are not aware of my /admin prefix.
Is there a smart way to prefix these links without copying the generated templates to my app folder structure?
UPDATE
Contents of generator.yml for the sfGuardUser module:
generator:
class: sfDoctrineGenerator
param:
model_class: sfGuardUser
theme: admin
non_verbose_templates: true
with_show: false
singular: ~
plural: ~
route_prefix: sf_guard_user
with_doctrine_route: true
config:
fields:
password_again: { label: "Password (again)" }
list:
title: User list
display: [=username, created_at, updated_at, last_login]
form:
class: sfGuardUserAdminForm
display:
"User": [first_name, last_name, email_address, username, password, password_again]
"Permissions and groups": [is_active, is_super_admin, groups_list, permissions_list]
edit:
title: Editing User "%%username%%"
new:
title: New User
I have added my own sf_guard_user in my routing.yml which works for new links I create but the generator doesn't pick this up.
Take a look at a sample configuration file for the admin generator (generator.yml): http://www.symfony-project.org/jobeet/1_4/Doctrine/en/12#chapter_12_final_configuration
Most specifically, look at the route_prefix: parameter.
Try setting the route_prefix to
route_prefix: admin

Resources