четверг, 25 августа 2016 г.

Make JPA Entity with @OneToMany and @ManyToOne mapping tags

Problem:
Your need to make JPA Entity with @OneToMany and @ManyToOne mapping tags.

Solution:
You have tables like this:

Table "Requests":
Field Type
ID Integer
STEP_ID Integer

Table "Steps":
Field Type
ID Integer
REQUEST_ID Integer

Table "Requests" should have in field "Step_Id" many rows from table "Steps", and table "Steps" should have in field "Requst_Id" one row from "Requests" table.

Make JPA Entities like this:

@Entity
@Table(name="REQUESTS")
public class Requests implements Serializable {

@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private long id;

@OneToMany(mappedBy="request", fetch=FetchType.EAGER)
private Set<Steps> steps = new HashSet<Steps>();


public Requests() {
}

public long getId() {
return this.id;
}

public void setId(long id) {
this.id = id;
}

public void setSteps(Set<Steps> history) {
this.steps = steps ;
}

public Set<Steps> getSteps() {
return steps;
}
}

@Entity
@Table(name="STEPS")
public class Steps implements Serializable {

@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private int id;

@ManyToOne(cascade = {CascadeType.MERGE, CascadeType.PERSIST}, fetch=FetchType.EAGER)
@JoinColumn(name = "REQUEST_ID")
private EoRequestsEntity request;

public Steps() {
}

public int getId() {
return this.id;
}

public void setRequest(Requests request) {
this.request = request;
}

public EoRequestsEntity getRequest() {
return request;
}

}


Tags "cascade" and "fetch" is required!

That's all!

среда, 24 августа 2016 г.

How to create iView for sap portal web module application

Problem:
How to create iView for sap portal web module application

Solution:

  1. Create URL iView and set link to your web module application. If you do not know thar, you can run it in your Netweaver Developer Studio: right hand mouse click on development component, choose Run on Server - choose your server and run it. You will see url in browser.
  2. In iView properties set property Fetch Mode - Server Side.



пятница, 12 августа 2016 г.

Check if your TLD is valid against its scheme

Problem:
You have an error:
Caused by: com.sap.engine.services.servlets_jsp.jspparser_api.exception.JspParseException: Error in parsing the taglib tag in the JSP page. Cannot resolve URI: [http://java.s.com/jsf/html]. Possible reason - validation failed. Check if your TLD is valid against its scheme. 


Solution:
Put in your ear (Enterprise Application) development component in file ""META-INF/application-j2ee-engine.xml"" that code:

 <application-j2ee-engine xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="application-j2ee-engine.xsd"> 
    <reference reference-type="weak">
    <reference-target target-type="library" provider-name="sap.com">
       tc~ui~faces
    </reference-target>
    </reference>
  </application-j2ee-engine>

End everything works!

вторник, 5 июля 2016 г.

NWDS prompt for create activity in NWDI when editing some file

To prompt for create activity in NWDI when editing some file in NWDS you should go to Window -> Preference -> Development Infrastructure -> Design Time Repository -> Dialog Settings. In that window choose prompt.

четверг, 8 октября 2015 г.

Logging and Tracing Web Service Call on SAP NetWeaver Portal

You want to see request trace whan web service was called.

You should:

  • Go to /NWA -> Log Configuration
  • Switch to Tracing Locations view
  • go to locations:

com.sap.engine.services.httpserver.HttpTraceRequest.traceHeaders
com.sap.engine.services.httpserver.HttpTraceRequest.traceRaw
com.sap.engine.services.httpserver.HttpTraceResponse.traceHeaders
com.sap.engine.services.httpserver.HttpTraceResponse.traceRaw
  • Set debug mode to all of them

пятница, 21 августа 2015 г.

How to hide in SAP Portal Header menu Back, Forward, History, Favorites, Personalize, View, Help, New Session, SAP Store, Search

Hello!

Problem:
To hide in SAP Portal Header (version 7.3) menu Back, Forward, History, Favorites, Personalize, View, Help, New Session, SAP Store, Search do this:

Solution:
Go to "Content Administration", then go and open this object:
portal_content/every_user/general/defaultAjaxframeworkContent/com.sap.portal.AFPpage

Open object AFP Masthead properties:
SAP Store - uncheck property Show Link in Masthead: Enterprise Store
New Session - uncheck property Show Link in Masthead: New Session
Search in porta header - uncheck property Enable Quick Launch

Open object AFP Widgets properties and search properties which starts with "Show" and there uncheck what you need. There will be properties: Back, Forwrard, History, Favorites, Personalize, View, Help.

понедельник, 27 июля 2015 г.

Сообщение OUTBOUND или INBOUND

Boolean outboundProperty = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
                
                if(outboundProperty){

понедельник, 30 марта 2015 г.

How to call PI Web Service or SOAPFaultException: Server Error

Problem:
You are trying to call SAP PI - Process Integration or XI -  Exchange Infrastructure or PO - process Orchestration.

You made proxy Java Class using WSDL and NWDS, and you are trying to call it and you have error:
com.sap.engine.services.webservices.espbase.client.bindings.exceptions.SOAPFaultException: Server Error

Solution:
1. You should ask your PI developer for URL for WSDL for Web Service which you want to use. I have it like this: http://<server>:<port>/dir/wsdl?p=ic/<some id>
2. You should import WSDL in NWDS in your project using this URL.
3. Then you should generate proxy Java Classes using that WSDL.
4. It should work.

I've described how to generate proxy java classes here call Web Service Java Client (Proxy) Example.

четверг, 26 марта 2015 г.