Re: [MarkLogic Dev General] Customizing Facets in App Builder (ML6.0)

2013-02-15 Thread James Fuller
Hello David,

custom/app-config.js was added in the maintenance release of MarkLogic
after ML6.0.

Please upgrade and use latest release of 6.0-2.3 and once you deploy a
new app from appbuilder you will see this new custom/app-config.js
file.

hth, Jim Fuller


On Thu, Feb 14, 2013 at 8:04 PM, Steiner, David J. (LNG-DAY)
david.j.stei...@elsevier.com wrote:
 Ganesh and Mike,



 Thanks.  I understand what you’ve said here...



 However, I do not see a “custom/app-config.js” file.

 /application/custom/

 /application/custom/app.css

 /application/custom/app.js

 /application/custom/app.xsl

 /application/custom/contact.html

 /application/custom/content.xsl

 /application/custom/help.html

 /application/custom/rewrite.xml

 /application/custom/terms.html



 Are you saying that I need to create one?

 app-config.js is not mentioned in the Application Builder Developer’s Guide.
 Is it just a “known thing” that if you create a file with “-config” on it,
 it get’s loaded?  Or does it just load all “.js” in alphabetical order?



 The only files I see with “app” in the name in the custom directory are
 app.css, app.xml and app.js.



 If I am supposed to create a file called app-config.js, do I just upload it
 via WebDAV to the app’s modules DB, or am I supposed to do a document-load?



 Thanks,
 David







 From: general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Ganesh
 Vaideeswaran
 Sent: Thursday, February 14, 2013 10:39 AM
 To: MarkLogic Developer Discussion
 Cc: Mike Wooldridge
 Subject: Re: [MarkLogic Dev General] Customizing Facets in App Builder
 (ML6.0)



 David,



 Mike Wooldridge from my team was kind enough to put together some sample
 code that might guide you in the right direction.



 One way is to copy and edit ML.createSidebar() function to do what you want
 and then putting that rewrite in custom/app-config.js.



 (Note: You cannot put this rewrite in custom/app.js and expect it to work
 because of the sequence in which the JS is loaded.)



 As an example, he has made some updates to ML.createSidebar() that maybe
 along the lines of what you looking for. It assumes the example Oscar setup
 and creates a relationship between the 'award' and 'win' facets. The 'win'
 facet only appears in the sidebar if an 'award' facet has been selected (so,
 it appears when the 'award' chiclet is appearing). I'm attaching the code
 (which would be saved inside custom/app-config.js). The update involves
 maintaining an 'invisible' array that tracks what facets should not be
 shown. (This is different from our 'hidden' array, which tracks when a facet
 list is collapsed and still shows its title.). Hope this helps.



 You have to rename the .txt file attached as .js



 Thanks Mike.



 Ganesh Vaideeswaran

 Director of Engineering, Application Services

 MarkLogic Corporation

 ganesh.vaideeswa...@markogic.com

 Phone: +1 650 655 2398

 www.marklogic.com

 This e-mail and any accompanying attachments are confidential. The
 information is intended solely for the use of the individual to whom it is
 addressed. Any review, disclosure, copying, distribution, or use of this
 e-mail communication by others is strictly prohibited. If you are not the
 intended recipient, please notify us immediately by returning this message
 to the sender and delete all copies. Thank you for your cooperation.



 From: general-boun...@developer.marklogic.com
 [mailto:general-boun...@developer.marklogic.com] On Behalf Of Steiner, David
 J. (LNG-DAY)
 Sent: Tuesday, February 12, 2013 7:04 AM
 To: MarkLogic Developer Discussion
 Subject: [MarkLogic Dev General] Customizing Facets in App Builder (ML6.0)



 I have a few high level constraints/facets that are based on collections
 (i.e., I simply gave no prefix in the specification and I get a facet for
 “collection” with the counts of all the docs in each collection).



 Now, I also have a bunch of other facets that I want to show up but only
 when someone picks a particular content type (different content types have
 different facets), i.e., someone clicks on one of the high level content
 types.



 I’m assuming that the only way I can modify the sidebar behavior for facets
 is to modify javascript – create custom javascript.  Is this correct?  Or is
 there I way I can accomplish this in an easier fashion?

 If I have to change the javascript, is there an example of how to do this
 somewhere?



 Also, I guess at a minimum, I’d like to have the ability to easily specify
 whether I wanted the facet to appear opened/expanded or closed.  So, for
 example, I’d like my collection facets to appear opened, but other range
 index facets to appear closed since there will be a lot of them and they
 will each have a lot of values.



 Thanks,

 David


 ___
 General mailing list
 General@developer.marklogic.com
 http://developer.marklogic.com/mailman/listinfo/general

[MarkLogic Dev General] Customizing Facets in App Builder (ML6.0)

2013-02-12 Thread Steiner, David J. (LNG-DAY)
I have a few high level constraints/facets that are based on collections (i.e., 
I simply gave no prefix in the specification and I get a facet for collection 
with the counts of all the docs in each collection).

Now, I also have a bunch of other facets that I want to show up but only when 
someone picks a particular content type (different content types have different 
facets), i.e., someone clicks on one of the high level content types.

I'm assuming that the only way I can modify the sidebar behavior for facets is 
to modify javascript - create custom javascript.  Is this correct?  Or is there 
I way I can accomplish this in an easier fashion?
If I have to change the javascript, is there an example of how to do this 
somewhere?

Also, I guess at a minimum, I'd like to have the ability to easily specify 
whether I wanted the facet to appear opened/expanded or closed.  So, for 
example, I'd like my collection facets to appear opened, but other range index 
facets to appear closed since there will be a lot of them and they will each 
have a lot of values.

Thanks,
David
___
General mailing list
General@developer.marklogic.com
http://developer.marklogic.com/mailman/listinfo/general