Tempo 2.0

Tempo 2.0

Tempo is an easy, intuitive JavaScript rendering engine that enables you to craft data templates in pure HTML.

Why use Tempo?
  • Clear separation of concerns: no HTML in your JavaScript files, and no JavaScript in your HTML
  • Makes working with AJAX/JSON content a piece of cake
  • Works in Safari, Chrome, FireFox, Opera, and Internet Explorer 6+
Key Features
  • Itty-bitty footprint, lightning-fast rendering!
  • No dependencies - Use with or without jQuery
  • Supports partial, nested and conditional templates
  • Support for pre-processing, filter and formatting functions and safe attribute setters
  • Variable injection for inline JavaScript expressions
  • Degrades gracefully if JavaScript is not enabled
  • Configurable syntax for greater compatibility

Quick start

1. Include the Tempo script
<script src="js/tempo.js" type="text/javascript"></script>
<script>Tempo.prepare("tweets").render(data);</script>
2. Compose the data template inline in HTML
<ol id="tweets">
    <li data-template>
        <img src="default.png" data-src="{{profile_image_url}}" />
        <h3>{{from_user}}</h3>
        <p>{{text}}<span>, {{created_at|date ‘HH:mm on EEEE‘}}</span></p>
    </li>
    <li data-template-fallback>Sorry, JavaScript required!</li>
</ol>
3. Booyah! You‘re done!

Usage

You only need to include one little script:

<script src="js/tempo.js" type="text/javascript"></script>
Data

Tempo takes information encoded as JSON and renders it according to an HTML template. Below is a sample array of JSON data. Tempo can also iterate members of an associative array (object).

var data = [
    {‘name‘:{‘first‘:‘Leonard‘,‘last‘:‘Marx‘},‘nickname‘:‘Chico‘,‘born‘:‘March 21, 1887‘,‘actor‘: true,‘solo_endeavours‘:[{‘title‘:‘Papa Romani‘}]},
    {‘name‘:{‘first‘:‘Adolph‘,‘last‘:‘Marx‘},‘nickname‘:‘Harpo‘,‘born‘:‘November 23, 1888‘,‘actor‘:true,‘solo_endeavours‘:[{‘title‘:‘Too Many Kisses‘,‘rating‘:‘favourite‘},{‘title‘:‘Stage Door Canteen‘}]},
    {‘name‘:{‘first‘:‘Julius Henry‘,‘last‘:‘Marx‘},‘nickname‘:‘Groucho‘,‘born‘: ‘October 2, 1890‘,‘actor‘:true,‘solo_endeavours‘:[{‘title‘:‘Copacabana‘},{‘title‘:‘Mr. Music‘,‘rating‘:‘favourite‘},{‘title‘:‘Double Dynamite‘}]},
    {‘name‘:{‘first‘:‘Milton‘,‘last‘:‘Marx‘},‘nickname‘:‘Gummo‘,‘born‘:‘October 23, 1892‘},
    {‘name‘:{‘first‘:‘Herbert‘,‘last‘:‘Marx‘},‘nickname‘:‘Zeppo‘,‘born‘:‘February 25, 1901‘,‘actor‘:true,‘solo_endeavours‘:[{‘title‘:‘A Kiss in the Dark‘}]}
];
JavaScript
Tempo.prepare()

First you need to point Tempo at the container that contains the template elements:

var template = Tempo.prepare(element);
element

The ID of the HTML element (or the element itself) containing your data template. If you‘re using jQuery, you may pass in a jQuery object instead.

To initialize Tempo, run the prepare() function to scan an HTML container for data templates, cache them in memory, and remove the data template HTML elements from the page. Tempo.prepare(element) returns an instance of a renderer that knows how to layout the data you provide to it.

If the container does not contain a default (that is without conditions and not nested) data-template the entire contents of the container will be considered to represent the template.

template.render()
template.render(data);

The Tempo.prepare() function returns an instance of a template ready for rendering. Once the JSON data is available, run the render(data) function to add the data to the page.

data

The JSON data to be rendered - either an array or an object in which case the members are iterated and provided as key/value pairs.

template.append()

Renderer methods all return an instance of the renderer (a la fluent) so you can chain calls to it. The append(data) function will render the data you pass in and append it to the container.

Tempo.prepare(‘marx-brothers‘).render( data ).append( more_brothers );
template.prepend()

The prepend(data) function will render the data you pass in and insert it before others in the container.

Tempo.prepare(‘marx-brothers‘).render( data ).prepend( brothers_we_didnt_know_about );
template.clear()

The clear() function will empty the container, allowing you to e.g. render the data again.

Tempo.prepare(‘marx-brothers‘).render( data ).clear();
template.errors(errorHandler)

Tempo will attempt to deal with errors and failures silently but you can pass in your own handler for exceptions:

errorHandler

A function which will be called with the error object from the try/catch block.

Tempo.prepare(‘list‘).errors(function (err) {
    console.log(‘Whoa! something happened!‘);
    console.log(err);
}).render(data);
template.into(container)

The into(element) function will allow you to render the original template to one or more different containers specified. The method will return a new template on which you can call the other template methods such as render() or append().

container

The container to render the template to.

Render to different container:
Tempo.prepare(‘marx-brothers‘).into(‘alternative-container‘).render( data );
Reuse template for multiple different containers:
var template = Tempo.prepare(‘marx-brothers‘);
template.into(‘alternative-container‘).render( data_1 );
template.into(‘yet-another-alternative-container‘).render( data_2 );
HTML
data-template

Any tag with the data-template attribute will be treated as a template. For compliance the full (non-minimized) form is also supported: data-template="data-template".

{{field}}

Any field represented in the JSON data may be retrieved by referencing the field name inside double brackets.

<ol id="marx-brothers">
    <li data-template>{{nickname}} {{name.last}}</li>
</ol>

The example above would produce the following output:

1. Chico Marx
2. Harpo Marx
3. Groucho Marx
4. Gummo Marx
5. Zeppo Marx

Here‘s an example of a simple array of strings:

var data = [ ‘Leonard Marx‘, ‘Adolph Marx‘, ‘Julius Henry Marx‘, ‘Milton Marx‘, ‘Herbert Marx‘ ];

You can reference the object being iterated with {{.}}:

<ol id="marx-brothers">
    <li data-template>{{.}}</li>
</ol>

If the JSON data represents an array of arrays (which can not be referenced by field/member name) for example:

var data = [ [‘Leonard‘,‘Marx‘], [‘Adolph‘,‘Marx‘], [‘Julius Henry‘,‘Marx‘], [‘Milton‘,‘Marx‘], [‘Herbert‘,‘Marx‘] ];

You can reference array elements with the following notation:

<ol id="marx-brothers">
    <li data-template>{{[0]}} {{[1]}}</li>
</ol>

Both examples would produce the following output:

1. Leonard Marx
2. Adolph Marx
3. Julius Henry Marx
4. Milton Marx
5. Herbert Marx
Using data from associative arrays (objects)

Normally data being iterated is represented as an array of objects. In some cases however the data is a series of objects in a map:

var data = {
    ‘leonard‘: ‘Leonard Marx‘,
    ‘adolph‘: ‘Adolph Marx‘,
    ‘julius‘: ‘Julius Henry Marx‘,
    ‘milton‘: ‘Milton Marx‘,
    ‘herbert‘: Herbert Marx‘
};

In this case you can iterate all the elements using the data-from-map attribute where the key name can be accessed with {{key}} and the value object via {{value}}:

<ol id="list">
    <li data-template data-from-map>{{value}} - {{key | append ‘@marx.com‘}}</li>
</ol>
Values are escaped by default

All values are escaped by default. To disable automatic escaping pass in the ‘escape‘: false parameter:

Tempo.prepare(‘marx-brothers‘, {‘escape‘: false}).render(data);

If you disable escaping you can control this at individual value level using the escape and encodeURI filters.

Nested data-templates

Data templates can even be nested within other data templates. Multiple nested templates are supported.

<li data-template>
    {{nickname}} {{name.last}}
    <ul>
        <li data-template-for="solo_endeavours">{{title}}</li>
    </ul>
</li>

The example above would produce the following output:

1. Chico Marx
    ? Papa Romani
2. Harpo Marx
    ? Too Many Kisses
    ? Stage Door Canteen
3. Groucho Marx
    ? Copacabana
    ? Mr. Music
    ? Double Dynamite
4. Gummo Marx
5. Zeppo Marx
    ? A Kiss in the Dark

You can (recursively) refer to parent objects within a nested template using the _parent variable.

<li data-template-for="solo_endeavours">{{_parent.name.first}} acted in {{title}}</li>
Nested Templates as Partial Template Files

Tempo supports separating more complex nested templates in to master and partial template files. Partials templates are loaded on demand from the server and do require you to use the alternative asynchronous pattern:

JavaScript:
Tempo.prepare(‘marx-brothers‘, {}, function(template) {
   template.render(data);
});
Template:
<li data-template>
    {{name.first}} {{name.last}}
    <ol>
        <li data-template-for="solo_endeavours" data-template-file="partials/movie.html"></li>
    </ol>
</li>
Partial (‘partials/movie.html‘):
{{title}}

This would produce the same output as the example above:

1. Chico Marx
    ? Papa Romani
2. Harpo Marx
    ? Too Many Kisses
    ? Stage Door Canteen
3. Groucho Marx
    ? Copacabana
    ? Mr. Music
    ? Double Dynamite
4. Gummo Marx
5. Zeppo Marx
    ? A Kiss in the Dark
Conditional Templates

Tempo provides boolean and value-based conditionals, as well as the ability to define multiple data templates per container (the first matching template wins).

<ul id="marx-brothers3">
    <li data-template data-if-nickname="Groucho"">{{nickname}} (aka {{name.first}}) was grumpy!</li>
    <li data-template data-if-actor>{{name.first}}, nicknamed ‘<i>{{nickname}} {{name.last}}</i>‘ was born on {{born}}</li>

    <!-- Default template -->
    <li data-template>{{name.first}} {{name.last}} was not in any movies!</li>
</ul>

This example would produce the following output:

• Leonard, nicknamed ‘Chico Marx‘ was born on March 21, 1887
• Adolph, nicknamed ‘Harpo Marx‘ was born on November 23, 1888
• Groucho (aka Julius Henry) was grumpy!
• Milton Marx was not in any movies!
• Herbert, nicknamed ‘Zeppo Marx‘ was born on February 25, 1901

You can define templates based on data member existence as well:

<li data-template data-has="friend">{{friend}}></li>
Fallback Template

Use the data-template-fallback attribute to identify HTML containers you would like to show if JavaScript is disabled.

To ensure that your data template is not visible before being rendered (either because of JavaScript being disabled or due to latency retrieving the data), it‘s best practice to hide your templates with CSS. If you add an inline rule of style="display: none;". Tempo will remove the inline rule once the data has been rendered.

<ul id="marx-brothers">
    <li data-template style="display: none;">{{nickname}} {{name.last}}</li>
    <li data-template-fallback>Sorry, JavaScript required!</li>
</ul>

If JavaScript is disabled in the browser the above example would be rendered as:

• Sorry, JavaScript required!
Preserving other elements in the template container

If the template container contains other elements that should be preserved or ignored you can mark these with the data-before-template and data-after-template attributes:

<ol id="marx-brothers">
    <li data-before-template>...</li>
    <li data-template>{{name.first}} {{name.last}}</li>
    <li data-after-template>...</li>
</ol>
Filter and Formatting Functions

Tempo supports a number of filter functions to modify individual values before they are rendered. Filters can be chained to apply multiple ones to the same value.

{{ field | escape }}

Escape HTML characters before rendering to page.

{{ field | encodeURI }}

Encodes a Uniform Resource Identifier (URI) by replacing certain characters with escape sequences representing the UTF-8 encoding of the character.

{{ field | decodeURI }}

Replaces each escape sequence in an encoded URI with the character that it represents.

{{ field | truncate 25[, ‘optional_suffix‘] }}

If the value of this field is longer than 25 characters, then truncate to the length provided. If a second argument is provided then it is used as the suffix instead of the default ellipsis (...).

{{ field | format[, numberOfDecimals] }}

Currently only formats numbers like 100000.25 by adding commas: 100,000.25. You can optionally specify the number of decimals to use.

{{ field | default ‘default value‘ }}

If the field is undefined, or null, then show the default value specified.

{{ field | date ‘preset or pattern like HH:mm, DD-MM-YYYY‘[, ‘UTC‘] }}

Creates a date object from the field value, and formats according to presets, or using a date pattern. Available presets are localedate, localetime, date and time. The following pattern elements are supported:

  • YYYY or YY: year as 4 or 2 digits.
  • MMMM, MMM, MM or M: month of the year as either full name (September), abbreviated (Sep), padded two digit number or simple integer.
  • DD or D: day of the month.
  • EEEE, EEE or E: day of the week as either full (Tuesday), abbreviated (Tue) or number.
  • HH, H or h: hour of the day.
  • mm or m: minutes of the hour.
  • ss or s: seconds.
  • SSS or S: milliseconds.
  • a: AM/PM.

If you would like to use any of the format characters verbatim in the pattern then use \ to escape: {{ some_date | date ‘\at HH:mm‘ }}. In this case the a is not replaced with AM/PM. Additionally you can specify whether dates should be handled as UTC.

{{ field | replace ‘regex_pattern‘, ‘replacement‘ }}

Replace all occurrences of the pattern (supports regular expressions) with the replacement. Replacement string can contain backreferences. See Twitter code sample for an example.

{{ field | trim }}

Trim any white space at the beginning or end of the value.

{{ field | upper }}

Change any lower case characters in the value to upper case.

{{ field | lower }}

Change any upper case characters in the value to lower case.

{{ field | titlecase[, ‘and for the‘] }}

Format strings to title case, with an optional blacklist of words that should not be titled (unless first in string e.g. ‘the last of the mohicans‘ to ‘The Last of the Mohicans‘).

{{ field | append ‘&nbsp;some suffix‘ }}

If the field value is not empty, then append the string to the value. Helpful if you don‘t want the suffix to show up in the template if the field is undefined or null. Use &nbsp; if you need before or after the suffix.

{{ field | prepend ‘some prefix&nbsp;‘ }}

If the field value is not empty, then prepend the string to the value. Helpful if you don‘t want the prefix to show up in the template if the field is undefined or null. Use &nbsp; if you need before or after the prefix.

{{ field | join ‘separator‘ }}

If the field is an array joins the elements into a string using the supplied separator.

Attribute setters

If an HTML element attribute in a template is immediately followed by a second attribute with the same name, prefixed with data-, then as long as the second one is not empty will the value of the original be replaced with the value of the latter.

In the following example, will the reference to default_image.png be replaced by an actual field value if one exists. Notice here that the .png suffix is only added if the field is not empty.

<img src="default_image.png" data-src="{{actual_image_if_exists | append ‘.png‘}}" ... />
Template tags

Tempo also supports tag blocks:

{% if javascript-expression %} ... {% else %} ... {% endif %}

The body of the tag will only be rendered if the JavaScript expression evaluates to true. The {% else %} is optional.

Variable injection for inline scripts

If you‘re using scripts inline in your template, you can access JSON object members. You reference these via the __ variable.

<a href="#" onclick="alert(__.nickname); return false;">{{name.last}}</a>

Similarly you can reference array elements (shorthand for for __.this[0]):

<a href="#" onclick="alert(__[0]); return false;">{{[0]}}</a>

You can refer to the object being iterated with __.this. You can use normal dot notation to access members of that object:

<a href="#" onclick="alert(__.this); return false;">{{.}}</a>

At render time the accessor variable will be replaced by the object it references. If the object is a string then its value will be wrapped in single quotes, otherwise type is preserved.

Pre-processing and Event Handling
template.when(type, handler)

After preparing a template you can register one or more event listeners by providing a callback function to be notified of events in the lifecycle.

type

The type of the event. Constant values are defined in TempoEvent.Types.

  • TempoEvent.Types.RENDER_STARTING: Indicates that rendering has started, or been manually triggered by calling starting() on the renderer object.
  • TempoEvent.Types.ITEM_RENDER_STARTING: Indicates that the rendering of a given individual item is starting.
  • TempoEvent.Types.ITEM_RENDER_COMPLETE: Indicates that the rendering of a given individual item has completed.
  • TempoEvent.Types.RENDER_COMPLETE: Indicates that the rendering of all items is completed.
  • TempoEvent.Types.BEFORE_CLEAR: Fires before the container is cleared of all elements.
  • TempoEvent.Types.AFTER_CLEAR: Fires after the container is cleared of all elements.
handler

The handler function to call when the specified event fires.

The event listener will be called with a single argument, a TempoEvent which has the following properties:

type

The type of the event. Constant values are defined in TempoEvent.Types.

item

The item being rendered. This is only available for the ITEM_RENDER_STARTING and ITEM_RENDER_COMPLETE events.

element

The HTML element or template being used for rendering. This is only available for the ITEM_RENDER_STARTING and ITEM_RENDER_COMPLETE events.

Tempo.prepare(‘tweets‘).when(TempoEvent.Types.RENDER_STARTING, function (event) {
        $(‘#tweets‘).addClass(‘loading‘);
    }).when(TempoEvent.Types.RENDER_COMPLETE, function (event) {
        $(‘#tweets‘).removeClass(‘loading‘);
    }).render(data);

Even though it‘s possible to modify the DOM via event handlers it‘s worth keeping in mind that Tempo is built on the premise of keeping the templates as semantic and readable as possible. We would therefore advise that you limit the use or pre-processing to data cleansing and restructuring as opposed to template modifications.

template.starting()

In some cases you prepare the templates ahead of calling render. In those cases if you would like to e.g. set loader graphics, call the renderer‘s starting() method just prior to issuing e.g. a jQuery request. This will fire the ITEM_RENDER_STARTING event.

The following example demonstrates use of both methods above. In this case we prepare the templates, and register our event handler function. The event handler is then notified that the jQuery request is about to be issued (when we manually fireRENDER_STARTING with a call to starting()) adding a CSS class to the container. We are then notified that rendering is complete so we can remove the CSS class.

var template = Tempo.prepare(‘tweets‘).when(TempoEvent.Types.RENDER_STARTING, function (event) {
            $(‘#tweets‘).addClass(‘loading‘);
        }).when(TempoEvent.Types.RENDER_COMPLETE, function (event) {
            $(‘#tweets‘).removeClass(‘loading‘);
        });
template.starting();
$.getJSON(url, function(data) {
    template.render(data.results);
});
Using Tempo with jQuery

jQuery‘s getJSON() method provides an easy means of loading JSON-encoded data from the server using a GET HTTP request.

var template = Tempo.prepare(‘tweets‘);
$.getJSON("http://search.twitter.com/search.json?q=‘marx brothers‘&callback=?", function(data) {
    template.render(data.results);
});
Binding event handlers

Note that if you‘ve bound event listeners to elements in your template, these will not be cloned when the template is used. In order to do this you have two options. You can either leave binding until the data has been rendered, e.g. by registering a TempoEvent.Types.RENDER_COMPLETE listener and doing the binding when that fires, or you can use jQuery live() which attaches a handler to elements even though they haven‘t been created.

The following example shows how to make a template clickable (assuming an ‘ol li‘ selector provides a reference to a template element) and how to obtain a reference to the clicked element:

$(‘ol li‘).live(‘click‘, function() {
    // Do something with the clicked element
    alert(this);
});
Advanced Topics
Configuring the surrounding brace syntax

In order to make it easier to use Tempo with other frameworks such as Django, you can configure Tempo to use surrounding braces other than the default {{ ... }} and % ... %}.

To do this you pass the var_braces and tag_braces parameters to the Tempo.prepare function. These will be split down the middle to form the left and right braces.

Tempo.prepare(‘marx-brothers‘, {‘var_braces‘ : ‘\\[\\[\\]\\]‘, ‘tag_braces‘ : ‘\\[\\?\\?\\]‘});

You can now use this template syntax instead:

<ol id="marx-brothers">
    <li data-template>[[nickname]] is [? if nickname == ‘Groucho‘ ?]grouchy[? else ?]happy[? endif ?]!</li>
</ol>
Tempo Renderer Information - the _tempo variable

You can access information about the rendering process via the _tempo variable.

_tempo.index

The index member tells you how many iterations of a given template have been carried out. This is a zero (0) based index. Nested templates have a separate counter.

The following example adds the iteration count to the class attribute, prefixed with ‘item-‘:

<ol id="marx-brothers" class="item-{{_tempo.index}}">
    <li data-template>{{nickname}} {{name.last}}</li>
</ol>

This example shows how to access the iteration counter using inline JavaScript injection:

a href="#" onclick="alert(__._tempo.index); return false;">{{name.last}}</a>
_tempo.first

True if the item being iterated is the first one in the collection.

_tempo.last

True if the item being iterated is the last one in the collection.

转自:https://github.com/twigkit/tempo#data-1

Tempo 2.0

时间: 2024-11-05 22:39:06

Tempo 2.0的相关文章

tempo 2.0 学习记录

最近在做项目时使用了tempo,感觉还不错,但是发现网上对于tempo 2.0 的介绍比较少,我也是在GitHub才找到了比较完整的使用说明,我也简单记录一下自己的使用过程,重新学习一下tempo 2.0 , 不喜勿喷,喜欢看英文的朋友请移步tempo 2.0 英文说明 . 1.引入tempo.js <script src="js/tempo.js" type="text/javascript"></script> 2.准备数据Data(标准

Sox语音转换的相关知识

SoX-linux 里操作音频的瑞士军刀 Sox是最为著名的Open Source声音文件 格式转换工具.已经被广泛移植到Dos.windows.OS2.Sun.Next.Unix.Linux等多个操作系统 平台.Sox项目是由Lance Norskog创立的,后来被众多的开发 者逐步完善,现在已经能够支持很多种声音文件格式和声音处理效果.基本上常见的声音格式都能够支持.更加有用的是,Sox能够进行声音滤波.采样频率转换,这对那些从事声讯平台开发或维护的朋友非常有用.当然,Sox里面也包括一些D

C# 录音和变调

一直想研究下录音 正好有个项目有机会使用一下强大的 NAudio (https://github.com/naudio/NAudio)库 录音 NAudio 录音类库 public class NAudioRecorder { public WaveIn waveSource = null; public WaveFileWriter waveFile = null; private string fileName = string.Empty; /// <summary> /// 开始录音

鬃嘴释怀说太多就成真不了。

子阻撞砖奏尊仔籽着 释怀说太多就成真不了. http://passport.baidu.com/?business&un=vip&un=%E5%A4%A9%E6%B0%B4%E4%B8%8A%E9%97%A8%E8%BF%99%E5%B0%8F%E5%A7%90#0 http://passport.baidu.com/?business&un=vip&un=%E7%99%BD%E9%93%B6%E4%B8%8A%E9%97%A8%E8%BF%99%E5%B0%8F%E5%A

澜星粘鼐贩逊耐盼系甭妊倏纪傲傲sdfghjk

http://passport.baidu.com/?business&un=R&un=%E5%A4%A7%E5%AE%81%E6%A1%91%E6%8B%BF%E9%80%9A%E5%B0%8F%E5%A7%90#0 http://passport.baidu.com/?business&un=R&un=%E4%B9%A1%E5%AE%81%E6%A1%91%E6%8B%BF%E9%80%9A%E5%B0%8F%E5%A7%90#0 http://passport.bai

在Ubuntu14.04上OpenStack Juno安装部署

在Ubuntu14.04上OpenStack Juno安装部署 0 安装方式 0.1 安装方式 安装方式 说明 目标 备注 单结点 一台服务器运行所有的nova-xxx组件,同时也驱动虚拟实例. 这种配置只为尝试Nova,或者为了开发目的进行安装.   1控制节点+N个计算节点 一个控制结点运行除nova-compute外的所有nova-services,然后其他compute结点运行nova-compute.所有的计算节点需要和控制节点进行镜像交互,网络交互,控制节点是整个架构的瓶颈. 这种配

2008 SCI 影响因子(Impact Factor)

Excel download 期刊名缩写 影响因子 ISSN号 CA-CANCER J CLIN 74.575 0007-9235 NEW ENGL J MED 50.017 0028-4793 ANNU REV IMMUNOL 41.059 0732-0582 NAT REV MOL CELL BIO 35.423 1471-0072 PHYSIOL REV 35.000 0031-9333 REV MOD PHYS 33.985 0034-6861 JAMA-J AM MED ASSOC 3

TEMPO研究第一年影像学数据: 骨侵蚀修复几乎只出现在无关节肿胀或肿胀改善组

标签: TEMPO研究; 依那西普; 放射学进展; 类风湿关节炎 TEMPO研究第一年影像学数据: 骨侵蚀修复几乎只出现在无关节肿胀或肿胀改善组 EULAR2007. Abstract No: OP0011. D. van der Heijde 1, C. Lukas 1, S. Fatenejad 2, R. Landewe 1. 1Rheumatology, University Hospital, Maastrict, Netherlands, 2Research and Developm

安装11.2.0.3 RAC grid 执行root.sh报错

安装11.2.0.3 RAC grid 执行root.sh报错   root wallet   root wallet cert   root cert export   peer wallet   profile reader wallet   pa wallet   peer wallet keys   pa wallet keys   peer cert request   pa cert request   peer cert   pa cert   peer root cert TP