-
Notifications
You must be signed in to change notification settings - Fork 63
#8: use redcore to connect joomla CMS #924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
CongThuong
wants to merge
4
commits into
redCOMPONENT-COM:develop
Choose a base branch
from
CongThuong:joomla-content
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+175
−0
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| <?php | ||
| /** | ||
| * @package Redcore | ||
| * @subpackage Api | ||
| * | ||
| * @copyright Copyright (C) 2008 - 2021 redWEB.dk. All rights reserved. | ||
| * @license GNU General Public License version 2 or later, see LICENSE. | ||
| */ | ||
|
|
||
| defined('JPATH_BASE') or die; | ||
|
|
||
| /** | ||
| * Api Helper class for overriding default methods | ||
| * | ||
| * @package Redcore | ||
| * @subpackage Api Helper | ||
| * @since 1.8 | ||
| */ | ||
| class RApiHalHelperSiteContent | ||
| { | ||
| /** | ||
| * Service for creating content. | ||
| * | ||
| * @param string $data content | ||
| * | ||
| * @return boolean True on success. False otherwise. | ||
| */ | ||
| public function save($data) | ||
| { | ||
| if (version_compare(JVERSION, '3.0', 'lt')) { | ||
| JTable::addIncludePath(JPATH_PLATFORM . 'joomla/database/table'); | ||
| } | ||
|
|
||
| $data = (object) $data; | ||
| $article = JTable::getInstance('content'); | ||
| $article->title = $data->title; | ||
| // $article->alias = JFilterOutput::stringURLSafe(time()); | ||
| $article->alias = JFilterOutput::stringURLSafe($data->title); | ||
| $article->introtext = '<p>'.$data->description.'</p>'; | ||
| $article->created = JFactory::getDate()->toSQL();; | ||
| $article->created_by_alias = $data->user; | ||
| $article->state = 1; | ||
| $article->access = 1; | ||
| $article->metadata = '{"page_title":"'.$data->title.'","author":"'.$data->user.'","robots":""}'; | ||
| $article->language = '*'; | ||
| // $article->catid = 1; | ||
|
||
|
|
||
| if (!$article->check()) { | ||
| throw new Exception($article->getError()); | ||
| return FALSE; | ||
| } | ||
|
|
||
| if (!$article->store(TRUE)) { | ||
| throw new Exception($article->getError()); | ||
| return FALSE; | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
|
||
| <wsdl:definitions xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://local.test.aesirx.io:88/media/redcore/webservices/site.content.1.0.0.wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://local.test.aesirx.io:88/media/redcore/webservices/site.content.1.0.0.wsdl"> | ||
| <wsdl:types> | ||
| <s:schema targetNamespace="http://local.test.aesirx.io:88/media/redcore/webservices/site.content.1.0.0.wsdl" elementFormDefault="unqualified"> | ||
| <s:complexType name="ArrayOfStringType"> | ||
| <s:sequence> | ||
| <s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string"/> | ||
| </s:sequence> | ||
| </s:complexType> | ||
| <s:element name="create"> | ||
| <s:complexType> | ||
| <s:sequence> | ||
| <s:element minOccurs="0" maxOccurs="1" name="data" type="s:string"/> | ||
| </s:sequence> | ||
| </s:complexType> | ||
| </s:element> | ||
| <s:element name="createResponse"> | ||
| <s:complexType> | ||
| <s:sequence> | ||
| <s:element minOccurs="1" maxOccurs="1" name="result" type="s:boolean"/> | ||
| </s:sequence> | ||
| </s:complexType> | ||
| </s:element> | ||
| </s:schema> | ||
| </wsdl:types> | ||
| <wsdl:service name="site.content.1.0.0"> | ||
| <wsdl:documentation/> | ||
| <wsdl:port name="site.content.1.0.0_Soap" binding="tns:site.content.1.0.0"> | ||
| <soap:address location="http://local.test.aesirx.io:88/administrator/index.php?webserviceClient=site&webserviceVersion=1.0.0&option=content&api=soap"/> | ||
| </wsdl:port> | ||
| </wsdl:service> | ||
| <wsdl:message name="createRequest"> | ||
| <wsdl:part name="parameters" element="tns:create"/> | ||
| </wsdl:message> | ||
| <wsdl:message name="createResponse"> | ||
| <wsdl:part name="parameters" element="tns:createResponse"/> | ||
| </wsdl:message> | ||
| <wsdl:portType name="site.content.1.0.0"> | ||
| <wsdl:operation name="create"> | ||
| <wsdl:input message="tns:createRequest"/> | ||
| <wsdl:output message="tns:createResponse"/> | ||
| </wsdl:operation> | ||
| </wsdl:portType> | ||
| <wsdl:binding name="site.content.1.0.0" type="tns:site.content.1.0.0"> | ||
| <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/> | ||
| <wsdl:operation name="create"> | ||
| <soap:operation soapAction="create" type="document"/> | ||
| <wsdl:input> | ||
| <soap:body use="literal"/> | ||
| </wsdl:input> | ||
| <wsdl:output> | ||
| <soap:body use="literal"/> | ||
| </wsdl:output> | ||
| </wsdl:operation> | ||
| </wsdl:binding> | ||
| </wsdl:definitions> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <?xml version="1.0"?> | ||
| <apiservice client="site"> | ||
| <name>content</name> | ||
| <author/> | ||
| <copyright/> | ||
| <description/> | ||
| <config> | ||
| <name>content</name> | ||
| <version>1.0.0</version> | ||
| <authorizationAssetName>com_{webserviceName}</authorizationAssetName> | ||
| </config> | ||
| <operations> | ||
| <documentation authorizationNeeded="false" source="auto" url=""/> | ||
| <create authorizationNeeded="false" strictFields="false" authorization="" dataMode="helper" optionName="" modelClassName="" modelClassPath="" isAdminClass="false" functionName="save" functionArgs="" validateData="none" validateDataFunction="validate" tableName=""> | ||
| <fields> | ||
| <field name="data" transform="string" defaultValue="" isRequiredField="false" isPrimaryField="false"/> | ||
| </fields> | ||
| <resources> | ||
| <resource displayGroup="_links" displayName="documentation" fieldFormat="{webserviceUrlPath}&format=doc#{rel}" linkTitle="Documentation" linkName="{webserviceName}" hrefLang="" linkTemplated="true" linkRel="curies"/> | ||
| <resource displayGroup="_links" displayName="base" fieldFormat="/" linkTitle="Default page"/> | ||
| <resource displayGroup="_links" displayName="{webserviceName}:list" fieldFormat="{webserviceUrlPath}"/> | ||
| <resource displayGroup="_links" displayName="{webserviceName}:self" fieldFormat="{webserviceUrlPath}&id={id}"/> | ||
| <resource displayName="result" fieldFormat="{result}" transform="boolean"/> | ||
| </resources> | ||
| </create> | ||
| </operations> | ||
| <complexArrays/> | ||
| </apiservice> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove unused code e @CongThuong