cancel
Showing results for 
Search instead for 
Did you mean: 

Adding CSS stylesheets to EP's deployed Visual Composer models

Former Member
0 Kudos

Hi Guys

First of all hello to everyone. I need your help because i want to add an CSS stylesheet definition to an Enterprise Portal Visual composer deployed model because i need to lock the model in order that anybody can't print that information from any browser. I know that i can lock the printing using this stylesheet:

<style type="text/css" media="print">

*

</style>

or:

<link rel="stylesheet" type="text/css" href="example.css" media="print">

but i don't know where or how can i insert this html code because i opened the deployed EP .par model but the html rendering process is made completely with java. I don't know how or where can i insert this lines. Or where can i find some related information related to modifying this deployed model

I'm using SAP EP 6.40 SP19

Thanks for help me and best regards

Martin Olmos

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi to everyone

I have a couple of time ago since my last post because i was checking what mr salein says in this last post. I was reading the link that he sends me and i was having an idea after reading the wiki page. I already solved the problem with this procedure:

I opened my visual composer model in the Internet Browser and open the rendered source code. I opened one of the css files that my VC model uses and i edit that file inserting this lines after looking for some css commands information:

@media print

{

*{display:none;visibility:hidden;}

}

And this lines works like a charm. Exactly what i need.

I'll give some points to mr Salein because his answer helps me to gives me a clue of how to make this. But it's not the answer that i expected. So i'll give 6 points for that

Thanks for everyone and hope that somebody can found useful this answer. You can make something similar if you want to add custom javascripts functions too.

Best regards to everyone and thanks form your answers

Martin Olmos

former_member203343
Contributor
0 Kudos

Hi Martin,

Sorry, I didn't see that you are working on NW04. What I suggested in my last post was for NW04s. I don't see how you can insert such a css file. I have no idea how you can prevent printing from browser in a different way. Sorry

Regards,

Natty

former_member203343
Contributor
0 Kudos

Hi Martin,

There is a way to add a css link. You need to add it in the JSP file that is created by Visual composer and deployed to the portal. Once you have the deployed PAR file on the portal, go to the file system, locate the iView's folder :

\usr\sap\<SID>\JC<XX>\j2ee\cluster\server<X>\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\portalapps\<iView ID>

Under this folder you have the jsp folder. Edit this file and add the css link. Once you finish, delete the "work" directory and restart the J2EE server. Now your changes should take effect.

Hope this helps,

Natty

Former Member
0 Kudos

Hi Natty

First of all thanks for your comments. I've tried what you say in your post but i can't found any jsp files. I only have a private and src folders, and a portalapp.xml file. In the src folder i have an IviewID.jar file that when i decompressed i found this java source files:

VC_Model_Name_pcm.java

VC_Model_Name_ctl.java

I opened the VC_Model_Name_ctl.java because i think that all the model render process is make in the *_ctl.java. But i don't know how to edit it. This is the packages definition that uses this file to make the render process:

import java.util.Map;

import java.util.HashMap;

import com.sapportals.htmlb.event.Event;

import com.sapportals.portal.prt.component.IPortalComponentProfile;

import com.sap.portal.guimachine.gml.*;

import com.sap.portal.guimachine.htmlbkit.infoactors.*;

import com.sap.portal.guimachine.htmlbkit.interactors.*;

import com.sap.portal.guimachine.htmlbkit.operators.*;

import com.sap.portal.guimachine.htmlbkit.utils.*;

import java.util.ResourceBundle;

I don't know if in this package definitions can i found some function to add a CSS link or an embedded CSS style, or is there another way to block the printing automatically from Visual Composer or SAP EP.

do you have any clue or any information about this kind of rendering process and how to edit this java files?

Thanks for your comments and your help

Martin Olmos

Former Member
0 Kudos

Hi Martin,

a description how you can modify the Visual Composer CSS file you can find here:

<a href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/vc/changingColors&">https://www.sdn.sap.com/irj/sdn/wiki?path=/display/vc/changingColors&</a>

Best Regards,

Marcel