-
Notifications
You must be signed in to change notification settings - Fork 80
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
Implemented page document and API #114
Implemented page document and API #114
Conversation
5c04212
to
5539d04
Compare
5539d04
to
db430f4
Compare
* | ||
* @param AbstractMappingEvent $event | ||
*/ | ||
public function handleIndexLive(AbstractMappingEvent $event) |
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.
wasnt used anymore.
a03672a
to
038cb11
Compare
038cb11
to
767004f
Compare
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.
Looks good, pretty straight forward. Not sure about all these ONGR
annotations though, maybe somebody else can have a look on them.
throw new ParameterNotAllowedException('title', ArticlePageDocument::class); | ||
} | ||
if (array_key_exists('template', $data)) { | ||
throw new ParameterNotAllowedException('template', ArticlePageDocument::class); |
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.
At least until now we always ignored extra parameters... There's the same happening for the id
in many controllers in Sulu core... Not sure if we should start handling it here differently, resp. what would be the right way to handle this.
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.
the problem here is that this has a different meaning now title is the article-title and it cannot be changed over this controller.
@@ -32,17 +32,12 @@ public function buildForm(FormBuilderInterface $builder, array $options) | |||
// extensions | |||
$builder->add('extensions', TextType::class, ['property_path' => 'extensionsData']); | |||
|
|||
// TODO: Fix the admin interface to not send this junk (not required for articles) |
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.
Was this fix as easy as just removing these lines?
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.
no (: the fix is:
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(
[
'allow_extra_fields' => true,
]
);
}
which is done since a while in this class.
return; | ||
} | ||
|
||
$pageTitle = uniqid('page-', true); |
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.
Isn't that a strange page title? Shouldn't we fix that in a proper way? Looks like you are circumventing another problem here.
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.
it could be that the articles dont have a "pageTitle" attribute. it should not be mandatory. then we have to generate a "unique" node-name. this could be "Page 1", "Page 2" ... but that would mean that we have to update them on add and delete.
@@ -90,7 +96,11 @@ public function handleScheduleIndex(AbstractMappingEvent $event) | |||
{ | |||
$document = $event->getDocument(); | |||
if (!$document instanceof ArticleDocument) { | |||
return; | |||
if (!$document instanceof ArticlePageDocument) { | |||
return; |
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.
Just for my understanding: Is this case still possible? Or put differently: Can we still save ArticleDocument
s, or are we always saving ArticlePageDocuments
from now on?
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.
both is possible. The ArticleDocument is the first page and all the other pages has its own document.
); | ||
foreach ($this->documents as $documentData) { | ||
$document = $this->documentManager->find($documentData['uuid'], $documentData['locale']); | ||
$this->documentManager->refresh($document, $documentData['locale']); |
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.
Why is this refresh
now necessary?
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.
if you add a new page during the session you have to refresh the children property to be sure that you index the newest data.
@@ -122,14 +128,18 @@ | |||
<!-- This needs to happen after the content repository has been initialized !--> | |||
<tag name="sulu_document_manager.initializer" priority="-127"/> | |||
</service> | |||
<service id="sulu_article.serializer.type" | |||
<service id="sulu_article.serializer.article" |
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.
Mind that this is a BC break. Maybe we can add the public="false"
attribute, so that the BC break is not that bad (although it's still there, it is only less likely to occur).
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.
i will add the public=false flag.
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.
shit (: this does not work - subscriber has to be public https://travis-ci.org/sulu/SuluArticleBundle/jobs/215473502#L491
class="Sulu\Bundle\ArticleBundle\Document\Serializer\ArticleSubscriber"> | ||
<argument type="service" id="sulu.content.structure_manager"/> | ||
<argument type="service" id="sulu.content.type_manager"/> | ||
<argument type="service" id="sulu_article.content.data_provider.proxy_factory"/> | ||
|
||
<tag name="jms_serializer.event_subscriber" /> | ||
</service> | ||
<service id="sulu_article.serializer.article_page" |
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.
Could also be private?
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.
can add it also here
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.
shit (: this does not work https://travis-ci.org/sulu/SuluArticleBundle/jobs/215473502#L491
@@ -36,10 +36,14 @@ sulu_core: | |||
structure: | |||
default_type: | |||
article: "article_default" | |||
article_page: "article_default" |
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.
This also confuses me... Are these two types basically representing the same, and the only difference is that the article
represents the first page only?
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.
yes (: the configuration is a bit strange ... maybe find a better way to configure it later.
@danrot done |
0b88ef1
to
767004f
Compare
*/ | ||
public function getSecurityContext() | ||
{ | ||
return ArticleAdmin::SECURITY_CONTEXT; |
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.
👍
* implemented basic page document * added index pages to article
* implemented basic page document * added index pages to article
* implemented basic page document * added index pages to article
* implemented basic page document * added index pages to article
* implemented basic page document * added index pages to article
* implemented basic page document * added index pages to article
* implemented basic page document * added index pages to article
* implemented basic page document * added index pages to article
* implemented basic page document * added index pages to article
* Implemented page document and API (#114) * implemented basic page document * added index pages to article * fixed serialization context of article and article-page (#118) * Add interface to manage article-pages (#116) * introduced css grunt job * added article-router * added page dropdown * added logic to create and update pages * renamed adapter * Added article title to page form (#123) * added article title * fixed selector for css stye * fixed jquery selector of grid-row * added page to content-navigation (#125) * Fixed create article from ghost (#126) * fixed create article from ghost * hide new page link for new articls * fixed code style * added delete page button (#132) * added translations (#128) * added route-behavior to article-page (#131) * Fixed priorities of subscriber (#137) * fixed priorities of subscriber * added tag to find routePath property * Fixed title property (article-title) and add page title property (#141) * fixed title property (article-title) and add page title property * added node-name-slugifier * Changed generating route only on publish (#138) * use publish event to generate routes * refactored because of sulu changes * Added page-number argument to website-article-controller (#142) * added serialization of pages * added pages data to article-document * fixed comments * Added synchronize children between draft and live (#139) * added synchronice children between draft and live * fixed preview for new pages * fixed serialization for preview * fixed testcases * Fixed versioning and remove-draft of article-pages (#145) * fixed versioning of article-pages * added upgrade note * added constraint for jackalope/jackalope * implemented duplicate article (#146) * Fixed preview-serialization of article pages (#154) * fixed preview-serialization of article pages * change view of renderArticle * fixed type change on list (#156) * Fixed metadata for article to sync remove (#155) * fixed metadata for article * fixed routable-subscriber to remove all routes (locales) * removed article-page copy locale (#157) * fixed code-style * fixed test-setup
What's in this PR?
This PR introduces a
ArticlePageDocument
. This documents will be saved as childs ofArticleDocuments
.Why?
This is the first part of the "Multi-Page" feature.
To Do