How to create custom menu in oracle UCM 10gR3 using nav builder - oracle-ucm

I want to create a component which will add custom menu in oracle UCM 10gR3. As of now such component is possible using oracle UCM 11g,so I tried to implement the same in oracle UCM 10gR3.
This is resource.htm file of component 'custommenu' that I have created
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>
custommenu htmlIncludeOrString
</title>
</head>
<body>
<#dynamichtml custommenuSampleTable#>
<?commatable indexedColumn="sampleKey"
countColumn="sampleCount"sortCloumn="sampleOrder"
sampleKey,sampleValue,sampleOrder,sampleCount
key2, value2, 20
key1, value1, 10
<#end#>
<#dynamichtml coreMenuItems#>
id,label,linkType,linkData
custommenu1,my first menu,.
custom menu2,my second menu,.
custommenu,Sub Menu,.
THING_1,Get Server Output,cgi,IdcService=GET_SERVER_OUTPUT
THING_2,My Document,cgi,Idc=GET_SEARCH_RESULT&QueryText=%
28dDocAuthor+<contains>+%60<$UserName$>
THING_3,Component Manager,admin,IdcService=GET_COMPONENT_DATA
<#end#>
<#dynamichtml CoreMenuItemRelationship#>
<?commatable mergeKey="primaryKey"?>
parentid,id,loadorder
MENU_A,custommenu1,500
MENU_B,custommenu2,500
custommenu1,THING_1,10
custommenu1,THING_2,20
custommenu1,THING_3,30
<#end#>
</body></html>
but when we enable this component no change is found in UCM.
All kind of views are invited.
Thanks

That code only works in 11g. See this blog post for more info.
You need to use a method available in 10g. Here are some examples:
https://hishamgalal.blogspot.com/2009/02/deleting-and-adding-menu-items.html
https://bungbutan.wordpress.com/2012/11/26/oracle-webcenter-content-grouping-menu-items-into-one-new-menu/
https://oramack.blogspot.com/2010/04/ucm-modify-check-in-menu.html
http://blogs.redstonecontentsolutions.com/technical-blog/alphabetizemenus-11g (shows difference between 10g and 11g)

Related

Using Schema.org Review with copyrightHolder?

I'm trying to implement correct properties of Schema.org, in video game reviews. It's not hard to understand the basics http://schema.org/Review, but some properties are a bit confuse (to me).
For example, a review about "Gran Turismo", of "Sony PlayStation", released in "1996", is correct to use properties of "Creative Work", this way:
<meta itemprop="copyrightHolder" content="Sony" />
<meta itemprop="copyrightYear" content="1996" />
Or do this is it related to the review itself, so I should use the review's author name and publication date? If yes, what's the right properties to those info (if needed)?
When reviewing a video game, there are two CreativeWorks (resp. more specific types) involved:
the video game
the review
The properties copyrightYear and copyrightHolder refer to the nearest parent CreativeWork. You have to make sure not to mix them: it’s all about the correct nesting.
<div itemscope itemtype="http://schema.org/CreativeWork">
<!-- this is *your* CreativeWork, i.e., the review -->
<div itemprop="itemReviewed" itemscope itemtype="http://schema.org/CreativeWork">
<!-- this is *not your* CreativeWork, i.e., the video game -->
</div>
<!-- this is, again, *your* CreativeWork -->
</div>
(Note that I’ve used the general CreativeWork type in this example; you should of course use more specific types if available, e.g., http://schema.org/Review for the review).
Daniel, you should use the review schema as your primary schema, then nest the others such as creative work within it. The review schema should include the item, the author's name, date of the review, and of course the actual review body and rating markups. But it really is not necessary to use the copyright item properties. You can simply leave those tags out if you wish.

What is the correct high level schema.org microdata itemtype for a retail brand/company homepage?

I'd like to hear which schema.org itemtype others would recommend using or have used in the case of completing a retail brand's company homepage microdata. Take for example TOMS's shoes:
Example #1 - Using /Corporation as the high-level itemtype one can include a lot of great /Organization microdata, but nothing about the retail store.
<html itemscope='itemscope' itemtype="http://schema.org/Website>
<head></head>
<body itemscope='itemscope' itemtype="http://schema.org/Corporation>
various microdata here probably including Product microdata
</body>
</html>
NOTE: the only schema.org property specific to /Corporation is tickerSymbol & TOMS doesn't have one.
Example #2 - This code would work if TOMS started their own channel of physical retail stores & each location had it's own homepage. However, for TOMS's.com, although accurate schematically & more descriptive at the face, this is incorrect microdata markup for TOMS.com, because /ShoeStore derives from /LocalBusiness - which must represent a physical place.
<html itemscope='itemscope' itemtype='http://schema.org/Website'>
<head></head>
<body itemscope='itemscope' itemtype='http://schema.org/ShoeStore'>
a whole bunch of jabber here
</body>
</html>
NOTE: Since TOMS is virtual & thus can't be a /Store this means you lose really cool properties like 'currenciesAccepted', 'paymentAccepted' & 'priceRange'.
Is this just a 'sit and wait' situation until more schemas are approved for 'virtual places' or is there a validation-passing way to get the best of both worlds?
Assuming you're looking at this more or less from an SEO point of view, remember that the major search engines are currently making only very limited use of microdata, and the schemas you're talking about (Corporation and Shoe Store) are not, to my knowledge, used for anything (yet). So, to an extent, I think the whole thing is largely hypothetical for now.
However, I think it's important to remember that you could use very different microdata depending on the page function. You're asking about the homepage, for which it could be completely valid to add only enough microdata to describe the name and category of the entity concerned. Detailed product data would appear on product pages, more detailed organisational data on the about or contact page, etc. In other words, use the schema that best allows you to encapsulate the main purpose of the page.
Incidentally, they've recently added GoodRelations vocabulary to Schema.org, so the scope for describing products and other business-related data just grew considerably.

how to get the attribute value by another attribute's value in xpath

<?xml version="1.0" encoding="UTF-8"?>
<serviceOfferings xmlns="http://www.abc.com/aaa" xmlns:ns2="http://www.w3.org/2005/Atom">
<serviceOffering type="provider">
<links>
<link title="Service Provider" type="application/xml" rel="self" href="https://www.yahoo.com"/>
<link rel="create" href="https://www.google.com/create"/>
</links>
</serviceOffering>
</serviceOfferings>
How do I get the href value for the link which attribute rel is create
The target element is in a default namespace. First, you'll need to register that namespace with your XPath engine. How you do this depends on the tool you're using, which means it's outside the scope of this question (since you haven't told us how you're evaluting your expressions).
Let's assume you've registered the namespace to a prefix called aaa. Select the desired link like this:
//aaa:link[#rel='create']
Or, more specifically:
/*/*/*/aaa:link[#rel='create']
For completeness, in most cases this can also be achieved without registering a namespace, at the cost of reduced readability:
/*/*/*/*[name()='link' and #rel='create']
This selects all elements whose name is "link" (regardless of the namespace they belong to) and that have a rel attribute whose string value is "create", and that are grand-grand-children of the top element of the XML document.

Does Web Matrix (Or ASP.NET Web Pages) have a built in ORM?

What I know about web development I can count on one hand. In an effort to change that I have begun to look at asp.net web pages as this technology seems to have a low technical barrier to entry and sits nicely, in my view, above plain 'ol HTML.
I have been working through some samples and something has caught my eye. To create a connection and query a database you simply have to do this:
#{
var database = Database.Open("deanvmc");
var sqlQuery = "SELECT * FROM Articles";
var data = database.Query(sqlQuery);
}
From that I seem to be able to access the row data from the returned table in the following fashion:
#foreach(var row in data)
{
<article>
<h3>#row.Heading</h3>
<nav>
<ul>
<li>#row.DatePosted</li>
<li>#row.Category</li>
<li>0 Comments</li>
</ul>
</nav>
<p>#row.SubHeading</p>
</article>
}
Is this an ORM at work? Is it correct to assume that the object contained in row will always be mapped to the columns returned from the sqlQuery?
Also, is this a function of webmatrix as a stack or asp.net web pages as a library? I am a little confused about where one ends and the other begins.
The code above does not use an ORM - it is simply mapping fields returned from the database view to the row object returned by your query. So your assumption is correct - all of the object properties are mapped to the columns returned from the query.
WebMatrix itself is just a web development tool - it provides the editor, templates, and other dev tool type things. The libraries you're using (ASP.NET Web Pages with Razor & C#) are the stack on top of which your application is built. WebMatrix happens to also support non .NET technologies such as PHP, and may support more in the future.
I know this was kind of open ended, but hopefully I was some help. Happy Coding!

Hpricot search how to

I would like to do a search in a webpage if I have result than I need a property.
Here is the webpage: link text
I am interested if, the header the meta has the property with value "og:title" ot nor, if has I want the content value
If we look at the source of the page, it has a potion of:
<meta
property="og:title" content="Explore the Titanic Wreck Site via Social Media [EXCLUSIVE]" />
so I want a true result for og:title query and a Explore the Titanic Wreck Site via Social Media [EXCLUSIVE] value for next search, how to do it properly
search("/html/head/meta[(#property='og:title']") doesn't return what I want.
any suggestion?
Use:
/html/head/meta[#property='og:title']/#content
Your XPath has an error in it, plus is too restrictive:
search("/html/head/meta[(#property='og:title']")
should be:
search("/html/head/meta[#property='og:title']")
to fix the error. I'd simplify it to:
search("//meta[#property='og:title']")
Also, it's not quite clear what you want to do. Do you want to find
<meta
property="og:title"
content="Explore the Titanic Wreck Site via Social Media [EXCLUSIVE]"
/>
and extract the content parameter? Or do you want to locate the tag, confirm it contains both the "og:title" property tag and the "Explore the Titanic Wreck Site via Social Media [EXCLUSIVE]" content, and then do further processing?
That said, often it's simpler to use CSS accessors instead of XPath. I prefer using Nokogiri, which has both XPath and CSS selectors; I'm using CSS below:
require 'nokogiri'
require 'open-uri'
doc = Nokogiri::HTML(open('http://mashable.com/2010/08/06/expedition-titanic'))
(doc % 'meta[property="og:title"]')
=> #<Nokogiri::XML::Element:0x8084ee48 name="meta" attributes=[#<Nokogiri::XML::Attr:0x8084ed58 name="property" value="og:title">, #<Nokogiri::XML::Attr:0x8084ed1c name="content" value="Explore the Titanic Wreck Site via Social Media [EXCLUSIVE]">]>
Nokogiri and Hpricot support the / and % shorthand for search and at respectively. "Search" returns an array of all matches, and "at" returns only the first match. So, the example above gets the first node using the CSS, showing this is the right track. I'm not sure how to use CSS to match two parameters in the same tag, so I'll go after all <meta> tags with property="og:title", then filter based on the content= parameter:
(doc / 'meta[property="og:title"]').select{ |n| n['content'][/titanic wreck site/i] }
=> [#<Nokogiri::XML::Element:0x8084ee48 name="meta" attributes=[#<Nokogiri::XML::Attr:0x8084ed58 name="property" value="og:title">, #<Nokogiri::XML::Attr:0x8084ed1c name="content" value="Explore the Titanic Wreck Site via Social Media [EXCLUSIVE]">]>]
At that point we've got the right node in the returned array, so you can extract whatever you want, or dive into its children and sack and pillage. To do that you'll want to use .first or [0] to get at the actual node for further processing:
(doc / 'meta[property="og:title"]').select{ |n| n['content'][/titanic wreck site/i] }.first
Update based on OP's response, using Nokogiri still:
>> meta = (doc % 'meta[#property="og:title"]')['content']
>> meta #=> "Explore the Titanic Wreck Site via Social Media [EXCLUSIVE]"
Thanks for answers.
When I posted my question I couldn't realize I have a mistake in the search. It was Friday evening...
The correct search is
elements = #doc.search("/html/head/meta[#property='og:title']")
it is removed a ( character from expression before #property
This give the:
elements = <meta property="og:title" content="Explore the Titanic Wreck Site via Social Media [EXCLUSIVE]" />
result.
Than I am checking if I have something or not, if I have, than I need the content value
if elements.nil?
puts 'not found'
elsif elements.size > 0
puts "Found one, og:title = #{elements}"
content = elements.attr("content");
puts content # this will display the content ( it will be processed)
else
... can come here the flow control? - theoretically yes, but in practice?
end

Resources