Sunday, August 1, 2021

django - all blog links together

 

🔗Introduction & Install django and PyCharm CE

🔗create your first project and runservers and urls and views

🔗how to use templates

🔗homepage - fetch form textarea value from template to views

🔗webpage to have personal navigations

🔗webpage to input text and remove punctuation from it.

🔗adding Bootstrap to django website

🔗POST request and CSRF tokens

🔗Creating E-commerce website with apps setups


django - Creating E-commerce website with apps setups

Here, We will be creating a django E-commerce project named "myEcommerceSite" with 2 apps named "shop" and "blog" within it.

Django Apps :

  • Apps in Django are pluggable web applications.
  • Django apps are the self-sufficient sub module of a project. A project can contain more than one apps, and an app can be used in more than one project.

Follow the below steps:

Step 1: Click on File and then select New Project.

Step 2: After clicking on New Project, a pop-up window will appear. Select the location(PycharmProjects folder recommended) and name the file as myEcommerceSite

Step3: Start the project

C:\Users\Srinanda\Desktop\python\djangoCodeSource\myEcommerceSite>django-admin startproject mes

Step 4: Run the command in following format to create the app.

python manage.py startapp name_of_the_app

C:\Users\Srinanda\Desktop\python\djangoCodeSource\myEcommerceSite\mes>python manage.py startapp blog

C:\Users\Srinanda\Desktop\python\djangoCodeSource\myEcommerceSite\mes>python manage.py startapp shop

The project looks like :


Step5: Create urls.py file in both apps.

shop\urls.py:
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name="ShopHome"),
]
blog\urls.py
from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name="blogHome"),
]

Step6: create views.py as below:

shop\views.py:
from django.shortcuts import render
from django.http import HttpResponse

def index(request):
return HttpResponse("index shop")


blog\view.py:
from django.shortcuts import render
from django.http import HttpResponse

def index(request):
return HttpResponse("index blog")


Step7: Update the main "mes" project urls.py with the following to include blog and shop apps urls.py

from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('admin/', admin.site.urls),
path('shop/', include('shop.urls')),
path('blog/', include('blog.urls'))
]

Step8: run server:
C:\Users\Srinanda\Desktop\python\djangoCodeSource\myEcommerceSite\mes>python manage.py runserver

Step9: open following urls and  test:
http://127.0.0.1:8000/blog/ 
http://127.0.0.1:8000/shop/



Oracle Integration Cloud Service(OICS) links

Please find the following links for OIC hands on and relevant information:


  1. Oracle Integration Cloud Introduction | Benefits | Services offered | Aspects or components of Integrations | Use cases | Integration Styles | Mapper | Integration workflow
  2. Create connections:
    1. Create a DB connection
    2. SOAP Trigger type connection creation
    3. OIC Create Trigger Type REST Connection
  3. Create different basic integrations:
    1. OIC Rest Trigger to DB invoke data fetch Integration using basic routing | Use of Basic Routing Pattern
    2. Publish to OIC and Subscribe to OIC
    3. Enrichment in basic routing integration
    4. Integration using App Driven Orchestration Integration Style | SOAP to DB Insert
    5. Scheduled Orchestration part 2 | FTP to FTP file transfer in Oracle Integration
    6. Scheduled Orchestration | FTP to Database Integration
    7. Integration using File Transfer StyleScheduled Orchestration part 2 | download zip file , list files and write them to a remote directory using FTP
  4. How to do tracking an Instance
  5. Use of Lookup | Create a Lookup and use in an Oracle Cloud Integrations
  6. Exception Handling related:
    1. Exception Handling | Scope level error handler | Global fault handler
    2. Scope level error handling
    3. Global Fault handling in app driven orchestration
    4. OIC - How to handle errors for outbound flow respect to Oracle ERP
    5. OIC - Fault return action - custom HTTP error response in rest flow
    6. OIC - Fault return - send custom fault to a modeled soap trigger.
    7. OIC - out of the box - error handling in easy steps.
    8. OIC - fault handling in details
    9. OIC - different ways of throwing faults | defferent fault throwing mechanisms
  7. Connectivity agent related:
    1. OIC - About Connectivity Agents | Connectivity Agent Architecture
    2. Connectivity Agent part 2 | Connectivity agent install in Linux system
    3. OIC - Install Connectivity agent in windows system.
    4. OIC - File poll as trigger type using Connectivity agent | Oracle Integration Cloud
  8. Custom Javascript related:
    1. OIC - Use of Javascript in oracle integration | use javascript to add two numbers to fixed number of decimal points
    2. Javascript - to remove carriage return
    3. Javascript - Return boolean status based on ERP result status
    4. OIC - Javascript - Replace String
    5. OIC- Javascript - return count of string using Regular expression
    6. OIC - Javascript - find name and value parameters from a string
    7. OIC - NVL in javascript
    8. OIC JS - return last day
    9. OIC JS - return today's date in yyyymmdd format
    10. OIC Generate Random number using custom function
  9. Synchronous Integrations Occasionally Fail with a 504 Gateway Time-out Erro
  10. Use of Translate function in Oracle Integration
  11. OIC to ERP Import and ESS Job Related:
    1. OIC - ERP - Import AP Invoice to cloud ERP using FBDI detailed implementation steps.
    2. OIC - ERP - Detailed implementation steps to import transactions to ERP Fusion accounting hub or ERP FAH sub ledger accounting
    3. OIC to ERP FBDI imports different technique:
      1. OIC - Import to ERP Technique 1 - Import Payables Invoices using import bulk data into Oracle ERP Cloud option | Enable Callback | Subscribe Callback
      2. OIC to ERP Import Technique 2 - importBulkData using ErpIntegrationService and Oracle Erp Cloud Adpapter
      3. OIC - ERP Import Technique 3 - Multi steps
    4. ERP - Import AP Invoice using FBDI files from ERP scheduled Processes
    5. OIC ERP supplier import and receive callback
    6. Sample supplier callback payload from oracle integration
    7. OIC ERP - GL Daily rated fbdi import to ERP and subscribe callback events
    8. OIC ERP - How to download Oracle FBDI template | Generate CSV files from the template file
    9. OiC understand of fbdi properties-file
    10. OIC - ERP - How to get Job Package and Name
    11. OIC - ERP - How to get the Job parameters for bulk import job
    12. ERP - Register the CSF key | Subscribe to Oracle Fusion Cloud | Subscribe to Fusion Business events and FBDI Callback
    13. OIC ERP - How to download Import Payables Invoices Report using ERP Cloud adapter from Oracle Integration
    14. OIC - Import PGP private and public keys in the setting certificates
    15. OIC - ERP Payable invoice callback - Custom report
    16. OIC ERP - Get Source Name for invoice callback | fixed asset etc.
    17. OIC ERP - BI report SQL query for invoice custom report
    18. OIC- How can OIC integration subscribe to business events raised with Oracle ERP cloud
    19. OIC - ERP - how to get child process id from import request id using otbi report
    20. ERP BI SQL query for custom import response or callback
    21. OIC To ERP - Design steps for Import and Custom callback | Oracle Integration Cloud
    22. OIC - ERP - custom callback BI report | What we can do after the FBDI import
    23. OIC to ERP : Move custom report | download custom report based on ess job id and then move to desired folder
    24. OIC - Custom callback from erp | How we can leverage a custom callback using BIP report feature
    25. Sample erp job details account name parameters
    26. how to show the import response id to the activity stream for better support
    27. ESS Job related:
      1. get ESS JOB Status of a ESS import job
      2. OIC - get ESS job status of the child process of the import job
      3. Oracle Fusion ess job definition tables | ERP ESS job Schedule processes tables
      4. OIC - Submit the ESS job and get status of the ESS job from Oracle Integration
      5. OIC - ERP - Monitor Progress of ESS job and return status | Reusable component to monitor the ESS job run status
      6. OIC - ERP - Download ESS job execution output and log using Erpintegrationservice in Oracle Integration
      7. ESS job run for delta calculation
  12. OIC ERP Outbound Integrations related:
    1. OIC - ERP - create an integration to send outbound ERP File using BI bursting FTP delivery channel and ESS job | How to create an erp Outbound flow in Oracle Integration
    2. OIC ERP - submit ess job - sending multiple parameters | call BI Bursting - sending two reports| FTP delivery channel Usecase:
    3. OIC ERP - Create a Reusable Outbound integration | Run outbound interface reports to create outbound files
    4. OIC - ERP - create an integration to send outbound ERP File using BI bursting FTP delivery channel and ESS job | How to create an erp Outbound flow in Oracle Integration

  13. How to handle more than 10 mb file or large file poll
  14. File adapter vs FTP adapter
  15. OIC - Process large file (above 10MB)
  16. OIC - Fetch name and value params from a input string
  17. Target REST endpoint response payload processing failed.[Content received of length XXX bytes exceeds the maximum allowed threshold of 10485760 bytes
  18. OIC - send Notification - email, log file and create incident
  19. Global variable and Data Stitch action
  20. Replace existing connection with the new connection in OIC integration
  21. OIC - Integration properties
  22. OIC - dynamic email send with html table content
  23. Configre rest trigger to get CSV file
  24. Common Integration Pattern Pitfalls and Design Best Practices
  25. OIC - Integration Metadata Access
  26. log file naming convention
  27. Schedule parameters to get last run Date and Time
  28. Why to avoid creating too many scheduled integrations
  29. Convert a Scheduled Integration to a REST Adapter-Triggered Orchestration Integration
  30. OIC - Run a schedule integration now using rest api
  31. OIC - Opaque schema for creating base64Binary file
  32. OIC - substring a string using index-within-string() function.
  33. SFTP operations - Move and delete
  34. OIC - callback action
  35. OIC - Resolved - Stage read file in segements - XML-22031 : Error variable not defined.
  36. OIC - 1z0-1042-21- topics to be covered for certification
  37. OIC Schedule Integration schedule types:
    1. OIC - How to schedule OIC integrations using simple type
    2. OIC - How to schedule an integration using iCal expression
    3. OIC - ical expression to run each month on specific day and time
  38. OIC - How to modify an existing schedule.
  39. OIC - Oracle Feature Flasg overview
  40. OIC - convert string yymmdd to date yyyy-mm-dd using substring() function
  41. OIC- change date time format using xp20:format-dateTime() function
  42. OIC - Migrations | how to migrate integrations in oic
  43. OIC - how to include existing integration to a package
  44. Encrypt and Decrypt and PGP key related:
    1. Create PGP key to use in FTP connection
    2. OIC - Create FTP connection with PGP
    3. OIC - Encrypt and Decrypt using FTP PGP connection and write operation
    4. OIC - decrypt file using download FTP operation and read reference with Stage
    5. OIC - using Stage file action to encrypt and decrypt files
    6. pgp tool to encrypt or decrypt the file
  45. OIC - why to reactivate integration after connection details get changed
  46. OIC - add header or line file field names with easy technique
  47. OIC - about virtual file system | VFS
  48. OIC - how to modify xslt for complex logic using Jdeveloper IDE
  49. OIC - validate date format as mm-dd-yyyy
  50. OIC - convert json to string
  51. OIC - how to create rest ics connection
  52. OIC - How to update lookup from a csv file
  53. OIC - send binary object as rest response
  54. OIC - search data from a csv file
  55. OIC - about business identifiers
  56. OIC - secure rest api with oauth security policy
  57. OIC - Merge two different schema files into a single csv file
  58. OIC - Retry logic in detailed steps with a scenario
  59. OIC How to create a fixed lemgth file using fixed length schema
  60. OIC - How to group data using for each group XSLT 2.0.html
  61. OIC - Read Json data received as json string
  62. OIC - Convert String XML to XML using parseXML() | Use of ParseXML() function
  63. OIC - Invoke a rest service whose request and response payloads as XML | Invoke Rest API with XML payloads
  64. OIC - Post XML payload with Rest API | Rest API with XML Request Response
  65. OIC - Managing Multiple Operations in OIC SOAP Adapter
  66. ERP BI sql query to fetch output based on ESS REQUEST HISTORY Table last run date | Fetch Processstart from ESS_Request_History table
  67. OIC ERP BI publisher call Retry logic Usecase 2
  68. OIC Techniques - Decode base64 encoded BI publisher report | Call an Oracle Fusion Applications Business Intelligence Publisher Report Synchronously
  69. OIC - How to read file size up to 1 GB in oracle integration
  70. OIC | Embedded file server in Oracle integration | using file server in oracle integration generation 2
  71. OIC | Oracle Cloud Integrarions | Restrictions using Oracle Integearion Generation 2
  72. OIC | Oracle Integrations Editions | Standard vs Enterprise features
  73. OIC Service limits | Generation 2 Resources limitation
  74. OIC Gen 1 vs Gen 2 | Benefits of OIC Generation 2
  75. OIC Retention period | Impact of increasing the retention period | Standard and Warning settings
  76. Cloud ERP | How to create an OTBI report | create BI publisher report
  77. OIC | Add Package Name for an Integration
  78. OIC | Package Migration | Multiple Integration Migration
  79. OIC | Migration of integration from one environment to another | Single integration Migration | Multiple Integration Migration
  80. OIC - Prerequisites for creating Oracld ERP Cloud Connection
  81. OIC Rest path parameters vs Query Parameters
  82. OIC | Convert UTC Date and Time to another timezone in Oracle integration cloud servic
  83. OIC to Database related:
    1. OIC - DB Procedure call | DB adapter 10 MB limit overcoming solution | Offset Fetch
    2. OIC - Call DB package insert operation | one to one database insert using Package
    3. OIC - unable to convert string in xml to date format while inserting into database
    4. OIC - Database package call to insert Varray size of data | DB package insert in oracle integration
    5. OIC Oracle Database polling | Oracle Integration cloud DB Polling
    6. OIC - Difference between Oracle Database, DBaaS adapter and ATP adapter
    7. OIC - How to access Database sequence value in Oracle Integration
    8. OIC - How to use DB sequence while do insert or merge to database table in Oracle Integration
    9. OIC - Save Integration request payload XML or JSON into database table
    10. OIC - Create a resuable component or integration to pass the request payload any format and save to database table as clob type.
    11. OIC - DB polling and logical delete from oracle database in Oracle Integration
    12. OIC - PLSQL - Feed comma separated field values as input and fetch table of records as output using Stored procedure
    13. OIC - PLSQL - Feed table of record types and fetch table of records details using stored procedure
    14. OIC - How to call db procedure asynchronously from oracle integration
  84. OIC | Merge two CSV files into one CSV file based on a common field or primary key
  85. Oracle Integration Cloud | Merge two CSV files into a single file without any primary key or common field
  86. OIC | Split a CSV file into multiple CSV files based on a column distinct values in Oracle integration cloud
  87. OIC Certificate Management | Different type of Certificates in Oracle Integration Cloud
  88. OIC - Export an Integration using REST API | Rest API for Oracle Integration export
  89. OIC - Limitation of using staging area
  90. OIC - ERP - Debugging of Business Events subscription for outbound integration
  91. OIC - Import an OIC integration using REST API | How to use Multipart/form-data in Rest adaptet
  92. Encode Base64 function strips off XML Tags in the payload | Oracle Integration cloud
  93. OIC - Create a header file based on sequential unique lines Transaction number | Oracle Integration cloud
  94. OIC Tracing | How to enable and use OIC Tracing | Oracle Integration Cloud
  95. OIC to OCI resources:
    1. OIC to Object storage related:
      1. OIC How to use OCI Object storage from the Oracle Integration Cloud | Put a file to OCI Object storage from Oracle Integration Cloud
      2. OIC - Get object from OCI object storage using OIC | Oracle Integration Cloud
    2. Function:
      1. OIC - How to invoke OCI oracle function from Oracle Integration Cloud
    3. API gateway:
      1. OIC - Create an API gateway in OCI and route to REST Oracle Integrations | OCI API Gateway
  96. OIC - Create a Retry logic to overcome putting file to S3 using rest time out issue
  97. OIC - Use REST adapter with multiple resources or Multiple Verbs in Oracle Integration Cloud
  98. OIC - Twilio adapter - send SMS / WhatsApp from Oracle Integration
  99. OIC - ERP - Supplier import failed due to Supplier type is inactive or invalid
  100. OIC - Design time audit logs | How to monitor design time audit logs
  101. BI report related:
    1. How to create BI report in Oracle ERP
    2. OIC - Invoke ERP BI report | Create ExternalReportWSSService wsdl connection in oracle integration
    3. OIC - ERP - xsl template to create control file BI report
    4. OIC - ERP - BI report bursting using email delivery channel.
    5. OIC - invoke BI control report and store in s3 bucket using rest connection.
    6. OIC - ERP how to test sql query in BIP data model
    7. ERP - BI Report using ETEXT template
    8. RTF template related:
      1. ERP - BI publisher installation and Enable add Ins the word | RTF Template
      2. ERP - BI report using RTF template
      3. Create RTF tamplate on MSword based on exported data model xml
      4. How to create RTF template on msword with more details
    9. Create eText template based BI report
      1. ERP - Create EText EFT template based BI report | Create etext fixed position based BI Report
      2. ERP - Create EDI template based BI report | Create Delimiter based report
    10. ERP - BI report XML output using XSL template
    11. ERP - Create a BI report text output using XSL template
    12. OIC ERP BI Bursting using FTP delivery channel
    13. OIC ERP About BI Bursting
    14. OIC Invoke BI Publisher report with Name value parameters
    15. OIC | How to call and read BI publisher report in OIC Integration
    16. ERP - BI report using Excel template
    17. OIC - Schedule BI Publisher Report through OIC | Oracle Integration cloud | Schedule report service
  102. OIC - Convert CSV file data to JSON | Oracle Integration
  103. OIC - How to continue FOR EACH loop for any failure case | Oracle Integration
  104. OIC - Read Multiple records are of different types CSV file in Oracle Integration | Create Multiple records are of different types XSD file to read CSV file
  105. OIC - Read multiple records are of different types CSV file in Oracle Integration whete 1st column does not have default values
  106. OIC - Upload attachment file in Rest API in oracle integration
  107. OIC - Upload multiple attachment files in REST API in oracle Integration
  108. OIC - how to call "upload attachement as in REST Integration" from another caller integration
  109. OIC - Maximum duration for integration flows | time out time for OIC services | Service limit for Scheduled orchestration or Async or Sync service
  110. OIC - Why Scheduled Integrations are not executing on Time.
  111. OIC - How to change From address for email Notification
  112. OIC - Advantages using Oracle Integration Publish and Subscribe model
  113. Upload and Download files to UCM:
    1. OIC - Upload and Download file to/from UCM ERP | Different options to upload & download files to/from UCM
    2. OIC - Download files from UCM using webservice | GenericSoapPort service
    3. OIC - Upload file to UCM using web service | GenericSoapPort web service
    4. OIC - download file from UCM using webservice | ErpIntegrationService
    5. OIC - Upload file to UCM using webservice | ErpIntegrationService
    6. OIC - upload file to ucm using rest service
    7. OIC - Upload file to UCM using Oracle ERP cloud adapter | ErpIntegrationService
    8. OIC - Download file from UCM using Oracle ERP Cloud Adpater | ErpIntegrationService
  114. OIC - Exposing Rest service supporting a file as attachment and JSON request using Oracle Integration
  115. OIC XSD - How to validate if any field is empty while reading the file | add restriction to a schema field
  116. OIC - How to configure Custom SOAP http headers
  117. OIC - How to convert XML data to Json data and store it in a variable
  118. OIC - Different types of translation failres while doing mapping in the mapper using xsd as a contents structure.
  119. OIC - what is the maximum concurrent / parallel OIC scheduled flows limit?
  120. OIC - Best Practice - Run large number of scheduled integrations at the same time | avoid creating too many scheduled integrations
  121. OIC - How many different scheduled integrations can run in parallel in Oracle Integration | Decoupled scheduler and Business Logic pattern.
  122. OIC - Read latest file from FTP location using oracle integration
  123. OIC - Split comma separated string values to Array | Use of create-nodeset-from-delimited-string() function in XSLT
  124. OIC - Import (Replace) a Lookup | Update an existing OIC Lookup based on base64 encoded CSV file as rest feed
  125. OIC - Update OIC lookups based on BI reports invoke and config file
  126. OIC - Get files from AWS S3 bucket using rest
  127. OIC - Run a Schedule Integration now from oracle integration and retrieve Scheduled Integrations Run Status
  128. OIC ERP - How to select a Layout while invoking BI Report | use of attributeTemplate of ExternalReportWSSService
  129. OIC ERP - Send custom Invoice report using Ess Job call and BI bursting report
  130. OIC ERP - Two Methods to receive Callback/Business Events from ERP – OAuth(New) and CISF Keys(Old)
  131. OIC -XSLT - find out total sum of invoice line item where each line having quantity and price using call template.
  132. OIC to HCM HDL integration | HDL import | Upload to UCM | Subscribe to atom feeds | configure HCM Extracts bulk data in an OIC integration etc.
  133. OIC - OTBI report creation | Invoke the otbi report from Oracle integration | Invoke otbi report webservice from soap ui tool
  134. OIC - About ATP Integration | Can we poll data from ATP as Trigger | ATP adapter Capabilities
  135. OIC ERP - FBDI ImportBulkData using Erpintegration REST API | Get import status using Erpintegration REST API
  136. OIC - There are large number of scheduled orchestrated integrations need to run at the same time. What we can do to avoid backlogged or queued integrations ?
  137. OIC - How to embed image in email notification body
  138. OIC BI - How to call oic web service from fusion BI report
  139. OIC - How to extract large data from Oracle Fusion using REST APIs | How to overcome REST APIs limitation which can return only 499 records in a single request
  140. OIC Javascript Function - Gen3 - the function definition contains unsupported synstax. The output parameter must be named.
  141. ERP BI - How to invoke OIC rest integrations from BI report.
  142. OIC ERP - How to enable Oracle ERP Cloud Business Events | Subscribe Business Events Raised within ERP Cloud
  143. OIC - Error occured in fetching the attachment for Email
  144. OIC - Append operation in Data stitch action | Incrementally build a messags payload using Data stitch
  145. OIC FTP - FTP adapter write to file - File name pattern not taking the pattern specified in the mapper
  146. OIC generation 3 features links | OIC gen3 topics | OIC gen3 blogs
  147. OIC - Error occurred while processing activity decryptsf4. Error: java.io.IOException: Error in decrypting the stream for file f:
  148. OIC - iCal expression for scheduling a task to run at 4 PM on June 30th and December 31st each year in the Oracle Integration Cloud (OIC) scheduler?
  149. OIC - Need to format a dateTime object with a three character month
  150. OIC - We need to execute a schedule job in oic that will run only on weekdays excluding public holidays?
  151. OIC - Create Secret in OCI Vault to store your keys and access from OIC
  152. OIC - How to get the outbound ip address of your oracle integration 3 instance
  153. OIC - "Using local-name() in XPath to Retrieve XML Data Without Namespace Prefix"
  154. OIC - Comparison of OIC Stage Action and FTP Connection Capabilities referring digital signature.
  155. OIC - How to rename a connection name in oracle Integration
  156. OIC - How to convert from one timezone to another timezone
  157. OIC - Convert DateTime from one timezone to another with Daylight saving in OIC
  158. OIC - Converting one XML Field Values to distinct Comma-Separated Entries" | How do I generate a comma-separated list with XSLT/XPath?
  159. OIC Gen3 - About OAuth setup to call integration and Factory APIs
  160. OIC - Handling Two Different Types of REST Responses in a REST API Call
  161. OIC - How to import prebuilt integrations from oracle market place | Oracle Utility CCS







Friday, July 30, 2021

OIC - Resolved - Stage read file in segements - XML-22031 : Error variable not defined.

Scenario:

This is a strange error. I have a orchestrated integration which performs the following:
  • First list the files from s3 directory using sftp
  • Then for each file, it downloads the file and  reads the file reference using stage read in segments. 
  • In the read in segement, we are wrting the line records in the required erp comma separated format. 
  • The downloaded file size is ~21MB.

Observation:

During transformation, we received below error:

Xpath expression failed to execute.

The reason was javax.xml.transform.TransformerException. 

XML-22031 : (Error) Variable not defines for "currFileRef".

Screenshot from OIC: errored in the writeLineRecord stage activity.



Solution: 

This is an Oracle bug. During mapping if any fields are blanks, then this kind of issues can occure. 

Oracle recommended to use a scope in the read file in segemets. Whintin the scope, the writeline stage and mapper will be there.

Screenshot after change:



After this small change, I have tested again with same 21MB source payload and it has magically processed without any error.

Thursday, July 29, 2021

django - POST request and CSRF tokens

lets first know the difference between http get and post. 

HTTP GET :

  • The GET method is the default submission method for a form.
  • The GET method sends the data in the form of URL parameters. Therefore, any data sent with the help of the GET method remains visible in the URL. Since the data is exposed in the URL, the GET method is not considered to send sensitive information such as passwords.
  • The GET method reveals the data in the URL bar; therefore, the length of the URL increases. The maximum length of a URL is 2048 characters, so only a limited amount of data can be sent using the GET method. The following error occurs when we try to send more than 2048 characters using GET :

POST :

  • Data sent by the POST method never gets visible in the URL box, and therefore it is more secure than the GET method, and sensitive information can be sent with the help of this method.
  • Since the data is not visible in the URL query, the length of the URL remains less than 2048 characters, and a large amount of data can be sent with the help of the POST method.
  • Data is sent to the server in the form of packages in a separate communication with the processing script.


Now, we will start our discussion on CSRF tokens.

WHAT ARE CSRF TOKENS?

  • CSRF stands for Cross-Site Request Forgery.
  • The server-side application generates and transmits a huge, random, and unpredictable number to the client to make sure that the request is coming from the original client and not from a malicious website.
  • CSRF tokens are used to protect the site against CSRF attacks.


Use POST:

In the template, here index.html file add the post method in the form.

<form action="/removePunctuation" method="post">

In the views.py, replace all the request.GET.get with the request.POST.get. 

from django.http import HttpResponse
from django.shortcuts import render


def removePunc(request):
# text=request.GET.get('text','default')
text = request.POST.get('text', 'default')
# text = request.POST.get('text', 'default')
check = request.POST.get('removepunc','off')

If you now test from server, you will get the CSRF error:

Test:

Error:

Use CSRF token:

To overcome the CSRF error, add the {% csrf_token%} in the template form

<form action="/removePunctuation" method="post">{% csrf_token %}


Test:

Success page:

Wednesday, July 28, 2021

OIC - callback action

Callback action used to end a process and return to the trigger. 

For instance, if you add a switch activity and define a branch in which you add a callback. If some defined logic is not met, then it moves to this branch and the integration is stopped and the trigger receives a response indicating that the integration is stopped here. 

This action is only valid for delayed or asynchronous integrations.


Lets have a small POC and see:


TBD


OIC - SFTP operations - Move and delete

Generally OIC supports following  5 Ftp operations:

  • Read a file
  • Write a file
  • List Files
  • Delete a file
  • Download a file
Here, I will show you the steps for a POC for move and delete operation.

Steps:

Step1: create an app driven or any other integration and create a rest trigger connection and drag and drop in the integration and configure the following:

Provide a endpoint name
Verb as POST
URI: /
Configure the request payload option

Request payload as Json:

{
"sourceDirectory": "sourceDirectory",
"fileName":"sourceFileName",
"targetDirectory":"target",
"targetFileName":"targetFile",
"moveFileFlag":"Y",
"deleteFileFlag" : "Y"
}

Step2: Take a switch acrivity and mention the condition moveFileFlag="Y" and take a SFTP connection and config the following:

Provide endpoint name: moveFile
Operation: Move a file
Overwrite file option checked.
Next
Done

Map the following :

directory: your source direcrory
fileName: file name
targetDirectory
targetFilename:

Step3: now take again a switch and mention the condition as deleteFileFlag=Y and drop a ftp connection and configure the following:

Provide endpoint name:

Operation : delete a file

Next

Done

Map the following:

directory:

fileName:

Step4: add the tracking, save and activate amd test it with proper data.

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...