OBIEE 12c. Creating custom link in header with privilege in XML - oracle12c

<link id="l3" name="LInkName" description="Desc" src="URL" target="blank" iconSmall="common/info_ena.png" >
<locations>
<location name="header" insertBefore="home"/>
</locations>
</link>
I need to add here restriction by privilege, this link must be do not display if user have no BIServiceAdministrator role.
I checked this in Oracle help, but there just:
link: privilege
Optional
String
Specifies the name of privileges that a user must be granted to see the link. The privileges are indicated as an expression, as shown in the following example:
privileges.Access['Global Answers']&& privileges.Access['Global Delivers']
I tried to use some variants of this, but all of this don't work (without privilege - link work)
14
<link id="l2" name="LinkName" description="LinkDesc" src="URL" target="blank" iconSmall="common/info_ena.png" >
<privileges>
<privilege.Access['Global Answers']/>
</privileges>
<locations>
<location name="header" insertBefore="home"/>
</locations>
</link>
13
<link id="l2" name="LinkName" description="LinkDesc" src="URL" target="blank" iconSmall="common/info_ena.png" >
<privileges>
<privilege.Access['Global Answers']="true"/>
</privileges>
<locations>
<location name="header" insertBefore="home"/>
</locations>
</link>
12
<link id="l2" name="LinkName" description="LinkDesc" src="URL" target="blank" iconSmall="common/info_ena.png" privileges.Access['Global Answers']="true">
<locations>
<location name="header" insertBefore="home"/>
</locations>
</link>
11
<link id="l2" name="LinkName" description="LinkDesc" src="URL" target="blank" iconSmall="common/info_ena.png" >
<privilege>
<privileges.Access['Global Answers']="true"/>
</privilege>
<locations>
<location name="header" insertBefore="home"/>
</locations>
</link>
9
<link id="l2" name="LinkName" description="LinkDesc"
src="URL" target="blank" iconSmall="common/info_ena.png" privileges.isAdmin = true>
<locations>
<location name="getstarted" />
</locations>
</link>

1.) Don't repeat your link IDs. It's an ID and is supposed to be unique.
2.) The solution is
Privileges is an attribute of the link element. If you have any doubt it's always best to look into the .xsd for the xml file!

And now I have right decision:
<link id="l3" name="LinkName" description="Desc" src="URL" target="blank" iconSmall="common/info_ena.png" privilege = "privileges.Access['Global Admin']">
<locations>
<location name="header" insertBefore="home"/>
</locations>
</link>

Related

How to export list of all ledgers which is under sundry debitors from tally using xml

I want to export list of all ledgers which is under sundry debitors from tally using xml.
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Export</TALLYREQUEST>
<TYPE>Collection</TYPE>
<ID>Ledgers</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVEXPORTFORMAT>SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
<TDL>
<TDLMESSAGE>
<COLLECTION ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="Ledgers">
<TYPE>Ledger</TYPE>
<CHILDOF>$$GroupSundryDebtors</CHILDOF>
<BELONGSTO>Yes</BELONGSTO>
<NATIVEMETHOD>*/NATIVEMETHOD>
</COLLECTION>
</TDLMESSAGE>
</TDL>
</DESC>
</BODY>
</ENVELOPE>
By mentioning type as Ledger:Group we can filter ledgers based on group by mentioning groupname in childof tag
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Export</TALLYREQUEST>
<TYPE>Collection</TYPE>
<ID>Ledgers</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
<!-- * Supports only xml format -->
<SVFROMDATE TYPE="Date">{{Fromdate}}</SVFROMDATE>
<SVTODATE TYPE="Date">{{ToDate}}</SVTODATE>
</STATICVARIABLES>
<TDL>
<TDLMESSAGE>
<COLLECTION ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="Ledgers">
<TYPE>Ledger:Group</TYPE>
<Childof>Sundry Debtors</Childof>
<NATIVEMETHOD>Address</NATIVEMETHOD>
<!-- * will fetch all fields if you want specific fields you can specify -->
<NATIVEMETHOD>Name,Parent,*</NATIVEMETHOD>
</COLLECTION>
</TDLMESSAGE>
</TDL>
</DESC>
</BODY>
</ENVELOPE>

Magento 2 Block not adding

Magento 2 related Problem:
The header.phtml gets included but the purchase.phtml doesn't and we can't find the issue why. This bug only appears on our success page
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="head.additional">
<block class="Anowave\Ec\Block\Track" name="ec_header" as="ec_header" template="header.phtml" />
<block class="Anowave\Ec\Block\Track" name="ec_purchase" as="ec_purchase" template="purchase.phtml" >
<block class="Anowave\Ec\Block\Track" name="ec_datalayer" as="ec_datalayer" template="datalayer.phtml" />
<block class="Anowave\Ec\Block\Track" name="ec_impressions" as="ec_impressions" template="impression.phtml" />
<block class="Anowave\Ec\Block\Track" name="ec_search" as="ec_search" template="search.phtml" />
<block class="Anowave\Ec\Block\Track" name="ec_detail" as="ec_detail" template="detail.phtml" />
</block>
</referenceBlock>
<referenceContainer name="after.body.start">
<block class="Anowave\Ec\Block\Track" name="ec_noscript" as="ec_noscript" template="noscript.phtml" />
</referenceContainer>
<referenceContainer name="before.body.end">
<block class="Anowave\Ec\Block\Track" name="ec_events" as="ec_events" template="events.phtml" />
<block class="Anowave\Ec\Block\Track" name="ec_promotions" as="ec_promotions" template="promotions.phtml" />
<block class="Anowave\Ec\Block\Track" name="ec_footer" as="ec_footer" template="footer.phtml" />
</referenceContainer>
</body>
</page>
Looks like you want call templates in a template. Try insert the code below in your purchase.phtml:
include ($block->getTemplateFile('Anowave_ec::search.phtml'));

Ionic v2 Download and display Image

I am trying to develop an application where I have to download and display an image from a website. THis is the code snippet which I have used:-
LoadImage(){
const transfer = new Transfer();
var url = "http://demo.observerjobs.lk/storage/public/uploads/vacancies/"+this.hash+"/"+this.attachment;
var uri = encodeURI(url);
var filepath = cordova.file.cacheDirectory+ '/' + this.vacancy.attachment;//("/"+this.vacancy.attachment);
transfer.download(uri, filepath, true ).then((entry) => {
console.log('download complete: ' + entry );
this.image = "<ion-img src= '"+ entry.toURL() + "'/>";
console.log(this.image);
}).catch(error => {
console.log(JSON.stringify(error));
});
}
I create the img tag in the following format:-
"<ion-img src= 'file:///data/user/0/package_name/cache/suo-01-29-012588-12x3-kbd.jpg'/>"
However, I am unable to retrieve this file to be displayed. What Have I done wrong, and what can I do to remedy this?
Edit:- Here is the config.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="OBSCURED FOR IDENTITY" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>OBSCURED</name>
<description>An awesome Ionic/Cordova app.</description>
<author email="hi#ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html"/>
<access origin="*"/>
<allow-intent href="http://*/*"/>
<allow-intent href="https://*/*"/>
<allow-intent href="tel:*"/>
<allow-intent href="sms:*"/>
<allow-intent href="mailto:*"/>
<allow-intent href="geo:*"/>
<platform name="android">
<allow-intent href="market:*"/>
<icon src="resources\android\icon\drawable-ldpi-icon.png" density="ldpi"/>
<icon src="resources\android\icon\drawable-mdpi-icon.png" density="mdpi"/>
<icon src="resources\android\icon\drawable-hdpi-icon.png" density="hdpi"/>
<icon src="resources\android\icon\drawable-xhdpi-icon.png" density="xhdpi"/>
<icon src="resources\android\icon\drawable-xxhdpi-icon.png" density="xxhdpi"/>
<icon src="resources\android\icon\drawable-xxxhdpi-icon.png" density="xxxhdpi"/>
<splash src="resources\android\splash\drawable-land-ldpi-screen.png" density="land-ldpi"/>
<splash src="resources\android\splash\drawable-land-mdpi-screen.png" density="land-mdpi"/>
<splash src="resources\android\splash\drawable-land-hdpi-screen.png" density="land-hdpi"/>
<splash src="resources\android\splash\drawable-port-ldpi-screen.png" density="port-ldpi"/>
<splash src="resources\android\splash\drawable-port-mdpi-screen.png" density="port-mdpi"/>
<splash src="resources\android\splash\drawable-port-hdpi-screen.png" density="port-hdpi"/>
</platform>
<platform name="ios">
<allow-intent href="itms:*"/>
<allow-intent href="itms-apps:*"/>
</platform>
<platform name="windows">
<preference name="windows-target-version" value="10.0"/>
</platform>
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashMaintainAspectRatio" value="true"/>
<preference name="FadeSplashScreenDuration" value="300"/>
<preference name="SplashScreen" value="screen"/>
<preference name="SplashScreenDelay" value="3000"/>
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar"/>
</feature>
<plugin name="ionic-plugin-keyboard" spec="~2.2.1"/>
<plugin name="cordova-plugin-whitelist" spec="1.3.1"/>
<plugin name="cordova-plugin-console" spec="1.0.5"/>
<plugin name="cordova-plugin-statusbar" spec="2.2.1"/>
<plugin name="cordova-plugin-device" spec="1.1.4"/>
<plugin name="cordova-plugin-splashscreen" spec="~4.0.1"/>
<icon src="resources\android\icon\drawable-xhdpi-icon.png"/>
<allow-navigation href="http://192.168.1.3:8100"/>
<allow-navigation href="http://192.168.1.3:8101"/>
<allow-navigation href="http://192.168.1.2:8100"/>
<allow-navigation href="http://192.168.8.105:8100"/>
</widget>
Here is the http file of the relevant page:-
<!--
Generated template for the Vacancy page.
See http://ionicframework.com/docs/v2/components/#navigation for more info on
Ionic pages and navigation.
-->
<ion-header>
<ion-navbar>
<ion-title>Vacancy</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<ion-list no-lines *ngIf="vacancy">
<ion-item >Contract Type : {{vacancy.value}}</ion-item>
<ion-item >Company : {{item.company_name}}</ion-item>
<ion-item >Deadline : {{ deadlinetime }}</ion-item>
<ion-item >Job ID : #JD{{ item.id }}</ion-item>
</ion-list>
<h2 *ngIf="vacancy" orientation="center">{{item.job_title}}</h2>
<div *ngIf="image" [innerHtml]="image"></div>
</ion-content>
I would try:
Component:
imageSrc:string//class variable
LoadImage(){
const transfer = new Transfer();
var url = "http://demo.observerjobs.lk/storage/public/uploads/vacancies/"+this.hash+"/"+this.attachment;
var uri = encodeURI(url);
var filepath = cordova.file.cacheDirectory+ '/' + this.vacancy.attachment;//("/"+this.vacancy.attachment);
transfer.download(uri, filepath, true ).then((entry) => {
console.log('download complete: ' + entry );
this.imageSrc = entry.toUrl();
console.log(this.imageSrc);
}).catch(error => {
console.log(JSON.stringify(error));
});
}
HTML:
<img *ngIf="imageSrc" [src]="imageSrc"></img>

Page navigation in ICEFaces

I recently started working on JSF in ICEFaces FrameWork(Server # Glassfish).
I have one question.
In my first JSF page i have radio buttons, If i to select and click on next page, I have to publish those selected values in my second page. If i click on back button , i have to show the selected values in my first page.
How can i achieve this? Please suggest
My First Page(suites.xhtml).
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ace="http://www.icefaces.org/icefaces/components">
<ui:composition template="/WEB-INF/templates/template.xhtml">
<ui:param name="title" value="Eclipse Template Test Page" />
<ui:param name="companyName" value="Autoexetc" />
<ui:define name="menuItems">
<ace:menuItem value="Dashboard" url="/dashboard.jsf" icon="ui-icon ui-icon-home"
styleClass="menuBarItem" />
<ace:menuItem value="Suites" url="/suites.jsf" styleClass="menuBarItem" />
<ace:menuItem value="Status" url="/status.jsf" styleClass="menuBarItem" />
<ace:menuItem value="Report" url="#" styleClass="menuBarItem" />
<ace:menuItem value="Terminal" url="#" styleClass="menuBarItem" />
</ui:define>
<ui:define name="tabItems">
Your in Suites Page <h:commandButton value="Back To DashBoard" action="dashboard" />
<br></br>
1. Hard-coded with "f:selectItem" :
<h:selectOneRadio value="#{user.favColor1}">
<f:selectItem itemValue="Red" itemLabel="Color1 - Red" />
<f:selectItem itemValue="Green" itemLabel="Color1 - Green" />
<f:selectItem itemValue="Blue" itemLabel="Color1 - Blue" />
</h:selectOneRadio>
<br />
2. Generated by Map :
<h:selectOneRadio value="#{user.favColor2}">
<f:selectItems value="#{user.favColor2Value}" />
</h:selectOneRadio>
<br />
3. Generated by Object array and iterate with var :
<h:selectOneRadio value="#{user.favColor3}">
<f:selectItems value="#{user.favColor3Value}" var="c"
itemLabel="#{c.colorLabel}" itemValue="#{c.colorValue}" />
</h:selectOneRadio>
<br />
<h:commandButton value="Submit" action="status" />
<h:commandButton value="Reset" type="reset" />
</ui:define>
</ui:composition>
</html>
And My Result Page (status.Xhtml), which gives my selected values.
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ace="http://www.icefaces.org/icefaces/components">
<ui:composition template="/WEB-INF/templates/template.xhtml">
<ui:param name="title" value="Eclipse Template Test Page" />
<ui:param name="companyName" value="Autoexetc" />
<ui:define name="menuItems">
<ace:menuItem value="Dashboard" url="/dashboard.jsf" icon="ui-icon ui-icon-home"
styleClass="menuBarItem" />
<ace:menuItem value="Suites" url="/suites.jsf" styleClass="menuBarItem" />
<ace:menuItem value="Status" url="/status.jsf" styleClass="menuBarItem" />
<ace:menuItem value="Report" url="#" styleClass="menuBarItem" />
<ace:menuItem value="Terminal" url="#" styleClass="menuBarItem" />
</ui:define>
<ui:define name="tabItems">
Your in status Page <h:commandButton value="Back To suites" action="suites" />
<br/>
<ol>
<li>user.favColor1 : #{user.favColor1}</li>
<li>user.favColor2 : #{user.favColor2}</li>
<li>user.favColor3 : #{user.favColor3}</li>
</ol>
</ui:define>
When i click on back button from my result page, first page will display with selected values, if i re-select any values and submit it, cant able to navigate to my result page.

primefaces not working with eclipse indigo

i'm doing some stuff with primefaces om eclipse indigo, i made a dynamic web project and selects the project facets and included the primefaces jar primefaces-3.5.jar i made a new xhtml page and write some code to make a new menubar, these is the final page that i run :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head></h:head>
<h:body>
<h:form>
<p:growl id="messages"/>
<h3>Default Menubar</h3>
<p:menubar>
<p:submenu label="File" icon="ui-icon-document">
<p:submenu label="New" icon="ui-icon-contact">
<p:menuitem value="Project" url="#" />
<p:menuitem value="Other" url="#" />
</p:submenu>
<p:menuitem value="Open" url="#" />
<p:separator />
<p:menuitem value="Quit" url="#" />
</p:submenu>
<p:submenu label="Edit" icon="ui-icon-pencil">
<p:menuitem value="Undo" url="#" icon="ui-icon-arrowreturnthick-1-e" />
<p:menuitem value="Redo" url="#" icon="ui-icon-arrowreturnthick-1-e" />
</p:submenu>
<p:submenu label="Help" icon="ui-icon-help">
<p:menuitem value="Contents" url="#" />
<p:submenu label="Search" icon="ui-icon-search">
<p:submenu label="Text">
<p:menuitem value="Workspace" url="#" />
</p:submenu>
<p:menuitem value="File" url="#" />
</p:submenu>
</p:submenu>
<p:submenu label="Actions" icon="ui-icon-gear">
<p:submenu label="Ajax" icon="ui-icon-refresh">
<p:menuitem value="Save" actionListener="#{menuBean.save}" icon="ui-icon-disk" update="messages"/>
<p:menuitem value="Update" actionListener="#{menuBean.update}" icon="ui-icon-arrowrefresh-1-w" update="messages"/>
</p:submenu>
<p:submenu label="Non-Ajax" icon="ui-icon-newwin">
<p:menuitem value="Delete" actionListener="#{menuBean.delete}" icon="ui-icon-close" update="messages" ajax="false"/>
</p:submenu>
</p:submenu>
<p:menuitem value="Quit" url="http://www.primefaces.org" icon="ui-icon-close" />
<f:facet name="options">
<p:inputText style="margin-right:10px"/>
<p:commandButton type="button" value="Logout" icon="ui-icon-extlink" />
</f:facet>
</p:menubar>
</h:form>
</h:body>
</html>
the output of the page is :Default Menubar
Note i get these sample from the prime faces tutorials page
Apparently you didn't include the PrimeFaces JAR file properly in the webapp's runtime classpath.
Here are the steps (well, step), you need to perform in a Dynamic Web Project in Eclipse in order to include a 3rd party JAR file properly in webapp's runtime classpath.
Drop the JAR file straight in project's /WEB-INF/lib folder.
That's all.
If you have ever fiddled around in project's Build Path properties in an attempt to achieve/fix it, then you need to make absolutely sure that you undo it all, or it may still cause conflicts/clashes.